From 4451af63c4c92dc6f5bc984c2e6ba6ea0bf2d621 Mon Sep 17 00:00:00 2001 From: Andres Taylor Date: Thu, 15 Aug 2024 08:37:34 +0200 Subject: [PATCH] review comments Signed-off-by: Andres Taylor --- go/vt/vtgate/planbuilder/operators/projection_pushing.go | 3 +-- go/vt/vtgate/planbuilder/testdata/from_cases.json | 4 ++-- go/vt/vtgate/planbuilder/testdata/tpch_cases.json | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/go/vt/vtgate/planbuilder/operators/projection_pushing.go b/go/vt/vtgate/planbuilder/operators/projection_pushing.go index 21d2a058a86..1d1a5a04501 100644 --- a/go/vt/vtgate/planbuilder/operators/projection_pushing.go +++ b/go/vt/vtgate/planbuilder/operators/projection_pushing.go @@ -361,11 +361,10 @@ func splitUnexploredExpression( case col.IsPureRight(): rhs.add(pe, alias) col.RHSExpr = colName - case col.IsMixedLeftAndRight(): + default: for _, lhsExpr := range col.LHSExprs { ae := aeWrap(lhsExpr.Expr) columnName := ae.ColumnName() - ae.As = sqlparser.NewIdentifierCI(columnName) lhs.add(newProjExpr(ae), columnName) } innerPE := newProjExprWithInner(pe.Original, col.RHSExpr) diff --git a/go/vt/vtgate/planbuilder/testdata/from_cases.json b/go/vt/vtgate/planbuilder/testdata/from_cases.json index 138dc8b045e..2e0fe429c1f 100644 --- a/go/vt/vtgate/planbuilder/testdata/from_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/from_cases.json @@ -4802,8 +4802,8 @@ "Name": "user", "Sharded": true }, - "FieldQuery": "select dt.foo from (select u.foo as foo from `user` as u where 1 != 1) as dt where 1 != 1", - "Query": "select dt.foo from (select u.foo as foo from `user` as u) as dt", + "FieldQuery": "select dt.foo from (select u.foo from `user` as u where 1 != 1) as dt where 1 != 1", + "Query": "select dt.foo from (select u.foo from `user` as u) as dt", "Table": "`user`" }, { diff --git a/go/vt/vtgate/planbuilder/testdata/tpch_cases.json b/go/vt/vtgate/planbuilder/testdata/tpch_cases.json index 58ec909104a..6b3f84d01d6 100644 --- a/go/vt/vtgate/planbuilder/testdata/tpch_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/tpch_cases.json @@ -1190,8 +1190,8 @@ "Name": "main", "Sharded": true }, - "FieldQuery": "select profit.l_extendedprice, profit.l_discount, profit.l_quantity, profit.l_suppkey, profit.l_partkey, weight_string(profit.l_suppkey) from (select l_extendedprice as l_extendedprice, l_discount as l_discount, l_quantity as l_quantity, l_suppkey as l_suppkey, l_partkey as l_partkey from lineitem where 1 != 1) as profit where 1 != 1", - "Query": "select profit.l_extendedprice, profit.l_discount, profit.l_quantity, profit.l_suppkey, profit.l_partkey, weight_string(profit.l_suppkey) from (select l_extendedprice as l_extendedprice, l_discount as l_discount, l_quantity as l_quantity, l_suppkey as l_suppkey, l_partkey as l_partkey from lineitem where l_orderkey = :o_orderkey) as profit", + "FieldQuery": "select profit.l_extendedprice, profit.l_discount, profit.l_quantity, profit.l_suppkey, profit.l_partkey, weight_string(profit.l_suppkey) from (select l_extendedprice, l_discount, l_quantity, l_suppkey as l_suppkey, l_partkey as l_partkey from lineitem where 1 != 1) as profit where 1 != 1", + "Query": "select profit.l_extendedprice, profit.l_discount, profit.l_quantity, profit.l_suppkey, profit.l_partkey, weight_string(profit.l_suppkey) from (select l_extendedprice, l_discount, l_quantity, l_suppkey as l_suppkey, l_partkey as l_partkey from lineitem where l_orderkey = :o_orderkey) as profit", "Table": "lineitem" } ]