Skip to content

Commit bc653de

Browse files
bladepanfacebook-github-bot
authored andcommitted
fix bypass sql fallback not reading columns
Summary: when bypass falls back to mysql execution, bypass already made changes to the field object's state, mysql skipped setting `table->read_list` bit for some columns because of this. The storage engine does not read columns not set in the `table->read_list` bitmap. - delay making changes to field object to the execution phase - when there is error happen in execution phase, we will only fallback when m_unsupported is set, this happens before we make changes to field objects, so when fallback happens, field objects are in 'clean' state - minor refactor in nosql_access.cc - new test case of verifying data read in fallback scenarios Reviewed By: luqun, jupyung Differential Revision: D43201630 fbshipit-source-id: 677e42e
1 parent 2958c1b commit bc653de

File tree

6 files changed

+343
-206
lines changed

6 files changed

+343
-206
lines changed

mysql-test/suite/rocksdb/include/bypass_create_table.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,14 @@ insert into link_table5 values (1, 1, 5, 2, 2, 1, 'data15', 1, 1);
263263
insert into link_table5 values (2, 1, 1, 2, 2, 1, 'data21', 1, 1);
264264
insert into link_table5 values (2, 1, 2, 2, 2, 1, 'data22', 1, 1);
265265
insert into link_table5 values (2, 1, 3, 2, 2, 1, 'data32', 1, 1);
266+
insert into link_table5 values
267+
(100, 101, 102, 103, 104, 1, 'data100', 105, 106);
268+
insert into link_table5 values
269+
(200, 201, 202, 203, 204, 2, 'data200', 205, 206);
270+
insert into link_table5 values
271+
(300, 301, 302, 303, 304, 3, 'data300', 305, 306);
272+
insert into link_table5 values
273+
(400, 401, 402, 403, 404, 4, 'data400', 405, 406);
266274

267275

268276
CREATE TABLE `link_table5_rev` (

mysql-test/suite/rocksdb/r/bypass_select_range_pk.result

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ id1 id2 link_type visibility version
358358
2 2 2 1 data22
359359
2 3 2 1 data32
360360
ROWS_READ
361-
39
361+
43
362362
COVERED_SK_LOOKUP
363363
0
364364
include/assert.inc [Verify executed in bypass]
@@ -1862,7 +1862,7 @@ id1 id2 link_type visibility version
18621862
0 3 0 2 data13
18631863
0 2 0 1 data12
18641864
ROWS_READ
1865-
39
1865+
43
18661866
COVERED_SK_LOOKUP
18671867
0
18681868
include/assert.inc [Verify executed in bypass]
@@ -3366,7 +3366,7 @@ id1 id2 link_type visibility version
33663366
2 2 2 1 data22
33673367
2 3 2 1 data32
33683368
ROWS_READ
3369-
39
3369+
43
33703370
COVERED_SK_LOOKUP
33713371
0
33723372
include/assert.inc [Verify executed in bypass]
@@ -4870,7 +4870,7 @@ id1 id2 link_type visibility version
48704870
0 3 0 2 data13
48714871
0 2 0 1 data12
48724872
ROWS_READ
4873-
39
4873+
43
48744874
COVERED_SK_LOOKUP
48754875
0
48764876
include/assert.inc [Verify executed in bypass]
@@ -6471,7 +6471,7 @@ id1 id2 link_type visibility version
64716471
2 2 2 1 data22
64726472
2 3 2 1 data32
64736473
ROWS_READ
6474-
39
6474+
43
64756475
COVERED_SK_LOOKUP
64766476
0
64776477
include/assert.inc [Verify executed in bypass]
@@ -7975,7 +7975,7 @@ id1 id2 link_type visibility version
79757975
0 3 0 2 data13
79767976
0 2 0 1 data12
79777977
ROWS_READ
7978-
39
7978+
43
79797979
COVERED_SK_LOOKUP
79807980
0
79817981
include/assert.inc [Verify executed in bypass]
@@ -9479,7 +9479,7 @@ id1 id2 link_type visibility version
94799479
2 2 2 1 data22
94809480
2 3 2 1 data32
94819481
ROWS_READ
9482-
39
9482+
43
94839483
COVERED_SK_LOOKUP
94849484
0
94859485
include/assert.inc [Verify executed in bypass]
@@ -10983,7 +10983,7 @@ id1 id2 link_type visibility version
1098310983
0 3 0 2 data13
1098410984
0 2 0 1 data12
1098510985
ROWS_READ
10986-
39
10986+
43
1098710987
COVERED_SK_LOOKUP
1098810988
0
1098910989
include/assert.inc [Verify executed in bypass]

mysql-test/suite/rocksdb/r/bypass_select_range_pk_bloom.result

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ id1 id2 link_type visibility version
358358
2 2 2 1 data22
359359
2 3 2 1 data32
360360
ROWS_READ
361-
39
361+
43
362362
COVERED_SK_LOOKUP
363363
0
364364
include/assert.inc [Verify executed in bypass]
@@ -1862,7 +1862,7 @@ id1 id2 link_type visibility version
18621862
0 3 0 2 data13
18631863
0 2 0 1 data12
18641864
ROWS_READ
1865-
39
1865+
43
18661866
COVERED_SK_LOOKUP
18671867
0
18681868
include/assert.inc [Verify executed in bypass]
@@ -3366,7 +3366,7 @@ id1 id2 link_type visibility version
33663366
2 2 2 1 data22
33673367
2 3 2 1 data32
33683368
ROWS_READ
3369-
39
3369+
43
33703370
COVERED_SK_LOOKUP
33713371
0
33723372
include/assert.inc [Verify executed in bypass]
@@ -4870,7 +4870,7 @@ id1 id2 link_type visibility version
48704870
0 3 0 2 data13
48714871
0 2 0 1 data12
48724872
ROWS_READ
4873-
39
4873+
43
48744874
COVERED_SK_LOOKUP
48754875
0
48764876
include/assert.inc [Verify executed in bypass]
@@ -6471,7 +6471,7 @@ id1 id2 link_type visibility version
64716471
2 2 2 1 data22
64726472
2 3 2 1 data32
64736473
ROWS_READ
6474-
39
6474+
43
64756475
COVERED_SK_LOOKUP
64766476
0
64776477
include/assert.inc [Verify executed in bypass]
@@ -7975,7 +7975,7 @@ id1 id2 link_type visibility version
79757975
0 3 0 2 data13
79767976
0 2 0 1 data12
79777977
ROWS_READ
7978-
39
7978+
43
79797979
COVERED_SK_LOOKUP
79807980
0
79817981
include/assert.inc [Verify executed in bypass]
@@ -9479,7 +9479,7 @@ id1 id2 link_type visibility version
94799479
2 2 2 1 data22
94809480
2 3 2 1 data32
94819481
ROWS_READ
9482-
39
9482+
43
94839483
COVERED_SK_LOOKUP
94849484
0
94859485
include/assert.inc [Verify executed in bypass]
@@ -10983,7 +10983,7 @@ id1 id2 link_type visibility version
1098310983
0 3 0 2 data13
1098410984
0 2 0 1 data12
1098510985
ROWS_READ
10986-
39
10986+
43
1098710987
COVERED_SK_LOOKUP
1098810988
0
1098910989
include/assert.inc [Verify executed in bypass]

0 commit comments

Comments
 (0)