You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2022/12/19 08:05:13 UTC

[doris] branch branch-1.2-lts updated (6ea7b2ecfd -> 708492d74e)

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

morningman pushed a change to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git


    from 6ea7b2ecfd [thirdparty](libgsasl) set include dir to enable to find gssapi.h (#15037)
     new 980eca18fe [fix](broker-load) fix broker load with hdfs failed to get right file type (#15138)
     new 708492d74e [fix](auth) fix bug that user info may lost when upgrading to 1.2.0 (#15144)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/doris/mysql/privilege/PrivBitSet.java   |  5 +++++
 .../doris/mysql/privilege/UserPrivTable.java       | 10 +++------
 .../doris/planner/external/FileGroupInfo.java      |  1 +
 .../suites/jdbc_p0/test_jdbc_query_mysql.groovy    | 26 +++++++++++++++++++---
 4 files changed, 32 insertions(+), 10 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 02/02: [fix](auth) fix bug that user info may lost when upgrading to 1.2.0 (#15144)

Posted by mo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 708492d74e63e57f8c29c05ffc1f1b069e750366
Author: Mingyu Chen <mo...@163.com>
AuthorDate: Mon Dec 19 16:01:18 2022 +0800

    [fix](auth) fix bug that user info may lost when upgrading to 1.2.0 (#15144)
    
    * [fix](auth) fix bug that user info may lost when upgrading to 1.2.0
    
    * fix
---
 .../main/java/org/apache/doris/mysql/privilege/PrivBitSet.java |  5 +++++
 .../java/org/apache/doris/mysql/privilege/UserPrivTable.java   | 10 +++-------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/PrivBitSet.java b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/PrivBitSet.java
index a5a46cb294..f6e31e217f 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/PrivBitSet.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/PrivBitSet.java
@@ -73,6 +73,10 @@ public class PrivBitSet implements Writable {
         set ^= other.set;
     }
 
+    public void clean() {
+        this.set = 0;
+    }
+
     public void remove(PrivBitSet privs) {
         PrivBitSet tmp = copy();
         tmp.xor(privs);
@@ -171,3 +175,4 @@ public class PrivBitSet implements Writable {
         Text.writeString(out, GsonUtils.GSON.toJson(this));
     }
 }
+
diff --git a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserPrivTable.java b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserPrivTable.java
index b69b1157d5..354da66904 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserPrivTable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/UserPrivTable.java
@@ -31,7 +31,6 @@ import org.apache.logging.log4j.Logger;
 
 import java.io.DataOutput;
 import java.io.IOException;
-import java.util.LinkedList;
 import java.util.List;
 
 /*
@@ -200,7 +199,6 @@ public class UserPrivTable extends PrivTable {
      */
     public CatalogPrivTable degradeToInternalCatalogPriv() throws IOException {
         CatalogPrivTable catalogPrivTable = new CatalogPrivTable();
-        List<PrivEntry> degradedEntries = new LinkedList<>();
         for (PrivEntry privEntry : entries) {
             GlobalPrivEntry globalPrivEntry = (GlobalPrivEntry) privEntry;
             if (!globalPrivEntry.match(UserIdentity.ROOT, true)
@@ -215,19 +213,17 @@ public class UserPrivTable extends PrivTable {
                     entry.setSetByDomainResolver(false);
                     catalogPrivTable.addEntry(entry, false, false);
                     if (globalPrivEntry.privSet.containsResourcePriv()) {
-                        // Should keep the USAGE_PRIV in userPrivTable, and remove other privs and entries.
+                        // Should only keep the USAGE_PRIV in userPrivTable, and remove other privs and entries.
                         globalPrivEntry.privSet.and(PrivBitSet.of(PaloPrivilege.USAGE_PRIV));
                     } else {
-                        degradedEntries.add(globalPrivEntry);
+                        // Remove all other privs
+                        globalPrivEntry.privSet.clean();
                     }
                 } catch (Exception e) {
                     throw new IOException(e.getMessage());
                 }
             }
         }
-        for (PrivEntry degraded : degradedEntries) {
-            dropEntry(degraded);
-        }
         return catalogPrivTable;
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[doris] 01/02: [fix](broker-load) fix broker load with hdfs failed to get right file type (#15138)

Posted by mo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 980eca18fe5a8032084226d6b882d973b8042049
Author: Mingyu Chen <mo...@163.com>
AuthorDate: Mon Dec 19 16:00:58 2022 +0800

    [fix](broker-load) fix broker load with hdfs failed to get right file type (#15138)
---
 .../doris/planner/external/FileGroupInfo.java      |  1 +
 .../suites/jdbc_p0/test_jdbc_query_mysql.groovy    | 26 +++++++++++++++++++---
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileGroupInfo.java b/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileGroupInfo.java
index f3cb9a19f9..0a2f3edb8e 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileGroupInfo.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileGroupInfo.java
@@ -99,6 +99,7 @@ public class FileGroupInfo {
         this.filesAdded = filesAdded;
         this.strictMode = strictMode;
         this.loadParallelism = loadParallelism;
+        this.fileType = brokerDesc.getFileType();
     }
 
     // for stream load
diff --git a/regression-test/suites/jdbc_p0/test_jdbc_query_mysql.groovy b/regression-test/suites/jdbc_p0/test_jdbc_query_mysql.groovy
index d704e30b73..a1d0b0e41e 100644
--- a/regression-test/suites/jdbc_p0/test_jdbc_query_mysql.groovy
+++ b/regression-test/suites/jdbc_p0/test_jdbc_query_mysql.groovy
@@ -266,14 +266,14 @@ suite("test_jdbc_query_mysql", "p0") {
         sql  """ drop table if exists ${exMysqlTable} """
         sql  """ drop table if exists ${inDorisTable} """
         sql  """ CREATE EXTERNAL TABLE `${exMysqlTable}` (
-                  `id` int(11) not NULL,
+                  `id` bigint not NULL,
                   `apply_id` varchar(32) NULL,
                   `begin_value` string NULL,
                   `operator` varchar(32) NULL,
                   `operator_name` varchar(32) NULL,
                   `state` varchar(8) NULL,
                   `sub_state` varchar(8) NULL,
-                  `state_count` smallint(5) NULL,
+                  `state_count` int NULL,
                   `create_time` datetime NULL
                 ) ENGINE=JDBC
                 COMMENT "JDBC Mysql 外部表"
@@ -894,7 +894,7 @@ suite("test_jdbc_query_mysql", "p0") {
         sql  """ drop table if exists ${exMysqlTypeTable} """
         sql  """
                CREATE EXTERNAL TABLE ${exMysqlTypeTable} (
-               `id` bigint NOT NULL,
+               `id` int NOT NULL,
                `count_value` varchar(100) NULL
                ) ENGINE=JDBC
                COMMENT "JDBC Mysql 外部表"
@@ -934,6 +934,26 @@ suite("test_jdbc_query_mysql", "p0") {
         order_qt_sql111 """ SELECT rank() OVER () FROM (SELECT k8 FROM $jdbcMysql57Table1 LIMIT 10) as t LIMIT 3 """
         order_qt_sql112 """ SELECT k7, count(DISTINCT k8) FROM $jdbcMysql57Table1 WHERE k8 > 110 GROUP BY GROUPING SETS ((), (k7)) """
 
+        // test for type check
+        sql  """ drop table if exists ${exMysqlTypeTable} """
+        sql  """
+               CREATE EXTERNAL TABLE ${exMysqlTypeTable} (
+               `id` bigint NOT NULL,
+               `count_value` varchar(100) NULL
+               ) ENGINE=JDBC
+               COMMENT "JDBC Mysql 外部表"
+               PROPERTIES (
+                "resource" = "$jdbcResourceMysql57",
+                "table" = "ex_tb2",
+                "table_type"="mysql"
+               ); 
+        """
+
+        test {
+            sql """select * from ${exMysqlTypeTable} order by id"""
+            exception "Fail to convert jdbc type of java.lang.Integer to doris type BIGINT on column: id"
+        }
+
     }
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org