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
INSERT INTO t1 SET a=1,b=2,c=3AS new(m,n,p)
ON DUPLICATE KEY UPDATE c = m+n;
Row-alias support was added in #2383. The resulting Insert has three SET assignments, getRowAlias().getName() == "new", alias columns m, n, p, and one duplicate-key update assignment. Both toString() and StatementDeParser preserve the alias and update expression, and their output reparses with the same fields.
Activity
manticore-projects commentedon Aug 26, 2021
Greetings.
the
as new(m, n, p,)is MySQL specific and not supported.Please see the allowed/understood syntax here: http://217.160.215.75:8080/jsqlformatter/_static/railroad_diagram.xhtml#Update
minleejae commentedon Sep 7, 2026
@manticore-projects I retested the exact statement from this issue on master
6c726d88, and it now parses and round-trips successfully:Row-alias support was added in #2383. The resulting
Inserthas three SET assignments,getRowAlias().getName() == "new", alias columnsm, n, p, and one duplicate-key update assignment. BothtoString()andStatementDeParserpreserve the alias and update expression, and their output reparses with the same fields.I checked default parsing and
withUnsupportedStatements(false). Related regression coverage is in InsertTest's row-alias and SET/deparser tests, and the full Gradlecheckpassed.This appears resolved for the reported syntax. Could you consider closing it if there are no remaining failing examples on master?