Comments (3)
[16:14:44]TiDB root:test> SELECT * FROM (SELECT t0.c0, (TIMEDIFF('2003-07-13', '2007-06-25') AND true) IS TRUE AS flag FROM v0 LEFT JOIN t0 ON 1) AS t where flag = 1;
+------------+------+
| c0 | flag |
+------------+------+
| 1.4013e-45 | 1 |
+------------+------+
1 row in set
Time: 0.004s
[16:14:52]TiDB root:test> SELECT * FROM (SELECT t0.c0, (TIMEDIFF('2003-07-13', '2007-06-25') AND true) IS TRUE AS flag FROM v0 LEFT JOIN t0 ON 1) AS t ;
+--------+------+
| c0 | flag |
+--------+------+
| <null> | 1 |
+--------+------+
1 row in set
Time: 0.004s
[16:15:00]TiDB root:test> explain SELECT * FROM (SELECT t0.c0, (TIMEDIFF('2003-07-13', '2007-06-25') AND true) IS TRUE AS flag FROM v0 LEFT JOIN t0 ON 1) AS t where flag = 1;
+--------------------------+---------+-----------+---------------+---------------------------------------------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+--------------------------+---------+-----------+---------------+---------------------------------------------------------------------------------------------------------------+
| Projection_12 | 2.56 | root | | test.t0.c0, istrue(and(istrue_with_null(cast(timediff(2003-07-13, 2007-06-25), double BINARY)), 1))->Column#5 |
| └─HashJoin_14 | 2.56 | root | | CARTESIAN left outer join |
| ├─Selection_15(Build) | 1.60 | root | | eq(istrue(and(istrue_with_null(cast(timediff("2003-07-13", "2007-06-25"), double BINARY)), 1)), 1) |
| │ └─TableReader_18 | 2.00 | root | | data:TableFullScan_17 |
| │ └─TableFullScan_17 | 2.00 | cop[tikv] | table:t0 | keep order:false |
| └─Selection_19(Probe) | 1.60 | root | | eq(istrue(and(istrue_with_null(cast(timediff("2003-07-13", "2007-06-25"), double BINARY)), 1)), 1) |
| └─TableReader_21 | 2.00 | root | | data:TableFullScan_20 |
| └─TableFullScan_20 | 2.00 | cop[tikv] | table:t0 | keep order:false |
+--------------------------+---------+-----------+---------------+---------------------------------------------------------------------------------------------------------------+
8 rows in set
Time: 0.004s
[16:15:10]TiDB root:test> explain SELECT * FROM (SELECT t0.c0, (TIMEDIFF('2003-07-13', '2007-06-25') AND true) IS TRUE AS flag FROM v0 LEFT JOIN t0 ON 1) AS t ;
+---------------------------+---------+-----------+---------------+---------------------------------------------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+---------------------------+---------+-----------+---------------+---------------------------------------------------------------------------------------------------------------+
| Projection_8 | 4.00 | root | | test.t0.c0, istrue(and(istrue_with_null(cast(timediff(2003-07-13, 2007-06-25), double BINARY)), 1))->Column#5 |
| └─HashJoin_10 | 4.00 | root | | CARTESIAN left outer join |
| ├─Projection_11(Build) | 2.00 | root | | 1->Column#8 |
| │ └─TableReader_13 | 2.00 | root | | data:TableFullScan_12 |
| │ └─TableFullScan_12 | 2.00 | cop[tikv] | table:t0 | keep order:false |
| └─TableReader_15(Probe) | 2.00 | root | | data:TableFullScan_14 |
| └─TableFullScan_14 | 2.00 | cop[tikv] | table:t0 | keep order:false |
+---------------------------+---------+-----------+---------------+---------------------------------------------------------------------------------------------------------------+
from tidb.
The result of the select_15 and select_19 is correct, but the join is wrong.
from tidb.
The root cause is the same as #51290
from tidb.
Related Issues (20)
- concurrency auto analyze
- `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` env not work for aliyun provider
- Optimize the memory usage of lightning when importing parquet data format files HOT 3
- flaky test for disttask resource control
- The predicate columns feature relies on `tidb_persist_analyze_options`
- backup br stuck waiting for any response from TiKV
- Resolve the chaos usage of `Constant` HOT 4
- "ERROR 8121 (HY000): privilege check for 'Select' fail" occurs with an UPDATE statement that includes a CTE HOT 2
- Query returns error if using plan cache
- Query with `CONV` expression gives incorrect result if using plan cache
- Unexpected Result with NATURAL RIGHT JOIN and Bitwise NOT HOT 2
- flaky test TestSyncJobSchemaVerLoop
- make bench-daily get empty data for BenchmarkXXXPartitionXXX HOT 1
- release-7.5 branch bump https://github.com/pingcap/errors to the latest commit hash
- br backup always running but can not finish after network partition recover of br node HOT 1
- ttl: Make the default value of ttl job interval as a const
- tidb report redirect failed error HOT 2
- nightly br always occurs oom where restore 1M tables
- br restore splits too much regions if there are too many small tables whose data size is less than region size. HOT 1
- Add `EvalContext` argument for `Expression.GetType` and `ParamMarker.GetUserVar`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tidb.