Skip to content

Commit

Permalink
Merge pull request #4867 from kuba--/nested-substring
Browse files Browse the repository at this point in the history
Support nested substring calls
  • Loading branch information
sougou authored May 23, 2019
2 parents b23af2e + eff5f47 commit eb2d057
Show file tree
Hide file tree
Showing 3 changed files with 1,362 additions and 1,430 deletions.
9 changes: 9 additions & 0 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1844,6 +1844,15 @@ func TestSubStr(t *testing.T) {
}, {
input: `select substring("foo", 1, 2) from t`,
output: `select substr('foo', 1, 2) from t`,
}, {
input: `select substr(substr("foo" from 1 for 2), 1, 2) from t`,
output: `select substr(substr('foo', 1, 2), 1, 2) from t`,
}, {
input: `select substr(substring("foo", 1, 2), 3, 4) from t`,
output: `select substr(substr('foo', 1, 2), 3, 4) from t`,
}, {
input: `select substring(substr("foo", 1), 2) from t`,
output: `select substr(substr('foo', 1), 2) from t`,
}}

for _, tcase := range validSQL {
Expand Down
Loading

0 comments on commit eb2d057

Please sign in to comment.