@@ -364,7 +364,6 @@ func TestBuildPlanSuccess(t *testing.T) {
364
364
},
365
365
}, {
366
366
// in_keyrange on RHS of AND.
367
- // This is currently not a valid construct, but will be supported in the future.
368
367
input : & binlogdatapb.Rule {
369
368
Match : "t1" ,
370
369
Filter : "select * from t1 where c2 = 2 and in_keyrange('-80')" ,
@@ -374,7 +373,7 @@ func TestBuildPlanSuccess(t *testing.T) {
374
373
dbName : vdiffDBName ,
375
374
table : testSchema .TableDefinitions [tableDefMap ["t1" ]],
376
375
sourceQuery : "select c1, c2 from t1 where c2 = 2 and in_keyrange('-80') order by c1 asc" ,
377
- targetQuery : "select c1, c2 from t1 order by c1 asc" ,
376
+ targetQuery : "select c1, c2 from t1 where c2 = 2 order by c1 asc" ,
378
377
compareCols : []compareColInfo {{0 , collations .MySQL8 ().LookupByName (sqltypes .NULL .String ()), true , "c1" }, {1 , collations .MySQL8 ().LookupByName (sqltypes .NULL .String ()), false , "c2" }},
379
378
comparePKs : []compareColInfo {{0 , collations .MySQL8 ().LookupByName (sqltypes .NULL .String ()), true , "c1" }},
380
379
pkCols : []int {0 },
@@ -386,7 +385,6 @@ func TestBuildPlanSuccess(t *testing.T) {
386
385
},
387
386
}, {
388
387
// in_keyrange on LHS of AND.
389
- // This is currently not a valid construct, but will be supported in the future.
390
388
input : & binlogdatapb.Rule {
391
389
Match : "t1" ,
392
390
Filter : "select * from t1 where in_keyrange('-80') and c2 = 2" ,
@@ -396,7 +394,7 @@ func TestBuildPlanSuccess(t *testing.T) {
396
394
dbName : vdiffDBName ,
397
395
table : testSchema .TableDefinitions [tableDefMap ["t1" ]],
398
396
sourceQuery : "select c1, c2 from t1 where in_keyrange('-80') and c2 = 2 order by c1 asc" ,
399
- targetQuery : "select c1, c2 from t1 order by c1 asc" ,
397
+ targetQuery : "select c1, c2 from t1 where c2 = 2 order by c1 asc" ,
400
398
compareCols : []compareColInfo {{0 , collations .MySQL8 ().LookupByName (sqltypes .NULL .String ()), true , "c1" }, {1 , collations .MySQL8 ().LookupByName (sqltypes .NULL .String ()), false , "c2" }},
401
399
comparePKs : []compareColInfo {{0 , collations .MySQL8 ().LookupByName (sqltypes .NULL .String ()), true , "c1" }},
402
400
pkCols : []int {0 },
@@ -408,7 +406,6 @@ func TestBuildPlanSuccess(t *testing.T) {
408
406
},
409
407
}, {
410
408
// in_keyrange on cascaded AND expression.
411
- // This is currently not a valid construct, but will be supported in the future.
412
409
input : & binlogdatapb.Rule {
413
410
Match : "t1" ,
414
411
Filter : "select * from t1 where c2 = 2 and c1 = 1 and in_keyrange('-80')" ,
@@ -418,7 +415,7 @@ func TestBuildPlanSuccess(t *testing.T) {
418
415
dbName : vdiffDBName ,
419
416
table : testSchema .TableDefinitions [tableDefMap ["t1" ]],
420
417
sourceQuery : "select c1, c2 from t1 where c2 = 2 and c1 = 1 and in_keyrange('-80') order by c1 asc" ,
421
- targetQuery : "select c1, c2 from t1 order by c1 asc" ,
418
+ targetQuery : "select c1, c2 from t1 where c2 = 2 and c1 = 1 order by c1 asc" ,
422
419
compareCols : []compareColInfo {{0 , collations .MySQL8 ().LookupByName (sqltypes .NULL .String ()), true , "c1" }, {1 , collations .MySQL8 ().LookupByName (sqltypes .NULL .String ()), false , "c2" }},
423
420
comparePKs : []compareColInfo {{0 , collations .MySQL8 ().LookupByName (sqltypes .NULL .String ()), true , "c1" }},
424
421
pkCols : []int {0 },
@@ -430,7 +427,6 @@ func TestBuildPlanSuccess(t *testing.T) {
430
427
},
431
428
}, {
432
429
// in_keyrange parenthesized.
433
- // This is currently not a valid construct, but will be supported in the future.
434
430
input : & binlogdatapb.Rule {
435
431
Match : "t1" ,
436
432
Filter : "select * from t1 where (c2 = 2 and in_keyrange('-80'))" ,
@@ -440,7 +436,7 @@ func TestBuildPlanSuccess(t *testing.T) {
440
436
dbName : vdiffDBName ,
441
437
table : testSchema .TableDefinitions [tableDefMap ["t1" ]],
442
438
sourceQuery : "select c1, c2 from t1 where c2 = 2 and in_keyrange('-80') order by c1 asc" ,
443
- targetQuery : "select c1, c2 from t1 order by c1 asc" ,
439
+ targetQuery : "select c1, c2 from t1 where c2 = 2 order by c1 asc" ,
444
440
compareCols : []compareColInfo {{0 , collations .MySQL8 ().LookupByName (sqltypes .NULL .String ()), true , "c1" }, {1 , collations .MySQL8 ().LookupByName (sqltypes .NULL .String ()), false , "c2" }},
445
441
comparePKs : []compareColInfo {{0 , collations .MySQL8 ().LookupByName (sqltypes .NULL .String ()), true , "c1" }},
446
442
pkCols : []int {0 },
0 commit comments