You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by tu...@apache.org on 2022/06/07 09:58:47 UTC

[shardingsphere] branch master updated: Support cursor statement when call proxy through raw jdbc (#18220)

This is an automated email from the ASF dual-hosted git repository.

tuichenchuxin 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 0781787897e Support cursor statement when call proxy through raw jdbc (#18220)
0781787897e is described below

commit 0781787897efc38a63fef212166b9b8cbe13fc21
Author: Zhengqiang Duan <du...@apache.org>
AuthorDate: Tue Jun 7 17:58:39 2022 +0800

    Support cursor statement when call proxy through raw jdbc (#18220)
---
 .../proxy/frontend/postgresql/command/query/extended/JDBCPortal.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/JDBCPortal.java b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/JDBCPortal.java
index db6d6faed89..0c7c4cb8dc8 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/JDBCPortal.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-frontend/shardingsphere-proxy-frontend-postgresql/src/main/java/org/apache/shardingsphere/proxy/frontend/postgresql/command/query/extended/JDBCPortal.java
@@ -39,6 +39,7 @@ import org.apache.shardingsphere.db.protocol.postgresql.packet.identifier.Postgr
 import org.apache.shardingsphere.distsql.parser.statement.DistSQLStatement;
 import org.apache.shardingsphere.infra.binder.SQLStatementContextFactory;
 import org.apache.shardingsphere.infra.binder.statement.SQLStatementContext;
+import org.apache.shardingsphere.infra.binder.type.CursorAvailable;
 import org.apache.shardingsphere.infra.database.type.DatabaseType;
 import org.apache.shardingsphere.infra.database.type.DatabaseTypeFactory;
 import org.apache.shardingsphere.infra.metadata.database.schema.builder.SystemSchemaBuilderRule;
@@ -105,7 +106,7 @@ public final class JDBCPortal implements Portal<Void> {
         String databaseName = backendConnection.getConnectionSession().getDefaultDatabaseName();
         SQLStatementContext<?> sqlStatementContext = SQLStatementContextFactory.newInstance(
                 ProxyContext.getInstance().getContextManager().getMetaDataContexts().getMetaData().getDatabases(), parameters, sqlStatement, databaseName);
-        if (containsSystemTable(sqlStatementContext.getTablesContext().getTableNames())) {
+        if (containsSystemTable(sqlStatementContext.getTablesContext().getTableNames()) || sqlStatementContext instanceof CursorAvailable) {
             databaseCommunicationEngine = null;
             DatabaseType databaseType = ProxyContext.getInstance().getDatabase(databaseName).getResource().getDatabaseType();
             textProtocolBackendHandler = TextProtocolBackendHandlerFactory.newInstance(databaseType,