Skip to content

Commit

Permalink
Fix for using unqouted reserved words ('count' specifically) in the V…
Browse files Browse the repository at this point in the history
…ALUES function
  • Loading branch information
fulghum committed Jul 10, 2023
1 parent 241b093 commit dc2f84e
Show file tree
Hide file tree
Showing 3 changed files with 7,665 additions and 7,548 deletions.
8 changes: 8 additions & 0 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ type parseTest struct {

var (
validSQL = []parseTest{
{
input: "INSERT INTO hourly_logins (applications_id, count, hour) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE count = count + VALUES(count)",
output: "insert into hourly_logins(applications_id, `count`, `hour`) values (:v1, :v2, :v3) on duplicate key update count = `count` + values(`count`)",
},
{
input: "INSERT INTO hourly_logins (applications_id, count, hour) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE account = account + VALUES(account)",
output: "insert into hourly_logins(applications_id, `count`, `hour`) values (:v1, :v2, :v3) on duplicate key update account = `account` + values(`account`)",
},
{
// INVISIBLE should parse, but be a no-op (for now)
input: "create table t (pk int primary key, c1 int INVISIBLE)",
Expand Down
Loading

0 comments on commit dc2f84e

Please sign in to comment.