fix: classify metadata DDL schema effects - #2754
Merged
manticore-projects merged 1 commit intoOct 2, 2026
Merged
manticore-projects merged 1 commit into
manticore-projects merged 1 commit into
Conversation
Signed-off-by: 付典 <fudianchn@gmail.com>
fudianchn
marked this pull request as ready for review
October 2, 2026 11:34
Contributor
|
Thank you very much for improving this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI disclosure: this change was prepared with AI coding agents, reviewed and revised line by line by me.
What
Classify eight parsed metadata DDL types as
MODIFIES_SCHEMA: ALTER COLLATION, ALTER DATABASE, ALTER SCHEMA, ALTER STATISTICS, ALTER TABLE/INDEX ALL IN TABLESPACE, ALTER/CREATE TEXT SEARCH CONFIGURATION and CREATE USER.Why
These statements currently reach the unknown-statement fallback. Their feature analysis reports
OPAQUEwith all four possible data, schema and query effects, despite the visitor already using schema-only classification for other metadata definitions.How
Add eight visitor overrides that return the existing
schemaOnly()analysis. Add real SQL regression cases across direct, string, predicate-aware, script-union and per-statement analysis, with following executed SQL and conservative fallback controls.Root cause
The eight statement types inherit adapter behavior without a corresponding feature visitor classification. Analysis therefore receives no classification and conservatively applies the unknown-statement fallback.
Testing
6d1ec1df1596d154fff3911452cd6979d46b9751, the 36-case regression has 32 expected classification failures and four passing controls. All SQL samples parse; failures compareMODIFIES_SCHEMAagainstOPAQUE.SELECT f(id) FROM t, preserving its data reads, result rows and unresolved function reference.checkpasses: 9,518 cases, zero failures/errors and 25 skipped. Mavenclean verify spotless:checkpasses: 9,500 cases, zero failures/errors and 25 skipped. Gradle grammar, Checkstyle, PMD, SpotBugs main/JMH, coverage and Spotless tasks pass; SpotBugs test is skipped by the upstream configuration. The separate strict changed-file license check scans both changed Java files and passes. The full-tree Maven license step reports 33 header extraction warnings for unchanged resource files; these are outside this patch.Behavior notes
The parser, AST models and adapters are unchanged. Unknown statements and explicit unsupported syntax remain conservative. Stored definitions retain the visitor's existing classification; following executed SQL is still analyzed separately.
This change does not duplicate PR #2738's twelve other DDL classifications. CREATE/ALTER EVENT and NOTIFY remain outside this patch because their lifecycle or effect taxonomy needs a separate design decision. Generic fallback diagnostic markers are also outside this patch.
Verification of the original issue
No existing issue is linked. The independent failures were reproduced on upstream master
6d1ec1df1596d154fff3911452cd6979d46b9751and checked against PR #2738 head7f8bb7fb24401a4940ff89d36aefa8e224603c08. All eight types still use the conservative fallback on both versions. The local fix now reports only the certain schema effect for SQL such as:Locally verified fixed commit:
335cbcd727eaaf683f759f5a3a976b7e1f07e879onfix/classify-metadata-ddl-features. Independent owner review and the combined validation with PR #2738 and the separate fallback fix pass.