@@ -108,7 +108,7 @@ func TestAssignIndexes(t *testing.T) {
108108 node := plan .NewProject (
109109 []sql.Expression {},
110110 plan .NewFilter (
111- expression .NewOr (
111+ expression .NewAnd (
112112 expression .NewEquals (
113113 expression .NewGetFieldWithTable (0 , sql .Int64 , "t2" , "bar" , false ),
114114 expression .NewLiteral (int64 (1 ), sql .Int64 ),
@@ -473,6 +473,43 @@ func TestGetIndexes(t *testing.T) {
473473 },
474474 true ,
475475 },
476+ {
477+ or (
478+ eq (
479+ col (0 , "t1" , "bar" ),
480+ lit (3 ),
481+ ),
482+ eq (
483+ col (0 , "t2" , "bar" ),
484+ lit (4 ),
485+ ),
486+ ),
487+ nil ,
488+ true ,
489+ },
490+ {
491+ and (
492+ eq (
493+ col (0 , "t1" , "bar" ),
494+ lit (3 ),
495+ ),
496+ eq (
497+ col (0 , "t2" , "bar" ),
498+ lit (4 ),
499+ ),
500+ ),
501+ map [string ]* indexLookup {
502+ "t1" : & indexLookup {
503+ mergeableIndexLookup ("t1" , "bar" , 0 , int64 (3 )),
504+ []sql.Index {indexes [0 ]},
505+ },
506+ "t2" : & indexLookup {
507+ mergeableIndexLookup ("t2" , "bar" , 0 , int64 (4 )),
508+ []sql.Index {indexes [2 ]},
509+ },
510+ },
511+ true ,
512+ },
476513 {
477514 and (
478515 eq (
@@ -546,30 +583,7 @@ func TestGetIndexes(t *testing.T) {
546583 ),
547584 ),
548585 ),
549- map [string ]* indexLookup {
550- "t1" : & indexLookup {
551- mergeableIndexLookup ("t1" , "bar" , 0 , int64 (3 )),
552- []sql.Index {indexes [0 ]},
553- },
554- "t2" : & indexLookup {
555- unionLookup ("t2" , "bar" , 0 ,
556- mergeableIndexLookup ("t2" , "bar" , 0 , int64 (5 )),
557- & memory.MergeableIndexLookup {
558- Key : []interface {}{int64 (1 ), int64 (2 )},
559- Index : & memory.MergeableIndex {
560- TableName : "t2" ,
561- Exprs : []sql.Expression {
562- col (0 , "t2" , "foo" ),
563- col (0 , "t2" , "bar" ),
564- },
565- },
566- }),
567- []sql.Index {
568- indexes [2 ],
569- indexes [1 ],
570- },
571- },
572- },
586+ nil ,
573587 true ,
574588 },
575589 {
0 commit comments