-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TiDB produces different results for SELECT statement when using transaction #29947
Labels
affects-4.0
This bug affects 4.0.x versions.
affects-5.0
This bug affects 5.0.x versions.
affects-5.1
This bug affects 5.1.x versions.
affects-5.2
This bug affects 5.2.x versions.
affects-5.3
This bug affects 5.3.x versions.
severity/critical
sig/execution
SIG execution
type/bug
The issue is confirmed as a bug.
Comments
JZuming
changed the title
TiDB produce different results for SELECT statement when using transaction
TiDB produces different results for SELECT statement when using transaction
Nov 19, 2021
ChenPeng2013
added
sig/transaction
SIG:Transaction
sig/execution
SIG execution
and removed
sig/transaction
SIG:Transaction
labels
Nov 22, 2021
Reproduce script:
Then run the test case. |
ChenPeng2013
added
affects-4.0
This bug affects 4.0.x versions.
affects-5.0
This bug affects 5.0.x versions.
affects-5.1
This bug affects 5.1.x versions.
affects-5.2
This bug affects 5.2.x versions.
affects-5.3
This bug affects 5.3.x versions.
severity/critical
labels
Nov 22, 2021
without txn: +------------------------------------+---------+---------+-----------+---------------+------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+------------+---------+
| id | estRows | actRows | task | access object | execution info | operator info | memory | disk |
+------------------------------------+---------+---------+-----------+---------------+------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+------------+---------+
| Projection_9 | 32.00 | 2 | root | | time:338.7µs, loops:2, Concurrency:OFF | Column#7 | 1.34 KB | N/A |
| └─Selection_10 | 32.00 | 2 | root | | time:335.3µs, loops:2 | ne(Column#7, 1) | 1.34 KB | N/A |
| └─Shuffle_15 | 40.00 | 23 | root | | time:281µs, loops:7, ShuffleConcurrency:5 | execution info: concurrency:5, data sources:[TableReader_13] | N/A | N/A |
| └─Window_11 | 40.00 | 23 | root | | time:1.25ms, loops:10 | count(1)->Column#7 over(partition by test.t_tir89b.c_0b6nxb order by test.t_tir89b.c_3pcik range between unbounded preceding and current row) | N/A | N/A |
| └─Sort_14 | 40.00 | 23 | root | | time:936.3µs, loops:10 | test.t_tir89b.c_0b6nxb, test.t_tir89b.c_3pcik | 1000 Bytes | 0 Bytes |
| └─ShuffleReceiver_20 | 40.00 | 0 | root | | | | N/A | N/A |
| └─TableReader_13 | 40.00 | 46 | root | | time:930.5µs, loops:12, cop_task: {num: 1, max: 189µs, proc_keys: 0, rpc_num: 1, rpc_time: 168.9µs, copr_cache_hit_ratio: 0.00} | data:TableFullScan_12 | 370 Bytes | N/A |
| └─TableFullScan_12 | 40.00 | 23 | cop[tikv] | table:ref_0 | tikv_task:{time:7.18µs, loops:23} | keep order:false, stats:pseudo | N/A | N/A |
+------------------------------------+---------+---------+-----------+---------------+------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+------------+---------+ |
with txn: +--------------------------------------+----------+---------+-----------+---------------+--------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------+
| id | estRows | actRows | task | access object | execution info | operator info | memory | disk |
+--------------------------------------+----------+---------+-----------+---------------+--------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------+
| Projection_10 | 8000.00 | 0 | root | | time:179.5µs, loops:1, Concurrency:5 | Column#7 | 10.3 KB | N/A |
| └─Selection_11 | 8000.00 | 0 | root | | time:147.2µs, loops:1 | ne(Column#7, 1) | 1.70 KB | N/A |
| └─Shuffle_18 | 10000.00 | 23 | root | | time:99.7µs, loops:6, ShuffleConcurrency:5 | execution info: concurrency:5, data sources:[UnionScan_14] | N/A | N/A |
| └─Window_12 | 10000.00 | 23 | root | | time:402.7µs, loops:10 | count(1)->Column#7 over(partition by test.t_tir89b.c_0b6nxb order by test.t_tir89b.c_3pcik range between unbounded preceding and current row) | N/A | N/A |
| └─Sort_17 | 10000.00 | 23 | root | | time:310.1µs, loops:10 | test.t_tir89b.c_0b6nxb, test.t_tir89b.c_3pcik | 1.34 KB | 0 Bytes |
| └─ShuffleReceiver_23 | 10000.00 | 0 | root | | | | N/A | N/A |
| └─UnionScan_14 | 10000.00 | 46 | root | | time:291.3µs, loops:12 | | N/A | N/A |
| └─TableReader_16 | 10000.00 | 40 | root | | time:27µs, loops:3, cop_task: {num: 1, max: 64.9µs, proc_keys: 0, rpc_num: 1, rpc_time: 59.2µs, copr_cache_hit_ratio: 0.00} | data:TableFullScan_15 | 591 Bytes | N/A |
| └─TableFullScan_15 | 10000.00 | 40 | cop[tikv] | table:ref_0 | tikv_task:{time:7.13µs, loops:40} | keep order:false, stats:pseudo | N/A | N/A |
+--------------------------------------+----------+---------+-----------+---------------+--------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+-----------+---------+ |
2 tasks
This was referenced Dec 3, 2021
Merged
Merged
Merged
Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects-4.0
This bug affects 4.0.x versions.
affects-5.0
This bug affects 5.0.x versions.
affects-5.1
This bug affects 5.1.x versions.
affects-5.2
This bug affects 5.2.x versions.
affects-5.3
This bug affects 5.3.x versions.
severity/critical
sig/execution
SIG execution
type/bug
The issue is confirmed as a bug.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Setup the environment:
mysql_bk.sql: mysql_bk.sql.txt
Testcase 1
Testcase 2
2. What did you expect to see? (Required)
The outputs of SELECT statements in Testcase 1 and Testcase 2 are same.
3. What did you see instead (Required)
Output of SELECT statement in Testcase 1
Output of SELECT statement in Testcase 2
The output of Testcase 1 contains element 2 and 3, while the output of Testcase 2 (using transaction) is empty. So their results are different.
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: