File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/commands Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff 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 ;
@@ -65,10 +71,6 @@ public boolean ifNotExists() {
6571 /** {@inheritDoc} */
6672 @ Override
6773 public List <UpdateEntry > get (UpdateContext updateContext ) {
68- if (!systemSchemaCommand && CatalogUtils .isSystemSchema (schemaName )) {
69- throw new CatalogValidationException ("Reserved system schema with name '{}' can't be created." , schemaName );
70- }
71-
7274 Catalog catalog = updateContext .catalog ();
7375 int id = catalog .objectIdGenState ();
7476
You can’t perform that action at this time.
0 commit comments