This is an automated email from the ASF dual-hosted git repository.
duanzhengqiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 4cbade71f15 Fix no database selected exception in the query sql
(#32521)
4cbade71f15 is described below
commit 4cbade71f15196e5bf5c2784498c24dcffe37cd6
Author: ZhangCheng <[email protected]>
AuthorDate: Thu Aug 15 16:18:36 2024 +0800
Fix no database selected exception in the query sql (#32521)
---
.../infra/binder/context/statement/dml/SelectStatementContext.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/context/statement/dml/SelectStatementContext.java
b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/context/statement/dml/SelectStatementContext.java
index f4f42bda9cb..5a7588baca4 100644
---
a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/context/statement/dml/SelectStatementContext.java
+++
b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/context/statement/dml/SelectStatementContext.java
@@ -134,7 +134,7 @@ public final class SelectStatementContext extends
CommonSQLStatementContext impl
return true;
}
}
- return isContainsEnhancedTable(metaData, currentDatabaseName,
getTablesContext().getTableNames());
+ return null != currentDatabaseName &&
isContainsEnhancedTable(metaData, currentDatabaseName,
getTablesContext().getTableNames());
}
private boolean isContainsEnhancedTable(final ShardingSphereMetaData
metaData, final String databaseName, final Collection<String> tableNames) {