Closed CookiePieWw closed 2 days ago
The recent changes introduce checks to ensure that operations on read-only schemas and tables, specifically within the "information_schema," result in user-friendly error messages rather than internal errors. These checks have been added across several modules, enhancing user experience by preventing unwanted modifications and providing descriptive error messages.
File Path | Change Summary |
---|---|
src/common/catalog/src/consts.rs |
Added is_readonly_schema function to check if a schema is read-only. |
src/operator/src/req_convert/insert/stmt_to_region.rs |
Added a check to prevent operations on "information_schema" and include SchemaReadOnlySnafu error. |
src/operator/src/statement/ddl.rs |
Integrated checks to disallow operations on "information_schema" in multiple StatementExecutor functions, adding SchemaReadOnlySnafu errors. |
src/query/src/datafusion.rs |
Implemented checks for read-only tables in the DatafusionQueryEngine , introducing TableReadOnlySnafu errors. |
sequenceDiagram
participant User
participant Application
participant QueryEngine
participant Catalog
participant SchemaRegistry
User->>Application: Perform operation on information_schema
Application->>QueryEngine: Forward request
QueryEngine->>Catalog: Check if schema/table is read-only
Catalog-->>QueryEngine: Schema/table is read-only
QueryEngine-->>Application: Return SchemaReadOnlySnafu / TableReadOnlySnafu error
Application-->>User: Display user-friendly error message
Objective | Addressed | Explanation |
---|---|---|
Improve error message for read-only tables (3653) | ✅ |
In the code where data flows,
A rabbit hopped and gently shows,
Errors now more friendly made,
No more fears of updates staid.
Schema checks in place now be,
Just for you, from me, Code Bunny.🐰
[!TIP]
Early access features: enabled
We are currently testing the following features in early access: - **OpenAI `gpt-4o` model for code reviews and chat**: OpenAI claims that this model is better at understanding and generating code than the previous models. We seek your feedback over the next few weeks before making it generally available. Note: - You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file. - Please join our [Discord Community](https://discord.com/invite/GsXnASn26c) to provide feedback and report issues. - OSS projects are currently opted into early access features by default.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 83.33333%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 84.70%. Comparing base (
a7aa556
) to head (3f545b7
). Report is 19 commits behind head on main.
Updated with a read-only check function, error code and some sqlness tests. PTAL @killme2008
I forgot to sync the clock before commit, so it may be a little strange that f336170bcdada6c332fddd3be2108728a9d473a6 is ahead of the comments QaQ.
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
close #3653
What's changed and what's your intention?
As title. Following ops in
information_schema
are forbidden in this patch:Updated some sqlness tests for it.
Checklist
Summary by CodeRabbit
New Features
information_schema
.Bug Fixes
Refactor