Skip to content

Add test: ALTER TABLE <materialized view> MODIFY SQL SECURITY INVOKER runtime guard untested - #103892

Merged
nikitamikhaylov merged 1 commit into
ClickHouse:masterfrom
clickgapai:qa-bot/coverage-pr60439
May 7, 2026
Merged

nikitamikhaylov merged 1 commit into
ClickHouse:masterfrom
clickgapai:qa-bot/coverage-pr60439

Conversation

@clickgapai

@clickgapai clickgapai commented May 2, 2026 •

Copy link
Copy Markdown
Contributor

Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.

Retrospective finding from a historical scan of PR #60439 (merged 2024-02-28). Confirmed on current codebase — close with a note if already fixed.

This is a test-only PR — no source code changes. Please review: test quality, whether the claimed coverage gaps are real, and whether test output makes sense.

Adds test coverage for 1 untested code path(s), found during automated review of PR #60439.
That PR PR adds DEFINER and SQL SECURITY clauses to CREATE/ALTER VIEW. New code paths: (1) parser for [DEFINER = user|CURRENT_USER] [SQL SECURITY DEFINER|INVOKER|NONE] in CREATE VIEW / CREATE MATERIALIZED VIEW; (2) processSQLSecurityOption in InterpreterCreateQuery resolves defaults from `default_norm

1. ALTER TABLE <materialized view> MODIFY SQL SECURITY INVOKER runtime guard untested
src/Storages/StorageMaterializedView.cpp:745
Risk: Call chain: InterpreterAlterQuery::executeToTable → IStorage::checkAlterIsPossible (virtual) → StorageMaterializedView::checkAlterIsPossible at src/Storages/StorageMaterializedView.cpp:739, wh
What's unique vs PR tests: PR's own test 02884_create_view_with_sql_security_option.sh tests: (a) CREATE MATERIALIZED VIEW ... SQL SECURITY INVOKER throws at create-time (StorageMaterializedView.cpp:122-123 — different code pat
Try it on ClickHouse Fiddle

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Not applicable — test-only change.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.5.1.416

@clickgapai clickgapai mentioned this pull request May 2, 2026
1 task done
@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label May 2, 2026
@clickhouse-gh

clickhouse-gh Bot commented May 2, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [5e44ef9]

Summary: ❌

job_name test_name status info comment
Finish Workflow FAIL
python3 ./ci/jobs/scripts/workflow_hooks/check_report_messages.py FAIL IGNORED

AI Review

Summary

This PR adds a focused stateless test for ALTER TABLE <materialized view> MODIFY SQL SECURITY INVOKER, covering the runtime guard in StorageMaterializedView::checkAlterIsPossible that was previously untested. The test includes a failing INVOKER path, a sanity check that metadata is unchanged after the exception, and positive controls for NONE/DEFINER. I found no correctness, safety, or performance issues in the change.

ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ✅
Compilation time ✅
No large/binary files ✅
Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label May 2, 2026
@clickgapai

Copy link
Copy Markdown
Contributor Author

CI check Finish Workflow failed, but the failure does not reference this PR's test (04201_alter_materialized_view_modify_sql_security_invoker_error).

This PR is test-only; the bot will not retrigger CI or modify the test to chase a failure that appears unrelated. If you believe the failure is related to this test, please comment with details and the bot will re-evaluate.

@clickgapai

Copy link
Copy Markdown
Contributor Author

This PR has accumulated 5 CI failures that don't reference its test, so the bot has not attempted any fix. Closing — please re-run CI or comment if you'd like the bot to look again.

@nikitamikhaylov nikitamikhaylov self-assigned this May 7, 2026
@nikitamikhaylov
nikitamikhaylov added this pull request to the merge queue May 7, 2026
Merged via the queue into ClickHouse:master with commit bba5870 May 7, 2026
163 of 165 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 May 7, 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-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.

4 participants