Skip to content

Commit

Permalink
test: remove outdated test
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <[email protected]>
  • Loading branch information
systay committed Sep 2, 2024
1 parent 837abf5 commit 573b3e7
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions go/vt/vtgate/semantics/early_rewriter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -905,53 +905,6 @@ func TestOrderByDerivedTable(t *testing.T) {
}
}

// TestConstantFolding tests that the rewriter is able to do various constant foldings properly.
func TestConstantFolding(t *testing.T) {
ks := &vindexes.Keyspace{
Name: "main",
Sharded: true,
}
schemaInfo := &FakeSI{
Tables: map[string]*vindexes.Table{
"t1": {
Keyspace: ks,
Name: sqlparser.NewIdentifierCS("t1"),
Columns: []vindexes.Column{{
Name: sqlparser.NewIdentifierCI("a"),
Type: sqltypes.VarChar,
}, {
Name: sqlparser.NewIdentifierCI("b"),
Type: sqltypes.VarChar,
}, {
Name: sqlparser.NewIdentifierCI("c"),
Type: sqltypes.VarChar,
}},
ColumnListAuthoritative: true,
},
},
}
cDB := "db"
tcases := []struct {
sql string
expSQL string
}{{
sql: "select 1 from t1 where (a, b) in ::fkc_vals and (2 is null or (1 is null or a in (1)))",
expSQL: "select 1 from t1 where (a, b) in ::fkc_vals and a in (1)",
}, {
sql: "select 1 from t1 where (false or (false or a in (1)))",
expSQL: "select 1 from t1 where a in (1)",
}}
for _, tcase := range tcases {
t.Run(tcase.sql, func(t *testing.T) {
ast, err := sqlparser.NewTestParser().Parse(tcase.sql)
require.NoError(t, err)
_, err = Analyze(ast, cDB, schemaInfo)
require.NoError(t, err)
require.Equal(t, tcase.expSQL, sqlparser.String(ast))
})
}
}

// TestCTEToDerivedTableRewrite checks that CTEs are correctly rewritten to derived tables
func TestCTEToDerivedTableRewrite(t *testing.T) {
cDB := "db"
Expand Down

0 comments on commit 573b3e7

Please sign in to comment.