Skip to content

fix: correct information schema views metadata - #27716

Open
iamlinjunhong wants to merge 6 commits into
matrixorigin:mainfrom
iamlinjunhong:m-27655
Open

fix: correct information schema views metadata#27716
iamlinjunhong wants to merge 6 commits into
matrixorigin:mainfrom
iamlinjunhong:m-27655

Conversation

@iamlinjunhong

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #27655

What this PR does / why we need it:

fix: correct information schema views metadata

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Aug 27, 2026

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes: one blocking correctness gap remains in the VIEW_DEFINITION extractor.

[P1] Handle every line-comment form accepted by the MatrixOne lexer when locating the structural AS.

The new separator patterns in pkg/util/sysview/predefined.go only recognize -- ..., but the MySQL scanner also accepts # ... and // ... as line comments (pkg/sql/parsers/dialect/mysql/scanner.go, scanCommentTypeLine). GetRootSql preserves these comments. For example, this is valid MatrixOne SQL:

create view hash_comment_v # migration comment
as select 1;

The persisted statement reaches the new regexp unchanged, the prefix regexp cannot cross # migration comment, informationSchemaViewDefinitionPrefixLengthSQL becomes 0, and information_schema.VIEWS.VIEW_DEFINITION still exposes the full CREATE VIEW ... text instead of select 1. That is the same failure class as the previously fixed -- case, so the linked issue is not closed for all valid parser inputs.

Please make extraction comment-aware for all lexer-supported line comments (or avoid raw-SQL regexp extraction), and add parser/BVT counterexamples for at least # and //. The existing -- fix and the IS_UPDATABLE correction otherwise look consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants