Skip to content

Commit

Permalink
branch-3.0: [fix](test) fix mysql jdbc catalog test out #43867 (#43915)
Browse files Browse the repository at this point in the history
Cherry-picked from #43867

Co-authored-by: zy-kkk <[email protected]>
  • Loading branch information
github-actions[bot] and zy-kkk authored Nov 14, 2024
1 parent 6d5ea1f commit f9f5743
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 62 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !sql --
-- !sql_current_catalog --
internal

-- !sql --
internal

-- !sql --
-- !sql_current_catalog_after_switch --
mysql_jdbc_catalog

-- !ex_tb0 --
Expand Down Expand Up @@ -378,7 +375,7 @@ year smallint Yes false \N NONE
-- !auto_default_t2 --
0

-- !sql --
-- !sql_show_db_from_lower_case --
doris_1
doris_2
doris_3
Expand All @@ -388,27 +385,27 @@ init_db
mysql
show_test_do_not_modify

-- !sql --
-- !sql_show_tbl_from_lower_case --
doris_1
doris_2
doris_3

-- !sql --
-- !sql1_from_lower_case --
DORIS

-- !sql --
-- !sql2_from_lower_case --
Doris

-- !sql --
-- !sql3_from_lower_case --
doris

-- !sql --
-- !sql_count_from_rename1 --
1

-- !sql --
-- !sql_count_from_rename2 --
1

-- !sql --
-- !sql1_conjuncts --
10 \N 7744
11 \N -94
12 16970 95
Expand All @@ -425,30 +422,21 @@ doris
8 \N \N
9 \N \N

-- !sql --
-- !sql2_conjuncts --

-- !sql --
-- !sql_ctas_partition_text_1 --
int_u bigint Yes true \N
text varchar(65533) Yes true \N
t2 text Yes false \N NONE

-- !sql --
varchar varchar(65533) Yes true \N
int_u bigint Yes false \N NONE

-- !sql --
int_u bigint Yes true \N
text varchar(65533) Yes true \N
t2 varchar(65533) Yes false \N NONE

-- !sql --
-- !sql_ctas_partition_text_2 --
varchar varchar(65533) Yes true \N
int_u bigint Yes false \N NONE

-- !sql --
-- !sql_current_catalog --
internal

-- !sql --
-- !sql_current_catalog_after_switch --
mysql_jdbc_catalog

-- !ex_tb0 --
Expand Down Expand Up @@ -821,7 +809,7 @@ year smallint Yes false \N NONE
-- !auto_default_t2 --
0

-- !sql --
-- !sql_show_db_from_lower_case --
doris_1
doris_2
doris_3
Expand All @@ -831,27 +819,27 @@ init_db
mysql
show_test_do_not_modify

-- !sql --
-- !sql_show_tbl_from_lower_case --
doris_1
doris_2
doris_3

-- !sql --
-- !sql1_from_lower_case --
DORIS

-- !sql --
-- !sql2_from_lower_case --
Doris

-- !sql --
-- !sql3_from_lower_case --
doris

-- !sql --
-- !sql_count_from_rename1 --
1

-- !sql --
-- !sql_count_from_rename2 --
1

-- !sql --
-- !sql1_conjuncts --
10 0 7744
11 0 -94
12 16970 95
Expand All @@ -868,23 +856,14 @@ doris
8 0 0
9 0 0

-- !sql --
-- !sql2_conjuncts --

-- !sql --
-- !sql_ctas_partition_text_1 --
int_u bigint Yes true \N
text varchar(65533) Yes true \N
t2 text Yes false \N NONE

-- !sql --
varchar varchar(65533) Yes true \N
int_u bigint Yes false \N NONE

-- !sql --
int_u bigint Yes true \N
text varchar(65533) Yes true \N
t2 varchar(65533) Yes false \N NONE

-- !sql --
-- !sql_ctas_partition_text_2 --
varchar varchar(65533) Yes true \N
int_u bigint Yes false \N NONE

Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
// under the License.

suite("test_mysql_jdbc_catalog", "p0,external,mysql,external_docker,external_docker_mysql") {
qt_sql """select current_catalog()"""

String enabled = context.config.otherConfigs.get("enableJdbcTest")
String externalEnvIp = context.config.otherConfigs.get("externalEnvIp")
String s3_endpoint = getS3Endpoint()
Expand Down Expand Up @@ -140,9 +138,9 @@ suite("test_mysql_jdbc_catalog", "p0,external,mysql,external_docker,external_doc
PROPERTIES("replication_num" = "1");
"""

qt_sql """select current_catalog()"""
qt_sql_current_catalog """select current_catalog()"""
sql """switch ${catalog_name}"""
qt_sql """select current_catalog()"""
qt_sql_current_catalog_after_switch """select current_catalog()"""
sql """ use ${ex_db_name}"""

order_qt_ex_tb0 """ select id, name from ${ex_tb0} order by id; """
Expand Down Expand Up @@ -544,11 +542,11 @@ suite("test_mysql_jdbc_catalog", "p0,external,mysql,external_docker,external_doc
);
"""

qt_sql "show databases from mysql_lower_case_catalog;"
qt_sql "show tables from mysql_lower_case_catalog.doris_2;"
qt_sql "select * from mysql_lower_case_catalog.doris_2.doris_1 order by id;"
qt_sql "select * from mysql_lower_case_catalog.doris_2.doris_2 order by id;"
qt_sql "select * from mysql_lower_case_catalog.doris_2.doris_3 order by id;"
qt_sql_show_db_from_lower_case "show databases from mysql_lower_case_catalog;"
qt_sql_show_tbl_from_lower_case "show tables from mysql_lower_case_catalog.doris_2;"
qt_sql1_from_lower_case "select * from mysql_lower_case_catalog.doris_2.doris_1 order by id;"
qt_sql2_from_lower_case "select * from mysql_lower_case_catalog.doris_2.doris_2 order by id;"
qt_sql3_from_lower_case "select * from mysql_lower_case_catalog.doris_2.doris_3 order by id;"

sql """ drop catalog if exists mysql_lower_case_catalog; """
sql """ drop catalog if exists mysql_lower_case_catalog2; """
Expand Down Expand Up @@ -604,11 +602,11 @@ suite("test_mysql_jdbc_catalog", "p0,external,mysql,external_docker,external_doc
"driver_class" = "${driver_class}"
);"""

qt_sql """select count(*) from mysql_rename1.doris_test.ex_tb1;"""
qt_sql_count_from_rename1 """select count(*) from mysql_rename1.doris_test.ex_tb1;"""

sql """alter catalog mysql_rename1 rename mysql_rename2"""

qt_sql """select count(*) from mysql_rename2.doris_test.ex_tb1;"""
qt_sql_count_from_rename2 """select count(*) from mysql_rename2.doris_test.ex_tb1;"""

sql """drop catalog if exists mysql_rename2;"""

Expand All @@ -623,9 +621,9 @@ suite("test_mysql_jdbc_catalog", "p0,external,mysql,external_docker,external_doc
"driver_class" = "${driver_class}"
);"""

order_qt_sql """SELECT * FROM mysql_conjuncts.doris_test.compoundpredicate_test WHERE (pk > 4) OR ((pk < 6 OR pk > 7) AND col_int_undef_signed < 1);"""
order_qt_sql1_conjuncts """SELECT * FROM mysql_conjuncts.doris_test.compoundpredicate_test WHERE (pk > 4) OR ((pk < 6 OR pk > 7) AND col_int_undef_signed < 1);"""

order_qt_sql """select * from mysql_conjuncts.doris_test.text_push where pk <=7;"""
order_qt_sql2_conjuncts """select * from mysql_conjuncts.doris_test.text_push where pk <=7;"""

// test create table as select
sql """use internal.${internal_db_name}"""
Expand All @@ -636,10 +634,10 @@ suite("test_mysql_jdbc_catalog", "p0,external,mysql,external_docker,external_doc
sql """set enable_nereids_planner=true"""
// 1. test text type column as distribution col
sql """create table ctas_partition_text_1 distributed by hash(text) buckets 1 properties("replication_num" = "1") as select int_u, text, text as t2 from mysql_conjuncts.doris_test.all_types;"""
qt_sql """desc ctas_partition_text_1"""
qt_sql_ctas_partition_text_1 """desc ctas_partition_text_1"""
// 2. test varchar type column as first col
sql """create table ctas_partition_text_2 distributed by hash(int_u) buckets 1 properties("replication_num" = "1") as select varchar, int_u from mysql_conjuncts.doris_test.all_types;"""
qt_sql """desc ctas_partition_text_2"""
qt_sql_ctas_partition_text_2 """desc ctas_partition_text_2"""
// ctas logic is different between new and old planner.
// so need to test both.
sql """drop catalog if exists mysql_conjuncts;"""
Expand Down

0 comments on commit f9f5743

Please sign in to comment.