-- get the test case wget https://github.com/ErwanMAS/consistent-read-mysql-bug/archive/master.zip bzcat consistent-read-mysql-bug-master/mysqldump/dump_bug_consistent_read.bz2 | bin/mysql -uroot -S /tmp/mysql_ushastry.sock test bzcat consistent-read-mysql-bug-master/mysqldump/dump_bug_consistent_read_feed.bz2 | bin/mysql -uroot -S /tmp/mysql_ushastry.sock test - Session A bin/mysql -uroot -S /tmp/mysql_ushastry.sock --prompt='SessionA>' Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 12 Server version: 5.7.29 MySQL Community Server (GPL) Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. SessionA>show variables like 'tx%'; +---------------+-----------------+ | Variable_name | Value | +---------------+-----------------+ | tx_isolation | REPEATABLE-READ | SessionA>use test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed SessionA>source consistent-read-mysql-bug-master/bug_buggy_chunks.sql; *************************** 1. row *************************** chunk_02000_000000019: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000021: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000029: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000034: 2000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_02000_000000046: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000048: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000070: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000078: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000097: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000099: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000110: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000121: 2000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_02000_000000136: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000004540: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000007: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000009: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000014: 5000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_05000_000000016: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000019: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000020: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000021: 5000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_05000_000000024: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000028: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000032: 5000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_05000_000000036: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000040: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000042: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000044: 5000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_05000_000000045: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000048: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000049: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000055: 5000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_10000_000000004: 10000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_10000_000000005: 10000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_10000_000000011: 10000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_10000_000000013: 10000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_10000_000000023: 10000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_10000_000000024: 10000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_10000_000000025: 10000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_10000_000000027: 10000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_15000_000000002: 15000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_15000_000000006: 15000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_15000_000000007: 15000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_15000_000000009: 15000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_15000_000000010: 15000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_15000_000000014: 15000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_15000_000000017: 15000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_15000_000000019: 15000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_20000_000000003: 20000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_20000_000000006: 20000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_20000_000000007: 20000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_20000_000000012: 20000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_20000_000000013: 20000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_20000_000000014: 20000 1 row in set (0.01 sec) - Session B bin/mysql -uroot -S /tmp/mysql_ushastry.sock --prompt='SessionB>' Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 13 Server version: 5.7.29 MySQL Community Server (GPL) Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. SessionB>use test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed SessionB>START TRANSACTION WITH CONSISTENT SNAPSHOT ; Query OK, 0 rows affected (0.00 sec) SessionB>source consistent-read-mysql-bug-master/bug_buggy_chunks.sql; *************************** 1. row *************************** chunk_02000_000000019: 2000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_02000_000000021: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000029: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000034: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000046: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000048: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000070: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000078: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000097: 2000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_02000_000000099: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000110: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000121: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000000136: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000004540: 2000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000007: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000009: 5000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_05000_000000014: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000016: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000019: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000020: 5000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_05000_000000021: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000024: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000028: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000032: 5000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_05000_000000036: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000040: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000042: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000044: 5000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_05000_000000045: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000048: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000049: 5000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_05000_000000055: 5000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_10000_000000004: 10000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_10000_000000005: 10000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_10000_000000011: 10000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_10000_000000013: 10000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_10000_000000023: 10000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_10000_000000024: 10000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_10000_000000025: 10000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_10000_000000027: 10000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_15000_000000002: 15000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_15000_000000006: 15000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_15000_000000007: 15000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_15000_000000009: 15000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_15000_000000010: 15000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_15000_000000014: 15000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_15000_000000017: 15000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_15000_000000019: 15000 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_20000_000000003: 20000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_20000_000000006: 20000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_20000_000000007: 20000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_20000_000000012: 20000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_20000_000000013: 20000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_20000_000000014: 20000 1 row in set (0.00 sec) - Session A SessionA>source consistent-read-mysql-bug-master/bug_create_buggy.sql; Query OK, 1000 rows affected (0.04 sec) Records: 1000 Duplicates: 0 Warnings: 0 Query OK, 1000 rows affected (0.04 sec) Records: 1000 Duplicates: 0 Warnings: 0 Query OK, 1000 rows affected (0.03 sec) Records: 1000 Duplicates: 0 Warnings: 0 Query OK, 1000 rows affected (0.04 sec) Records: 1000 Duplicates: 0 Warnings: 0 Query OK, 2000 rows affected (0.08 sec) Records: 2000 Duplicates: 0 Warnings: 0 Query OK, 4000 rows affected (0.15 sec) Records: 4000 Duplicates: 0 Warnings: 0 Query OK, 4000 rows affected (0.16 sec) Records: 4000 Duplicates: 0 Warnings: 0 Query OK, 4000 rows affected (0.18 sec) Records: 4000 Duplicates: 0 Warnings: 0 Query OK, 4000 rows affected (0.18 sec) Records: 4000 Duplicates: 0 Warnings: 0 Query OK, 40000 rows affected (1.57 sec) Records: 40000 Duplicates: 0 Warnings: 0 Query OK, 40000 rows affected (1.98 sec) Records: 40000 Duplicates: 0 Warnings: 0 Query OK, 40000 rows affected (2.47 sec) Records: 40000 Duplicates: 0 Warnings: 0 Query OK, 40000 rows affected (2.72 sec) Records: 40000 Duplicates: 0 Warnings: 0 Query OK, 80000 rows affected (5.92 sec) Records: 80000 Duplicates: 0 Warnings: 0 Query OK, 80000 rows affected (7.06 sec) Records: 80000 Duplicates: 0 Warnings: 0 Query OK, 80000 rows affected (8.57 sec) Records: 80000 Duplicates: 0 Warnings: 0 Query OK, 80000 rows affected (9.60 sec) Records: 80000 Duplicates: 0 Warnings: 0 Query OK, 80000 rows affected (10.05 sec) Records: 80000 Duplicates: 0 Warnings: 0 Query OK, 80000 rows affected (10.66 sec) Records: 80000 Duplicates: 0 Warnings: 0 Query OK, 80000 rows affected (11.00 sec) Records: 80000 Duplicates: 0 Warnings: 0 Query OK, 80000 rows affected (11.43 sec) Records: 80000 Duplicates: 0 Warnings: 0 Query OK, 80000 rows affected (11.90 sec) Records: 80000 Duplicates: 0 Warnings: 0 Query OK, 80000 rows affected (12.26 sec) Records: 80000 Duplicates: 0 Warnings: 0 SessionA> -- Session B SessionB>source consistent-read-mysql-bug-master/bug_buggy_chunks.sql; *************************** 1. row *************************** chunk_02000_000000019: 1706 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_02000_000000021: 1938 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_02000_000000029: 1975 1 row in set (0.07 sec) *************************** 1. row *************************** chunk_02000_000000034: 1432 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_02000_000000046: 1550 1 row in set (0.02 sec) *************************** 1. row *************************** chunk_02000_000000048: 1770 1 row in set (0.05 sec) *************************** 1. row *************************** chunk_02000_000000070: 1873 1 row in set (0.04 sec) *************************** 1. row *************************** chunk_02000_000000078: 1872 1 row in set (0.04 sec) *************************** 1. row *************************** chunk_02000_000000097: 1715 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_02000_000000099: 1763 1 row in set (0.03 sec) *************************** 1. row *************************** chunk_02000_000000110: 1389 1 row in set (0.04 sec) *************************** 1. row *************************** chunk_02000_000000121: 1220 1 row in set (0.03 sec) *************************** 1. row *************************** chunk_02000_000000136: 1878 1 row in set (0.00 sec) *************************** 1. row *************************** chunk_02000_000004540: 2000 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_05000_000000007: 3225 1 row in set (0.06 sec) *************************** 1. row *************************** chunk_05000_000000009: 4926 1 row in set (0.02 sec) *************************** 1. row *************************** chunk_05000_000000014: 4231 1 row in set (0.02 sec) *************************** 1. row *************************** chunk_05000_000000016: 4863 1 row in set (0.05 sec) *************************** 1. row *************************** chunk_05000_000000019: 4523 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_05000_000000020: 3742 1 row in set (0.02 sec) *************************** 1. row *************************** chunk_05000_000000021: 4264 1 row in set (0.09 sec) *************************** 1. row *************************** chunk_05000_000000024: 2812 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_05000_000000028: 2921 1 row in set (0.03 sec) *************************** 1. row *************************** chunk_05000_000000032: 3826 1 row in set (0.06 sec) *************************** 1. row *************************** chunk_05000_000000036: 4071 1 row in set (0.06 sec) *************************** 1. row *************************** chunk_05000_000000040: 4347 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_05000_000000042: 4351 1 row in set (0.08 sec) *************************** 1. row *************************** chunk_05000_000000044: 4967 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_05000_000000045: 4852 1 row in set (0.03 sec) *************************** 1. row *************************** chunk_05000_000000048: 4092 1 row in set (0.03 sec) *************************** 1. row *************************** chunk_05000_000000049: 4148 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_05000_000000055: 4797 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_10000_000000004: 8222 1 row in set (0.02 sec) *************************** 1. row *************************** chunk_10000_000000005: 9922 1 row in set (0.06 sec) *************************** 1. row *************************** chunk_10000_000000011: 9254 1 row in set (0.04 sec) *************************** 1. row *************************** chunk_10000_000000013: 9045 1 row in set (0.06 sec) *************************** 1. row *************************** chunk_10000_000000023: 9830 1 row in set (0.03 sec) *************************** 1. row *************************** chunk_10000_000000024: 9323 1 row in set (0.02 sec) *************************** 1. row *************************** chunk_10000_000000025: 9124 1 row in set (0.02 sec) *************************** 1. row *************************** chunk_10000_000000027: 8964 1 row in set (0.02 sec) *************************** 1. row *************************** chunk_15000_000000002: 14345 1 row in set (0.02 sec) *************************** 1. row *************************** chunk_15000_000000006: 14853 1 row in set (0.03 sec) *************************** 1. row *************************** chunk_15000_000000007: 14511 1 row in set (0.01 sec) *************************** 1. row *************************** chunk_15000_000000009: 14041 1 row in set (0.02 sec) *************************** 1. row *************************** chunk_15000_000000010: 12903 1 row in set (0.03 sec) *************************** 1. row *************************** chunk_15000_000000014: 14321 1 row in set (0.02 sec) *************************** 1. row *************************** chunk_15000_000000017: 14116 1 row in set (0.04 sec) *************************** 1. row *************************** chunk_15000_000000019: 14761 1 row in set (0.03 sec) *************************** 1. row *************************** chunk_20000_000000003: 19920 1 row in set (0.06 sec) *************************** 1. row *************************** chunk_20000_000000006: 19249 1 row in set (0.06 sec) *************************** 1. row *************************** chunk_20000_000000007: 19039 1 row in set (0.04 sec) *************************** 1. row *************************** chunk_20000_000000012: 19819 1 row in set (0.05 sec) *************************** 1. row *************************** chunk_20000_000000013: 19112 1 row in set (0.04 sec) *************************** 1. row *************************** chunk_20000_000000014: 18951 1 row in set (0.02 sec) SessionB>