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: pretty-printing of partition clauses is incorrect #95238

Closed
knz opened this issue Jan 13, 2023 · 0 comments · Fixed by #95272
Closed

sql: pretty-printing of partition clauses is incorrect #95238

knz opened this issue Jan 13, 2023 · 0 comments · Fixed by #95272
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. O-rsg Random Syntax Generator T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@knz
Copy link
Contributor

knz commented Jan 13, 2023

Epic: CRDB-17785
Found via #95239.

Describe the problem

When partition names or columns contain special characters, the output of SHOW CREATE is invalid SQL syntax.

For example:

[email protected]:26257/movr> create table foo("a b" name not null, index ("a b") partition by list ("a b") (partition foo values in ('ab')));
CREATE TABLE

Time: 6ms total (execution 6ms / network 0ms)

[email protected]:26257/movr> show create table foo;
  table_name |                       create_statement
-------------+----------------------------------------------------------------
  foo        | CREATE TABLE public.foo (
             |     "a b" NAME NOT NULL,
             |     rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(),
             |     CONSTRAINT foo_pkey PRIMARY KEY (rowid ASC),
             |     INDEX "foo_a b_idx" ("a b" ASC) PARTITION BY LIST (a b) (
             |         PARTITION foo VALUES IN (('ab'))
             |     )
             | )

The identifier inside PARTITION BY LIST is improperly quoted.

Jira issue: CRDB-23416

@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 O-rsg Random Syntax Generator labels Jan 13, 2023
@knz knz self-assigned this Jan 13, 2023
@blathers-crl blathers-crl bot added the T-sql-schema-deprecated Use T-sql-foundations instead label Jan 13, 2023
@craig craig bot closed this as completed in d20be50 Jan 16, 2023
@exalate-issue-sync exalate-issue-sync bot added T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) and removed T-sql-schema-deprecated Use T-sql-foundations instead labels May 10, 2023
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. O-rsg Random Syntax Generator T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant