-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGNITE-24022 Sql. Fix CreateSchemaCommand catalog command validation #5084
Conversation
@ParameterizedTest | ||
@MethodSource("reservedSchemaNames") | ||
public void testDropSystemSchemas(String schema) { | ||
if (!DEFAULT_SCHEMA_NAME.equals(schema)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think default schema name is PUBLIC and the PUBLIC schema is not on a list of reservedSchemaNames.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you right, fixed, thanks
@@ -348,6 +347,44 @@ public void testItIsNotPossibleToCreateTablesInSystemSchema(String schema) { | |||
() -> sql(format("CREATE TABLE {}.SYS_TABLE (NAME VARCHAR PRIMARY KEY, SIZE BIGINT)", schema.toLowerCase()))); | |||
} | |||
|
|||
@ParameterizedTest | |||
@MethodSource("reservedSchemaNames") | |||
public void testCreateSystemSchemas(String schema) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make these tests as SqlLogic tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But, as you correctly noted in such a case we will miss return code check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is so, but it doesn't look like a big problem. Otherwise, we can introduce check error codes in SqlLogic tests and move all such simple cases. Up to you
@AMashenkov reworked, ready for review |
if (!systemSchemaCommand && CatalogUtils.isSystemSchema(schemaName)) { | ||
throw new CatalogValidationException("Reserved system schema with name '{}' can't be created.", schemaName); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move to the constructor.
Thank you for submitting the pull request.
To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:
The Review Checklist
- There is a single JIRA ticket related to the pull request.
- The web-link to the pull request is attached to the JIRA ticket.
- The JIRA ticket has the Patch Available state.
- The description of the JIRA ticket explains WHAT was made, WHY and HOW.
- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
Notes