You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MySQL 8.0.19+ ... AS alias ... ON DUPLICATE KEY syntax parsing problem #2789
The use of VALUES() to refer to the new row and columns is deprecated beginning with MySQL 8.0.20, and is subject to removal in a future version of MySQL. Instead, use row and column aliases, as described in the next few paragraphs of this section.
CREATETABLEdep_names (
mykey VARCHAR(255) NOT NULL,
a VARCHAR(255) NULL,
b VARCHAR(255) NULL,
c VARCHAR(255) NULL,
d VARCHAR(255) NULL,
e VARCHAR(255) NULL,
PRIMARY KEY (mykey)
);
SQL queries
-- name: TestInsert :execINSERT INTO dep_names
(mykey, a, b, c, d, e)
VALUES
(?, ?, ?, ?, ?, ?) as new
ON DUPLICATE KEY UPDATE
a =new.a,
b =new.b,
c =new.c,
d =new.d,
e =new.e;
Activity
orisano commentedon Sep 29, 2023
The mysql engine relies on the tidb parser.
Currently it does not work because tidb does not support that syntax.
pingcap/tidb#29259
Jille commentedon Feb 27, 2024
@SnoozeThis pingcap/tidb#29259
SnoozeThis commentedon Feb 27, 2024
(https://snoozeth.is/xBlBhXIndU8) I will wait until pingcap/tidb#29259 is closed and then add a comment.
SnoozeThis commentedon Mar 1, 2025
Resolved.
jessepeterson commentedon Aug 28, 2025
This was not "resolved" upstream, FYI. The TIDB issue above was merely closed as a duplicate of a newer issue.
paultyng commentedon May 12, 2026
I think I have a PR for this in marino here: sqlc-dev/marino#33
cc @kyleconroy
refactor(mysql): move upsert queries to sqlc (#145)
refactor(mysql): move storage SQL to sqlc, add transaction retry (#268)
refactor(mysql): move storage SQL to sqlc, add transaction retry (mic…