| 1 |
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB |
| 2 |
PARTITION BY RANGE (a) ( |
| 3 |
PARTITION p0 VALUES LESS THAN (3), |
| 4 |
PARTITION p1 VALUES LESS THAN (10)); |
| 5 |
INSERT INTO t1 VALUES (1), (2), (3), (4); |
| 6 |
connect con1,localhost,root; |
| 7 |
SET DEBUG_SYNC="handler_rnd_next_end SIGNAL idx_scan_in_progress WAIT_FOR finish_scan"; |
| 8 |
SELECT * FROM t1; |
| 9 |
connection default; |
| 10 |
SET DEBUG_SYNC="now WAIT_FOR idx_scan_in_progress"; |
| 11 |
set @tmp=@@use_stat_tables; |
| 12 |
set use_stat_tables='preferably_for_queries'; |
| 13 |
ANALYZE TABLE t1; |
| 14 |
Table Op Msg_type Msg_text |
| 15 |
test.t1 analyze status OK |
| 16 |
set use_stat_tables=@tmp; |
| 17 |
SELECT * FROM t1; |
| 18 |
a |
| 19 |
1 |
| 20 |
2 |
| 21 |
3 |
| 22 |
4 |
| 23 |
SET DEBUG_SYNC="now SIGNAL finish_scan"; |
| 24 |
connection con1; |
| 25 |
a |
| 26 |
1 |
| 27 |
2 |
| 28 |
3 |
| 29 |
4 |
| 30 |
disconnect con1; |
| 31 |
connection default; |
| 32 |
SET DEBUG_SYNC='reset'; |
| 33 |
DROP TABLE t1; |
| 34 |
CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB |
| 35 |
PARTITION BY RANGE (a) |
| 36 |
SUBPARTITION BY HASH (A) |
| 37 |
SUBPARTITIONS 2 ( |
| 38 |
PARTITION p0 VALUES LESS THAN (3), |
| 39 |
PARTITION p1 VALUES LESS THAN (10)); |
| 40 |
INSERT INTO t2 VALUES (1), (2), (3), (4); |
| 41 |
connect con1,localhost,root; |
| 42 |
SET DEBUG_SYNC="handler_rnd_next_end SIGNAL idx_scan_in_progress WAIT_FOR finish_scan"; |
| 43 |
SELECT * FROM t2; |
| 44 |
connection default; |
| 45 |
SET DEBUG_SYNC="now WAIT_FOR idx_scan_in_progress"; |
| 46 |
set @tmp=@@use_stat_tables; |
| 47 |
set use_stat_tables='preferably_for_queries'; |
| 48 |
ANALYZE TABLE t2; |
| 49 |
Table Op Msg_type Msg_text |
| 50 |
test.t2 analyze status OK |
| 51 |
set use_stat_tables=@tmp; |
| 52 |
SELECT * FROM t2; |
| 53 |
a |
| 54 |
2 |
| 55 |
1 |
| 56 |
4 |
| 57 |
3 |
| 58 |
SET DEBUG_SYNC="now SIGNAL finish_scan"; |
| 59 |
connection con1; |
| 60 |
a |
| 61 |
2 |
| 62 |
1 |
| 63 |
4 |
| 64 |
3 |
| 65 |
disconnect con1; |
| 66 |
connection default; |
| 67 |
SET DEBUG_SYNC='reset'; |
| 68 |
DROP TABLE t2; |