diff --git a/go/vt/sqlparser/parse_test.go b/go/vt/sqlparser/parse_test.go index 6051470720a..48aa8169b42 100644 --- a/go/vt/sqlparser/parse_test.go +++ b/go/vt/sqlparser/parse_test.go @@ -57,6 +57,10 @@ var ( }, { input: "select - -1 from t", output: "select 1 from t", + }, { + input: "select a from t", + }, { + input: "select $ from t", }, { input: "select 1 from t // aa\n", output: "select 1 from t", @@ -2585,9 +2589,6 @@ var ( output string excludeMulti bool // Don't use in the ParseNext multi-statement parsing tests. }{{ - input: "select $ from t", - output: "syntax error at position 9 near '$'", - }, { input: "select : from t", output: "syntax error at position 9 near ':'", }, { diff --git a/go/vt/sqlparser/token.go b/go/vt/sqlparser/token.go index 5636a11efd5..760935acd83 100644 --- a/go/vt/sqlparser/token.go +++ b/go/vt/sqlparser/token.go @@ -980,7 +980,7 @@ func (tkn *Tokenizer) reset() { } func isLetter(ch uint16) bool { - return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' + return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '_' || ch == '$' } func isCarat(ch uint16) bool {