Skip to content

Fix: SHOW CREATE ROW POLICY returns restrictive/permissive in lowercase - #106865

Merged
alexey-milovidov merged 8 commits into
ClickHouse:masterfrom
valerypetrov:fix/row-policy-restrictive-permissive-uppercase
Jun 15, 2026
Merged

alexey-milovidov merged 8 commits into
ClickHouse:masterfrom
valerypetrov:fix/row-policy-restrictive-permissive-uppercase

Conversation

@valerypetrov

@valerypetrov valerypetrov commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes: #105352

SHOW CREATE ROW POLICY previously emitted the AS restrictive / AS permissive clause in lowercase, inconsistent with every other keyword in the same statement, which is uppercase. This makes the output uppercase (AS RESTRICTIVE / AS PERMISSIVE).

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

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

Fix SHOW CREATE ROW POLICY emitting restrictive/permissive in lowercase instead of uppercase, inconsistent with other keywords.

Version info

  • Merged into: 26.6.1.832

@nikitamikhaylov nikitamikhaylov added the can be tested Allows running workflows for external contributors label Jun 9, 2026
@nikitamikhaylov nikitamikhaylov self-assigned this Jun 9, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [37641bd]

Summary: ✅


AI Review

Summary

This PR changes CREATE ROW POLICY formatting so AS RESTRICTIVE and AS PERMISSIVE are emitted with uppercase keywords, updates the affected SHOW CREATE stateless reference, and adds a focused clickhouse-format regression test for both lowercase and uppercase input. I found no remaining correctness, compatibility, or test-coverage issues.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Jun 9, 2026
@nikitamikhaylov

Copy link
Copy Markdown
Member

@valerypetrov You need to run chmod +x for the .sh test.

@CLAassistant

CLAassistant commented Jun 9, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@valerypetrov

Copy link
Copy Markdown
Contributor Author

@nikitamikhaylov , it seems that some flaky tests are failing? Do you want me to retrigger CI?

@PedroTadim

Copy link
Copy Markdown
Member

@nikitamikhaylov , it seems that some flaky tests are failing? Do you want me to retrigger CI?

Do it one more time

@nikitamikhaylov

Copy link
Copy Markdown
Member

@groeneai investigate the test failures and produce the fix in a separate PR.

@groeneai

Copy link
Copy Markdown
Collaborator

@nikitamikhaylov I investigated PR #106865's CI failures. They are not caused by the change in this PR, and no separate fix is needed: the failing job just needs another retrigger.

Finding: The only red functional check is Stateless tests (arm_asan_ubsan, azure, parallel) (commit 8a8fbe8). All 109 of its failures are a host-wide out-of-memory event on the azure runner, not a test regression:

  • 69 failures are direct OOM: Code: 241. DB::Exception: (total) memory limit exceeded ... current RSS: 53.69 GiB, maximum: 53.69 GiB. OvercommitTracker decision: Query was selected to stop.
  • The other 40 are the downstream symptom: Code: 210. Connection reset by peer / Connection refused (queries dropped when the server was OOM-killed).
  • 0 of the 109 are row-policy tests. The failing set is unrelated workloads: 04033_tpc_ds_q*, 02364_multiSearch_function_family, 01276_random_string, 00917_multiple_joins_denny_crane, etc.

This was a runner-wide infra outage, not PR-specific. On 2026-06-09 the same arm_asan_ubsan, azure, parallel check failed across 50 distinct PRs and 735 distinct tests (873 fail rows total) with the identical OOM signature. A one-line formatter string change (restrictive/permissive -> RESTRICTIVE/PERMISSIVE) cannot cause OOM.

This PR's own tests pass. 01295_create_row_policy is OK in 166 runs (incl. arm_asan_ubsan, azure, sequential), and the new 04326_row_policy_restrictive_permissive_uppercase is OK in 300 runs across every sanitizer plus 200 flaky-check iterations. The sibling sequential azure job (same binary) succeeded. The earlier Fast test red was the missing chmod +x you flagged, already fixed by the head commit (Fast test green at 8a8fbe8).

Recommendation: just retrigger Stateless tests (arm_asan_ubsan, azure, parallel) (as Pedro suggested). It should pass now that the runner is no longer memory-starved. No code or test fix is warranted.

Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=106865&sha=8a8fbe87851886c76243b2d1075bac306d0c726e&name_0=PR&name_1=Stateless%20tests%20%28arm_asan_ubsan%2C%20azure%2C%20parallel%29

(cron:clickhouse-worker-slot-5:20260611-120300)

@clickhouse-gh

clickhouse-gh Bot commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

📊 Cloud Performance Report

✅ AI verdict: no_change — no significant changes across 38 queries analysed

This PR only changes how RESTRICTIVE/PERMISSIVE keywords are printed in CREATE ROW POLICY output (an AST formatter string change) plus a test; it does not touch any query-execution code. The flagged 13.5% improvement on Q4 and 10.7% improvement on Q15 cannot be caused by this change and are run-to-run variance, so both have been downgraded to not-sure. No real performance impact is expected from this PR.

clickbench

⚠️ 2 inconclusive

Flagged queries (2 of 43)
Query Verdict Baseline med (ms) PR med (ms) Change q-value Hint
⚠️ 4 not_sure 266 230 -13.5% <0.0001 PR only uppercases row-policy keywords in the AST formatter; cannot touch Q4's SELECT path — delta is variance
⚠️ 15 not_sure 243 217 -10.7% <0.0001 Same off-path change; row-policy formatting can't speed up Q15 execution — improvement is run-to-run noise

q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on.

tpch_adapted_1_official

🟢 No significant changes

Debug info
  • StressHouse run: b3862a63-94c1-4013-b975-85b27d115d80
  • MIRAI run: f60a062b-91b7-47cb-b675-a14f8a435848
  • PR check IDs:
    • clickbench_300924_1781215428
    • clickbench_300937_1781215428
    • clickbench_300943_1781215428
    • tpch_adapted_1_official_300949_1781215428
    • tpch_adapted_1_official_300956_1781215428
    • tpch_adapted_1_official_300967_1781215428

@clickhouse-gh

clickhouse-gh Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.60% 84.60% +0.00%
Functions 92.40% 92.40% +0.00%
Branches 77.30% 77.30% +0.00%

Changed lines: Changed C/C++ lines covered by tests: 1/1 (100.00%) | Lost baseline coverage: none · Uncovered code

Full report · Diff report

@alexey-milovidov
alexey-milovidov merged commit 37bd741 into ClickHouse:master Jun 15, 2026
165 of 166 checks passed
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-bugfix Pull request with bugfix, not backported by default 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.

SHOW CREATE ROW POLICY returns 'restrictive'/'permissive' in lowercase instead of uppercase

7 participants