when query dual table and schema is null, NPE Exception

This commit is contained in:
wd2365151147
2020-11-18 13:15:43 +08:00
parent da00a68e2c
commit 42ceec946f

View File

@@ -186,10 +186,10 @@ public final class SchemaUtil {
private static boolean isNoSharding(ShardingService service, SQLExprTableSource table, SQLStatement stmt, SQLStatement childSelectStmt, String contextSchema, Set<String> schemas, StringPtr shardingNode)
throws SQLException {
SchemaInfo schemaInfo = SchemaUtil.getSchemaInfo(service.getUser(), contextSchema, table);
String currentSchema = schemaInfo.schema.toUpperCase();
if (schemaInfo.dual) {
return true;
}
String currentSchema = schemaInfo.schema.toUpperCase();
if (SchemaUtil.MYSQL_SYS_SCHEMA.contains(currentSchema)) {
schemas.add(currentSchema);
return false;