Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions go/vt/sqlparser/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,7 @@ func (*UnaryExpr) iValExpr() {}
func (*IntervalExpr) iValExpr() {}
func (*FuncExpr) iValExpr() {}
func (*CaseExpr) iValExpr() {}
func (BoolVal) iValExpr() {}

// ValType specifies the type for SQLVal.
type ValType int
Expand Down
24 changes: 24 additions & 0 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,30 @@ func TestValid(t *testing.T) {
}, {
input: "explain foobar",
output: "other",
}, {
input: "select /* EQ true */ 1 from t where a = true",
}, {
input: "select /* EQ false */ 1 from t where a = false",
}, {
input: "select /* NE true */ 1 from t where a != true",
}, {
input: "select /* NE false */ 1 from t where a != false",
}, {
input: "select /* LT true */ 1 from t where a < true",
}, {
input: "select /* LT false */ 1 from t where a < false",
}, {
input: "select /* GT true */ 1 from t where a > true",
}, {
input: "select /* GT false */ 1 from t where a > false",
}, {
input: "select /* LE true */ 1 from t where a <= true",
}, {
input: "select /* LE false */ 1 from t where a <= false",
}, {
input: "select /* GE true */ 1 from t where a >= true",
}, {
input: "select /* GE false */ 1 from t where a >= false",
}}
for _, tcase := range validSQL {
if tcase.output == "" {
Expand Down
Loading