Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: row_alias (and column aliases) not supported for INSERT INTO ... #15509

Open
arthurschreiber opened this issue Mar 18, 2024 · 0 comments

Comments

@arthurschreiber
Copy link
Contributor

arthurschreiber commented Mar 18, 2024

Overview of the Issue

MySQL 8.0.20 deprecated the use of VALUES(col_name) in the ON DUPLICATE KEY UPDATE portion of INSERT INTO statements, and recommends the use of row (and column) alias syntax that was added in MySQL 8.0.19 instead.

See https://dev.mysql.com/doc/refman/8.0/en/insert.html and https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html

Unfortunately, Vitess does not support this syntax yet. This is awkward, because tools like the Rails framework switched to using the row alias syntax to avoid the deprecation warning from MySQL, but this breaks on Vitess (see rails/rails#51274).

Reproduction Steps

INSERT INTO `table_name` (`a`, `b`, `c`) VALUES (1, 2, 3) AS `table_name_values`

returns

syntax error at position 59 near 'AS'

Binary Version

N/A

Operating System and Environment details

N/A

Log Fragments

N/A

@arthurschreiber arthurschreiber added Needs Triage This issue needs to be correctly labelled and triaged Type: Bug labels Mar 18, 2024
@GuptaManan100 GuptaManan100 added Component: Query Serving and removed Needs Triage This issue needs to be correctly labelled and triaged labels Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants