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

sql: IMPORT pretty-print error #28562

Closed
maddyblue opened this issue Aug 14, 2018 · 1 comment · Fixed by #28568
Closed

sql: IMPORT pretty-print error #28562

maddyblue opened this issue Aug 14, 2018 · 1 comment · Fixed by #28568
Assignees
Labels
A-sql-syntax Issues strictly related to the SQL grammar, with no semantic aspect C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Milestone

Comments

@maddyblue
Copy link
Contributor

maddyblue commented Aug 14, 2018

cannot parse output of Format: sql="

SELECT ISERROR ( EXISTS ( ( ( ( WITH BETWEEN AS ( CREATE ROLE error ) , BIT ( ident ) AS ( IMPORT TABLE OUT . SIMILAR FROM ident ( ident ) ) SELECT error ) ) ) ORDER BY INDEX POSITION . ident @ ident ASC OFFSET SERIAL4 'string' ROW ) )

", formattedSQL="

SELECT ISERROR(EXISTS ((((WITH "between" AS (CREATE ROLE 'error') , "bit" (ident) AS (IMPORT "out".similar FROM IDENT ('ident')) SELECT error))) ORDER BY INDEX "position".ident@ident ASC OFFSET SERIAL4 'string'))

": syntax error at or near "."

Above is the error message produced by RSG. This might be a problem with the formatting of ISERROR? sqlfmt doesn't handle that, so it could be the culprit?

@knz
Copy link
Contributor

knz commented Aug 14, 2018

No the problem here is the pretty-printing of IMPORT. It's not outputting the TABLE keyword, which is necessary in this case.

I can still have a look though.

@knz knz changed the title sql: format roundtrip with ISERROR? sql: IMPORT pretty-print error Aug 14, 2018
@knz knz added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-sql-syntax Issues strictly related to the SQL grammar, with no semantic aspect labels Aug 14, 2018
@knz knz modified the milestones: 2.2, 2.1 Aug 14, 2018
craig bot pushed a commit that referenced this issue Aug 14, 2018
28568: sql/sem/tree: fix the pretty-printing for IMPORT r=knz a=knz

Fixes #28562.

The IMPORT statement didn't roundtrip properly. This patch fixes it.

Also the contextual help is extended to include the new IMPORT syntax.

Release note: None

Co-authored-by: Raphael 'kena' Poss <[email protected]>
@craig craig bot closed this as completed in #28568 Aug 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-syntax Issues strictly related to the SQL grammar, with no semantic aspect C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants