Skip to content

Commit 83b4900

Browse files
author
zstan
committed
fix after review
1 parent b133a33 commit 83b4900

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands/CreateSchemaCommand.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,14 @@ public class CreateSchemaCommand implements CatalogCommand {
4949
private CreateSchemaCommand(String schemaName, boolean ifNotExists, boolean systemSchemaCommand) {
5050
validateIdentifier(schemaName, "Name of the schema");
5151

52-
if (systemSchemaCommand && !CatalogUtils.isSystemSchema(schemaName)) {
53-
throw new CatalogValidationException(format("Not a system schema, schema: '{}'", schemaName));
52+
if (systemSchemaCommand) {
53+
if (!CatalogUtils.isSystemSchema(schemaName)) {
54+
throw new CatalogValidationException(format("Not a system schema, schema: '{}'", schemaName));
55+
}
56+
} else {
57+
if (CatalogUtils.isSystemSchema(schemaName)) {
58+
throw new CatalogValidationException("Reserved system schema with name '{}' can't be created.", schemaName);
59+
}
5460
}
5561

5662
this.schemaName = schemaName;

0 commit comments

Comments
 (0)