diff --git a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/context/segment/insert/keygen/engine/GeneratedKeyContextEngine.java b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/context/segment/insert/keygen/engine/GeneratedKeyContextEngine.java index 0e8563b39e628..4669b53c36f00 100644 --- a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/context/segment/insert/keygen/engine/GeneratedKeyContextEngine.java +++ b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/context/segment/insert/keygen/engine/GeneratedKeyContextEngine.java @@ -50,8 +50,8 @@ public final class GeneratedKeyContextEngine { * @param params SQL parameters * @return generate key context */ - public Optional createGenerateKeyContext(final Map insertColumnNamesAndIndexes, final List insertValueContexts, - final List params) { + public Optional createGenerateKeyContext(final Map insertColumnNamesAndIndexes, + final List insertValueContexts, final List params) { String tableName = insertStatement.getTable().map(optional -> optional.getTableName().getIdentifier().getValue()).orElse(""); return findGenerateKeyColumn(tableName).map(optional -> containsGenerateKey(insertColumnNamesAndIndexes, optional) ? findGeneratedKey(insertColumnNamesAndIndexes, insertValueContexts, params, optional) diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/manager/GenericSchemaManager.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/manager/GenericSchemaManager.java index f15e0e6e7b000..aea1204ff548c 100644 --- a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/manager/GenericSchemaManager.java +++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/manager/GenericSchemaManager.java @@ -62,7 +62,7 @@ private static ShardingSphereSchema getToBeAddedTablesBySchema(final ShardingSph * @return to be added tables */ public static Collection getToBeAddedTables(final ShardingSphereSchema reloadSchema, final ShardingSphereSchema currentSchema) { - return reloadSchema.getAllTables().stream().filter(each -> !each.equals(currentSchema.getTable(each.getName().toLowerCase()))).collect(Collectors.toList()); + return reloadSchema.getAllTables().stream().filter(each -> !each.equals(currentSchema.getTable(each.getName()))).collect(Collectors.toList()); } /** @@ -91,7 +91,7 @@ private static ShardingSphereSchema getToBeDroppedTablesBySchema(final ShardingS * @return to be dropped table */ public static Collection getToBeDroppedTables(final ShardingSphereSchema reloadSchema, final ShardingSphereSchema currentSchema) { - return currentSchema.getAllTables().stream().filter(each -> !reloadSchema.containsTable(each.getName().toLowerCase())).collect(Collectors.toList()); + return currentSchema.getAllTables().stream().filter(each -> !reloadSchema.containsTable(each.getName())).collect(Collectors.toList()); } /** diff --git a/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/view/federation/AlterViewFederationMetaDataRefresher.java b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/view/federation/AlterViewFederationMetaDataRefresher.java index e867403d14ce6..8fd97e5fe2014 100644 --- a/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/view/federation/AlterViewFederationMetaDataRefresher.java +++ b/mode/core/src/main/java/org/apache/shardingsphere/mode/metadata/refresher/type/view/federation/AlterViewFederationMetaDataRefresher.java @@ -46,10 +46,7 @@ public void refresh(final MetaDataManagerPersistService metaDataManagerPersistSe alterSchemaMetaDataPOJO.getAlteredViews().add(new ShardingSphereView(renameViewName, originalView)); alterSchemaMetaDataPOJO.getDroppedViews().add(viewName); } - Optional viewDefinition = sqlStatement.getViewDefinition(); - if (viewDefinition.isPresent()) { - alterSchemaMetaDataPOJO.getAlteredViews().add(new ShardingSphereView(viewName, viewDefinition.get())); - } + sqlStatement.getViewDefinition().ifPresent(optional -> alterSchemaMetaDataPOJO.getAlteredViews().add(new ShardingSphereView(viewName, optional))); metaDataManagerPersistService.alterSchemaMetaData(alterSchemaMetaDataPOJO); } diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowTableMetaDataExecutor.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowTableMetaDataExecutor.java index d727832d01fb0..f0cceedc09aab 100644 --- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowTableMetaDataExecutor.java +++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowTableMetaDataExecutor.java @@ -53,7 +53,7 @@ public Collection getRows(final ShowTableMetaDataStatem String defaultSchema = new DatabaseTypeRegistry(database.getProtocolType()).getDefaultSchemaName(database.getName()); ShardingSphereSchema schema = database.getSchema(defaultSchema); return sqlStatement.getTableNames().stream() - .filter(schema::containsTable).map(each -> buildTableRows(database.getName(), schema, each.toLowerCase())).flatMap(Collection::stream).collect(Collectors.toList()); + .filter(schema::containsTable).map(each -> buildTableRows(database.getName(), schema, each)).flatMap(Collection::stream).collect(Collectors.toList()); } private Collection buildTableRows(final String databaseName, final ShardingSphereSchema schema, final String tableName) {