Skip to content

Revert "Revert "Remove unnecessary parentheses in CREATE TABLE ... AS SELECT ... COMMENT""#96598

Merged
alexey-milovidov merged 1 commit intomasterfrom
revert-96595-revert-96293-remove-unnecessary-parentheses-create-as-select-comment
Feb 12, 2026
Merged

Revert "Revert "Remove unnecessary parentheses in CREATE TABLE ... AS SELECT ... COMMENT""#96598
alexey-milovidov merged 1 commit intomasterfrom
revert-96595-revert-96293-remove-unnecessary-parentheses-create-as-select-comment

Conversation

@alexey-milovidov
Copy link
Copy Markdown
Member

Reverts #96595

@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh Bot commented Feb 10, 2026

Workflow [PR], commit [720e215]

Summary:

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Feb 10, 2026
@evillique evillique self-assigned this Feb 12, 2026
@alexey-milovidov alexey-milovidov merged commit ac9b273 into master Feb 12, 2026
133 of 134 checks passed
@alexey-milovidov alexey-milovidov deleted the revert-96595-revert-96293-remove-unnecessary-parentheses-create-as-select-comment branch February 12, 2026 16:53
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 12, 2026
alexey-milovidov added a commit that referenced this pull request Mar 16, 2026
Move `COMMENT` clause back after `AS SELECT` in the formatter output
to restore backward compatibility with older ClickHouse versions.
The parser still accepts `COMMENT` both before and after `AS SELECT`,
so queries created by newer versions (26.2) with the new syntax will
parse correctly.

The formatter now outputs:
  `CREATE VIEW ... AS (SELECT ...) COMMENT 'text'`
instead of:
  `CREATE VIEW ... COMMENT 'text' AS SELECT ...`

This ensures views created or updated on the current version can be
loaded by older releases (25.12 and earlier), fixing the forward
incompatibility introduced by #96598.

Closes #97843

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants