Skip to content

Backport #97843 to 26.1: accept COMMENT before AS SELECT in view parser#99561

Merged
alexey-milovidov merged 2 commits into26.1from
backport/26.1/97843
Mar 18, 2026
Merged

Backport #97843 to 26.1: accept COMMENT before AS SELECT in view parser#99561
alexey-milovidov merged 2 commits into26.1from
backport/26.1/97843

Conversation

@alexey-milovidov
Copy link
Copy Markdown
Member

Summary

  • Accept COMMENT clause before AS SELECT in the view parser for forward compatibility
  • Newer ClickHouse versions (26.2+) may format views with COMMENT before AS SELECT
  • This parser-only change ensures views created on newer versions can be loaded by this release
  • No formatter changes — the formatter continues to output COMMENT after AS SELECT

Ref #97843

Changelog category (leave one):

  • CI Fix or improvement (not a bug fix)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Accept COMMENT before AS SELECT in view parser for forward compatibility with newer versions.

🤖 Generated with Claude Code

…ibility

Newer ClickHouse versions (26.2+) may format views as:
  CREATE VIEW ... COMMENT 'text' AS SELECT ...

This makes the parser accept `COMMENT` both before and after
`AS SELECT`, so views created on newer versions can be loaded
by this release.

Ref #97843

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh bot commented Mar 16, 2026

Workflow [BackportPR], commit [2e6f576]

Summary:

job_name test_name status info comment
Integration tests (amd_asan, db disk, old analyzer, 2/6) failure
test_replicated_database/test.py::test_alter_rename FAIL cidb
test_replicated_database/test.py::test_lag_after_recovery FAIL cidb
test_replicated_database/test.py::test_system_database_replicas_with_ro FAIL cidb
test_replicated_database/test.py::test_block_system_database_replicas FAIL cidb
test_replicated_database/test.py::test_timeseries FAIL cidb
test_replicated_database/test.py::test_mv_false_cyclic_dependency FAIL cidb
test_replicated_database/test.py::test_ignore_cluster_name_setting FAIL cidb
Integration tests (amd_asan, db disk, old analyzer, 4/6) failure
test_database_hms/test.py::test_hive_catalog_url_parsing FAIL cidb
Integration tests (amd_tsan, 5/6) failure
test_storage_iceberg_no_spark/test_writes_statistics_by_minmax_pruning.py::test_writes_statistics_by_minmax_pruning[s3-1] FAIL cidb
test_storage_iceberg_no_spark/test_writes_statistics_by_minmax_pruning.py::test_writes_statistics_by_minmax_pruning[s3-2] FAIL cidb
test_storage_iceberg_no_spark/test_writes_statistics_by_minmax_pruning.py::test_writes_statistics_by_minmax_pruning[azure-1] FAIL cidb
test_storage_iceberg_no_spark/test_writes_statistics_by_minmax_pruning.py::test_writes_statistics_by_minmax_pruning[azure-2] FAIL cidb
test_storage_iceberg_no_spark/test_writes_statistics_by_minmax_pruning.py::test_writes_statistics_by_minmax_pruning[local-1] FAIL cidb
test_storage_iceberg_no_spark/test_writes_statistics_by_minmax_pruning.py::test_writes_statistics_by_minmax_pruning[local-2] FAIL cidb
test_storage_iceberg_no_spark/test_writes_multiple_files.py::test_writes_multiple_files[local-1] FAIL cidb
test_storage_iceberg_no_spark/test_writes_multiple_files.py::test_writes_multiple_files[local-2] FAIL cidb
test_storage_iceberg_no_spark/test_writes_multiple_threads.py::test_writes_multiple_threads[s3-1] FAIL cidb
test_storage_iceberg_no_spark/test_writes_multiple_threads.py::test_writes_multiple_threads[s3-2] FAIL cidb
4 more test cases not shown
Integration tests (amd_tsan, 6/6) failure
test_database_hms/test.py::test_hive_catalog_url_parsing FAIL cidb

The `formatQuery` function on the 26.1 branch outputs escaped single
quotes (`\'test\'`) unlike master which outputs unescaped (`'test'`).
Update the reference file to match the actual output.

#99561

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexey-milovidov alexey-milovidov merged commit 83eb877 into 26.1 Mar 18, 2026
29 of 38 checks passed
@alexey-milovidov alexey-milovidov deleted the backport/26.1/97843 branch March 18, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant