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
xiangjinwu
changed the title
failed to run INSERT INTO table_name (SELECT ...)
fix(sqlparser): properly handle ambiguity in INSERT INTO table_name (SELECT ...)Dec 20, 2024
xiangjinwu
changed the title
fix(sqlparser): properly handle ambiguity in INSERT INTO table_name (SELECT ...)
bug(sqlparser): properly handle ambiguity in INSERT INTO table_name (SELECT ...)Dec 20, 2024
Note that RisingWave already support it without parentheses:
INSERT INTO dst2 SELECT * FROM src2;
The problem of parentheses is the ambiguity between the follow two SQLs:
INSERT INTO dst2 (d) SELECT 1;
INSERT INTO dst2 (SELECT * FROM src2);
Right now it seems our sqlparser always tries to parse a column list inside parentheses and would report an error immediately without backtracking and trying the other possibility: parsing a parentheses Query.
Is avoiding the unnecessary parentheses an option in your use case? The sqlparser may (or may not, I have not checked this specific case) need a moderate refactor to support backtracking well.
Version:
Steps to reproduce:
Postgres supports this syntax. So RisingWave might also need to adapt it.
The text was updated successfully, but these errors were encountered: