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

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 04d12fb  [Bug] Optimize querying from PostgreSQL and MySQL 
compatibility (#5741)
04d12fb is described below

commit 04d12fbb003297424d3ad9ad98afdfdbb37fe18f
Author: HappenLee <[email protected]>
AuthorDate: Tue May 4 21:19:50 2021 -0500

    [Bug] Optimize querying from PostgreSQL and MySQL compatibility (#5741)
    
    1. Use the param `UseDeclareFetch` to fix the memory consumption of 
PostgreSQL Driver
    2. Fix the bug of mysql client 5.1 query failed Doris
---
 fe/fe-core/src/main/java/org/apache/doris/catalog/OdbcTable.java | 3 ++-
 fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlProto.java  | 5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/OdbcTable.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/OdbcTable.java
index d937008..835e3c1 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/OdbcTable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/OdbcTable.java
@@ -274,7 +274,7 @@ public class OdbcTable extends Table {
                         "utf8");
                 break;
             case POSTGRESQL:
-                connectString = 
String.format("Driver=%s;Server=%s;Port=%s;DataBase=%s;Uid=%s;Pwd=%s;charset=%s",
+                connectString = 
String.format("Driver=%s;Server=%s;Port=%s;DataBase=%s;Uid=%s;Pwd=%s;charset=%s;UseDeclareFetch=1;Fetch=4096",
                         getOdbcDriver(),
                         getHost(),
                         getPort(),
@@ -282,6 +282,7 @@ public class OdbcTable extends Table {
                         getUserName(),
                         getPasswd(),
                         "utf8");
+                break;
             case MYSQL:
                 connectString = 
String.format("Driver=%s;Server=%s;Port=%s;DataBase=%s;Uid=%s;Pwd=%s;charset=%s;forward_cursor=1;no_cache=1",
                         getOdbcDriver(),
diff --git a/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlProto.java 
b/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlProto.java
index 3120eab..5aa9eb2 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlProto.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/mysql/MysqlProto.java
@@ -172,7 +172,10 @@ public class MysqlProto {
         // with password.
         // So Doris support the Protocol::AuthSwitchRequest to tell client to 
keep the default password plugin
         // which Doris is using now.
-        if 
(!handshakePacket.checkAuthPluginSameAsDoris(authPacket.getPluginName())) {
+        // Note: Check the authPacket whether support plugin auth firstly, 
before we check AuthPlugin between doris and client
+        // to compatible with older version: like mysql 5.1
+        if (authPacket.getCapability().isPluginAuth() &&
+                
!handshakePacket.checkAuthPluginSameAsDoris(authPacket.getPluginName())) {
             // 1. clear the serializer
             serializer.reset();
             // 2. build the auth switch request and send to the client

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to