Skip to content

Support row alias on INSERT ... VALUES/SET (#22)#34

Merged
kyleconroy merged 2 commits into
mainfrom
claude/implement-marino-issue-22-90cnn
May 16, 2026
Merged

Support row alias on INSERT ... VALUES/SET (#22)#34
kyleconroy merged 2 commits into
mainfrom
claude/implement-marino-issue-22-90cnn

Conversation

@kyleconroy
Copy link
Copy Markdown
Contributor

MySQL 8.0.19 added a row alias on the inserted row
(INSERT ... VALUES (...) AS new ON DUPLICATE KEY UPDATE col = new.col)
to replace the deprecated VALUES(col) function inside the update list.

Extend InsertStmt with RowAlias and ColumnAliases, and add the
optional AS row_alias [(col_alias_list)] slot to the VALUES and SET
forms of InsertValues. The SELECT form is intentionally left out:
attaching the alias there propagates AS into the column-alias FOLLOW
set inside SELECT and yields a shift/reduce conflict that goyacc
rejects.

REPLACE is left unchanged; it has no ON DUPLICATE KEY UPDATE, so a row
alias is meaningless there.

claude added 2 commits May 13, 2026 16:17
MySQL 8.0.19 added a row alias on the inserted row
(`INSERT ... VALUES (...) AS new ON DUPLICATE KEY UPDATE col = new.col`)
to replace the deprecated `VALUES(col)` function inside the update list.

Extend `InsertStmt` with `RowAlias` and `ColumnAliases`, and add the
optional `AS row_alias [(col_alias_list)]` slot to the `VALUES` and `SET`
forms of `InsertValues`. The `SELECT` form is intentionally left out:
attaching the alias there propagates `AS` into the column-alias FOLLOW
set inside `SELECT` and yields a shift/reduce conflict that goyacc
rejects.

REPLACE is left unchanged; it has no ON DUPLICATE KEY UPDATE, so a row
alias is meaningless there.
The Makefile's genkeyword target produces a Go binary at parser/genkeyword
that's used by `go generate`. It's a build output, not source.
@kyleconroy kyleconroy merged commit 902823e into main May 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants