Skip to content

Commit

Permalink
renaming rules and adding documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
James Cor committed Sep 19, 2023
1 parent db7b4bd commit b93c7a6
Show file tree
Hide file tree
Showing 3 changed files with 11,608 additions and 11,652 deletions.
12 changes: 11 additions & 1 deletion go/vt/sqlparser/precedence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ func fmtSetOp(s SelectStatement) string {
return fmt.Sprintf("(%s %s %s)", fmtSetOp(s.Left), s.Type, fmtSetOp(s.Right))
case *Select:
return String(s)
case *ParenSelect:
return String(s)
}
return ""
}
Expand Down Expand Up @@ -177,9 +179,17 @@ func TestSetOperatorPrecedence(t *testing.T) {
output: "((select 1 except select 2) union (select 3 intersect select 4))",
},

{
input: "(table a) union (table b)",
output: "((select * from a) union (select * from b))",
},
{
input: "(table a) intersect (table b)",
output: "(select * from a intersect select * from b)",
output: "((select * from a) intersect (select * from b))",
},
{
input: "(table a) except (table b)",
output: "((select * from a) except (select * from b))",
},
{
input: "select 1 intersect (select 2 union select 3)",
Expand Down
Loading

0 comments on commit b93c7a6

Please sign in to comment.