From 54341eb7bb730def5341b4524a09f2fa2b49c0dc Mon Sep 17 00:00:00 2001 From: morningman Date: Sun, 12 Jan 2025 10:40:59 +0800 Subject: [PATCH 1/3] [fix](test) fix unstable test after some test migration --- .../jdbc/test_jdbc_query_tvf.out | 72 +++++++++---------- ...est_switch_catalog_and_delete_internal.out | 5 ++ .../suites/auth_p0/test_query_tvf_auth.groovy | 6 +- ..._switch_catalog_and_delete_internal.groovy | 8 +-- 4 files changed, 48 insertions(+), 43 deletions(-) diff --git a/regression-test/data/external_table_p0/jdbc/test_jdbc_query_tvf.out b/regression-test/data/external_table_p0/jdbc/test_jdbc_query_tvf.out index 3d71bfb26415ff..b96eed60fe0d90 100644 --- a/regression-test/data/external_table_p0/jdbc/test_jdbc_query_tvf.out +++ b/regression-test/data/external_table_p0/jdbc/test_jdbc_query_tvf.out @@ -1,43 +1,43 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !sql -- -bigint BIGINT Yes true \N NONE -bigint_u LARGEINT Yes true \N NONE -binary TEXT Yes true \N NONE -bit TEXT Yes true \N NONE -blob TEXT Yes true \N NONE -boolean TINYINT Yes true \N NONE -char CHAR(6) Yes true \N NONE -date DATE Yes true \N NONE -datetime DATETIME Yes true \N NONE -decimal DECIMAL(12, 4) Yes true \N NONE -decimal_u DECIMAL(19, 5) Yes true \N NONE -double DOUBLE Yes true \N NONE -double_u DOUBLE Yes true \N NONE -enum CHAR(6) Yes true \N NONE -float FLOAT Yes true \N NONE -float_u FLOAT Yes true \N NONE -int INT Yes true \N NONE -int_u BIGINT Yes true \N NONE -json TEXT Yes true \N NONE -mediumint INT Yes true \N NONE -mediumint_u INT Yes true \N NONE -set CHAR(6) Yes true \N NONE -smallint SMALLINT Yes true \N NONE -smallint_u INT Yes true \N NONE -text TEXT Yes true \N NONE -time TEXT Yes true \N NONE -timestamp DATETIME(4) Yes true \N NONE -tinyint TINYINT Yes true \N NONE -tinyint_u SMALLINT Yes true \N NONE -varbinary TEXT Yes true \N NONE -varchar VARCHAR(10) Yes true \N NONE -year SMALLINT Yes true \N NONE +bigint bigint Yes true \N NONE +bigint_u largeint Yes true \N NONE +binary text Yes true \N NONE +bit text Yes true \N NONE +blob text Yes true \N NONE +boolean tinyint Yes true \N NONE +char char(5) Yes true \N NONE +date date Yes true \N NONE +datetime datetime Yes true \N NONE +decimal decimal(12,4) Yes true \N NONE +decimal_u decimal(19,5) Yes true \N NONE +double double Yes true \N NONE +double_u double Yes true \N NONE +enum char(6) Yes true \N NONE +float float Yes true \N NONE +float_u float Yes true \N NONE +int int Yes true \N NONE +int_u bigint Yes true \N NONE +json text Yes true \N NONE +mediumint int Yes true \N NONE +mediumint_u int Yes true \N NONE +set char(23) Yes true \N NONE +smallint smallint Yes true \N NONE +smallint_u int Yes true \N NONE +text text Yes true \N NONE +time text Yes true \N NONE +timestamp datetime(4) Yes true \N NONE +tinyint tinyint Yes true \N NONE +tinyint_u smallint Yes true \N NONE +varbinary text Yes true \N NONE +varchar varchar(10) Yes true \N NONE +year smallint Yes true \N NONE -- !sql -- -\N 302 \N 502 602 4.14159 \N 6.14159 \N -124 -302 2013 -402 -502 -602 \N 2012-10-26T02:08:39.345700 2013-10-26T08:09:18 -5.14145 \N -7.1400 row2 \N 09:11:09.567 text2 0xE86F6C6C6F20576F726C67 \N \N 0x2F \N 0x88656C6C9F Value3 -201 301 401 501 601 3.14159 4.1415926 5.14159 1 -123 -301 2012 -401 -501 -601 2012-10-30 2012-10-25T12:05:36.345700 2012-10-25T08:08:08 -4.14145 -5.1400000001 -6.1400 row1 line1 09:09:09.567 text1 0x48656C6C6F20576F726C64 {"age":30, "city":"London", "name":"Alice"} Option1,Option3 0x2A 0x48656C6C6F00000000000000 0x48656C6C6F Value2 -202 302 402 502 602 4.14159 5.1415926 6.14159 0 -124 -302 2013 -402 -502 -602 2012-11-01 2012-10-26T02:08:39.345700 2013-10-26T08:09:18 -5.14145 -6.1400000001 -7.1400 row2 line2 09:11:09.567 text2 0xE86F6C6C6F20576F726C67 {"age":18, "city":"ChongQing", "name":"Gaoxin"} Option1,Option2 0x2F 0x58676C6C6F00000000000000 0x88656C6C9F Value3 -203 303 403 503 603 7.14159 8.1415926 9.14159 0 \N -402 2017 -602 -902 -1102 2012-11-02 \N 2013-10-27T08:11:18 -5.14145 -6.1400000000001 -7.1400 row3 line3 09:11:09.567 text3 0xE86F6C6C6F20576F726C67 {"age":24, "city":"ChongQing", "name":"ChenQi"} Option2 0x2F 0x58676C6C6F00000000000000 \N Value1 +\N 302 \N 502 602 4.14159 \N 6.14159 \N -124 -302 2013 -402 -502 -602 \N 2012-10-26T02:08:39.345700 2013-10-26T08:09:18 -5.14145 \N -7.1400 row2 \N 09:11:09.5678 text2 0xE86F6C6C6F20576F726C67 \N \N 0x2F \N 0x88656C6C9F Value3 +201 301 401 501 601 3.14159 4.1415926 5.14159 1 -123 -301 2012 -401 -501 -601 2012-10-30 2012-10-25T12:05:36.345700 2012-10-25T08:08:08 -4.14145 -5.1400000001 -6.1400 row1 line1 09:09:09.5678 text1 0x48656C6C6F20576F726C64 {"age": 30, "city": "London", "name": "Alice"} Option1,Option3 0x2A 0x48656C6C6F00000000000000 0x48656C6C6F Value2 +202 302 402 502 602 4.14159 5.1415926 6.14159 0 -124 -302 2013 -402 -502 -602 2012-11-01 2012-10-26T02:08:39.345700 2013-10-26T08:09:18 -5.14145 -6.1400000001 -7.1400 row2 line2 09:11:09.5678 text2 0xE86F6C6C6F20576F726C67 {"age": 18, "city": "ChongQing", "name": "Gaoxin"} Option1,Option2 0x2F 0x58676C6C6F00000000000000 0x88656C6C9F Value3 +203 303 403 503 603 7.14159 8.1415926 9.14159 0 \N -402 2017 -602 -902 -1102 2012-11-02 \N 2013-10-27T08:11:18 -5.14145 -6.1400000000001 -7.1400 row3 line3 09:11:09.5678 text3 0xE86F6C6C6F20576F726C67 {"age": 24, "city": "ChongQing", "name": "ChenQi"} Option2 0x2F 0x58676C6C6F00000000000000 \N Value1 -- !sql -- 4 diff --git a/regression-test/data/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.out b/regression-test/data/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.out index cda9c9293b3716..315b67b4d0b09e 100644 --- a/regression-test/data/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.out +++ b/regression-test/data/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.out @@ -1,2 +1,7 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !test -- +4 5 6 +2 1 3 +3 5 6 +6 \N 6 + diff --git a/regression-test/suites/auth_p0/test_query_tvf_auth.groovy b/regression-test/suites/auth_p0/test_query_tvf_auth.groovy index 05c274077d9eb3..85a6369c534fcf 100644 --- a/regression-test/suites/auth_p0/test_query_tvf_auth.groovy +++ b/regression-test/suites/auth_p0/test_query_tvf_auth.groovy @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. -suite("test_jdbc_query_tvf","p0,auth") { - String suiteName = "test_jdbc_query_tvf" +suite("test_query_tvf_auth", "p0,auth,external") { + String suiteName = "test_query_tvf_auth" String enabled = context.config.otherConfigs.get("enableJdbcTest") String externalEnvIp = context.config.otherConfigs.get("externalEnvIp") String s3_endpoint = getS3Endpoint() @@ -58,7 +58,7 @@ suite("test_jdbc_query_tvf","p0,auth") { sql """ select * from query('catalog' = '${catalog_name}', 'query' = 'select * from doris_test.all_types'); """ - exception "denied" + exception "has no privilege" } } sql """grant select_priv on ${catalog_name}.*.* to ${dorisuser}""" diff --git a/regression-test/suites/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.groovy b/regression-test/suites/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.groovy index adfb20e355d258..f1ef0b17e7b88a 100644 --- a/regression-test/suites/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.groovy +++ b/regression-test/suites/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.groovy @@ -22,9 +22,9 @@ suite("test_switch_catalog_and_delete_internal", "p0,external") { String s3_endpoint = getS3Endpoint() String bucket = getS3BucketName() String driver_url = "https://${bucket}.${s3_endpoint}/regression/jdbc_driver/mysql-connector-java-8.0.25.jar" + String db = context.config.getDbNameByFile(context.file) if (enabled != null && enabled.equalsIgnoreCase("true")) { // 0.create internal db and table - String db = context.config.getDbNameByFile(new File(context.file)) sql "drop table if exists test_switch_catalog_and_delete_internal" sql """ create table test_switch_catalog_and_delete_internal(pk int, a int, b int) distributed by hash(pk) buckets 10 @@ -50,9 +50,9 @@ suite("test_switch_catalog_and_delete_internal", "p0,external") { sql "switch test_switch_catalog_and_delete_internal_catalog" sql "refresh catalog test_switch_catalog_and_delete_internal_catalog" // 3.delete table - sql "delete from internal.${db}.test_switch_catalog_and_delete_internal;" + sql "delete from internal.${db}.test_switch_catalog_and_delete_internal where pk < 2;" // 4.select table - qt_test "select * from internal.maldb.test_switch_catalog_and_delete_internal;" + qt_test "select * from internal.${db}.test_switch_catalog_and_delete_internal;" } -} \ No newline at end of file +} From 6c169e9658607cbbd1edf1292363605bc8388cb2 Mon Sep 17 00:00:00 2001 From: morningman Date: Sun, 12 Jan 2025 14:02:01 +0800 Subject: [PATCH 2/3] 1 --- regression-test/suites/auth_p0/test_query_tvf_auth.groovy | 2 +- .../jdbc/test_switch_catalog_and_delete_internal.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/regression-test/suites/auth_p0/test_query_tvf_auth.groovy b/regression-test/suites/auth_p0/test_query_tvf_auth.groovy index 85a6369c534fcf..746eb47ce5b870 100644 --- a/regression-test/suites/auth_p0/test_query_tvf_auth.groovy +++ b/regression-test/suites/auth_p0/test_query_tvf_auth.groovy @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -suite("test_query_tvf_auth", "p0,auth,external") { +suite("test_query_tvf_auth", "p0,auth,external,external_docker") { String suiteName = "test_query_tvf_auth" String enabled = context.config.otherConfigs.get("enableJdbcTest") String externalEnvIp = context.config.otherConfigs.get("externalEnvIp") diff --git a/regression-test/suites/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.groovy b/regression-test/suites/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.groovy index f1ef0b17e7b88a..790450469f1cb5 100644 --- a/regression-test/suites/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.groovy +++ b/regression-test/suites/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.groovy @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -suite("test_switch_catalog_and_delete_internal", "p0,external") { +suite("test_switch_catalog_and_delete_internal", "p0,external,external_docker") { String enabled = context.config.otherConfigs.get("enableJdbcTest") String externalEnvIp = context.config.otherConfigs.get("externalEnvIp") String mysql_port = context.config.otherConfigs.get("mysql_57_port"); From e6cf641787266f8e2e1dd36878db33dce536d2d2 Mon Sep 17 00:00:00 2001 From: morningman Date: Sun, 12 Jan 2025 20:07:20 +0800 Subject: [PATCH 3/3] 3 --- .../jdbc/test_switch_catalog_and_delete_internal.out | 2 +- .../jdbc/test_switch_catalog_and_delete_internal.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/regression-test/data/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.out b/regression-test/data/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.out index 315b67b4d0b09e..c1f65cf759946b 100644 --- a/regression-test/data/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.out +++ b/regression-test/data/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.out @@ -1,7 +1,7 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !test -- -4 5 6 2 1 3 3 5 6 +4 5 6 6 \N 6 diff --git a/regression-test/suites/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.groovy b/regression-test/suites/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.groovy index 790450469f1cb5..dd8fddf65e59aa 100644 --- a/regression-test/suites/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.groovy +++ b/regression-test/suites/external_table_p0/jdbc/test_switch_catalog_and_delete_internal.groovy @@ -52,7 +52,7 @@ suite("test_switch_catalog_and_delete_internal", "p0,external,external_docker") // 3.delete table sql "delete from internal.${db}.test_switch_catalog_and_delete_internal where pk < 2;" // 4.select table - qt_test "select * from internal.${db}.test_switch_catalog_and_delete_internal;" + qt_test "select * from internal.${db}.test_switch_catalog_and_delete_internal order by pk;" } }