Skip to content

Commit

Permalink
parse type aliases in cast (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
jycor authored May 15, 2024
1 parent 00461f6 commit 966f8cb
Show file tree
Hide file tree
Showing 3 changed files with 8,489 additions and 8,424 deletions.
16 changes: 16 additions & 0 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5970,10 +5970,26 @@ func TestFunctionCalls(t *testing.T) {
input: "SELECT CAST(foo AS DOUBLE)",
output: "select CAST(foo as DOUBLE)",
},
{
input: "SELECT CAST(foo AS DOUBLE PRECISION)",
output: "select CAST(foo as DOUBLE)",
},
{
input: "SELECT CAST(foo AS REAL)",
output: "select CAST(foo as REAL)",
},
{
input: "SELECT CAST(foo AS FLOAT)",
output: "select CAST(foo as FLOAT)",
},
{
input: "SELECT CAST(foo AS CHARACTER)",
output: "select CAST(foo as CHAR)",
},
{
input: "SELECT CAST(foo AS CHARACTER(100))",
output: "select CAST(foo as CHAR(100))",
},
{
input: "SELECT POSITION('abc' in 'xyz')",
output: "select LOCATE('abc', 'xyz')",
Expand Down
Loading

0 comments on commit 966f8cb

Please sign in to comment.