From 316d6e49a527d8a56fb4ea714ecba8fc5a284d71 Mon Sep 17 00:00:00 2001 From: Siyang Tang Date: Thu, 23 Jan 2025 21:51:22 +0800 Subject: [PATCH] fix cases --- ...chema_change_modify_mv_column_type_agg.out | 25 ------------ .../schema_change_modify_mv_column_type.out | 39 ------------------- ...ma_change_modify_mv_column_type_agg.groovy | 23 ++--------- ...schema_change_modify_mv_column_type.groovy | 26 ++----------- 4 files changed, 6 insertions(+), 107 deletions(-) diff --git a/regression-test/data/schema_change_p0/modify_col_type_agg/schema_change_modify_mv_column_type_agg.out b/regression-test/data/schema_change_p0/modify_col_type_agg/schema_change_modify_mv_column_type_agg.out index b1feac9a13a341..c8e17282628196 100644 --- a/regression-test/data/schema_change_p0/modify_col_type_agg/schema_change_modify_mv_column_type_agg.out +++ b/regression-test/data/schema_change_p0/modify_col_type_agg/schema_change_modify_mv_column_type_agg.out @@ -28,28 +28,3 @@ mv_tbl_scalar_types_agg_1 AGG_KEYS mv_k2 bigint bigint Yes true \N true `k2` -- !sql -- --- !master_sql -- -tbl_scalar_types_agg AGG_KEYS k1 bigint bigint Yes true \N true - k2 bigint bigint Yes true \N true - c_bool boolean boolean Yes false \N REPLACE true - c_tinyint tinyint tinyint Yes false \N MIN true - c_smallint smallint smallint Yes false \N MAX true - c_int bigint bigint Yes false \N MAX true - c_bigint bigint bigint Yes false \N SUM true - c_largeint largeint largeint Yes false \N MIN true - c_float float float Yes false \N MIN true - c_double double double Yes false \N MAX true - c_decimal DECIMAL(20, 3) decimalv3(20,3) Yes false \N SUM true - c_decimalv3 DECIMAL(20, 3) decimalv3(20,3) Yes false \N SUM true - c_date DATE datev2 Yes false \N REPLACE true - c_datetime DATETIME datetimev2(0) Yes false \N REPLACE true - c_datev2 DATE datev2 Yes false \N REPLACE true - c_datetimev2 DATETIME datetimev2(0) Yes false \N REPLACE true - c_char char(15) char(15) Yes false \N REPLACE true - c_varchar varchar(100) varchar(100) Yes false \N REPLACE true - c_string text text Yes false \N REPLACE true - -mv_tbl_scalar_types_agg_1 AGG_KEYS mv_k2 bigint bigint Yes true \N true `k2` - mv_k1 bigint bigint Yes true \N true `k1` - mva_MAX__`c_int` bigint bigint Yes false \N MAX true `c_int` - diff --git a/regression-test/data/schema_change_p0/modify_col_type_dup/schema_change_modify_mv_column_type.out b/regression-test/data/schema_change_p0/modify_col_type_dup/schema_change_modify_mv_column_type.out index 3503eca20850cf..2c3de71bc3dd44 100644 --- a/regression-test/data/schema_change_p0/modify_col_type_dup/schema_change_modify_mv_column_type.out +++ b/regression-test/data/schema_change_p0/modify_col_type_dup/schema_change_modify_mv_column_type.out @@ -62,42 +62,3 @@ mv_tbl_scalar_types_dup_1 DUP_KEYS mv_c_tinyint tinyint tinyint Yes true \N tru -2106969609 true 10 29572 16738 1736115820 -957295886 -13319.206 -1.333603562816737E9 91224478600376111.942 69457425159617037.453 2022-09-06 2022-05-08T19:52:36 2022-04-05 2022-08-17T19:23:31 222.79.139.99 WalterFox@Voomm.net Oxford Alley 77 -2102307005 true 10 -23674 24613 -1810828490 -47095409 -14686.167 2.072108685694799E9 39847820962230526.125 584354832299375.156 2022-03-27 2022-02-11T13:46:06 2022-12-25 2022-11-28T09:37:49 213.146.33.250 JuliaSimmons@Zazio.info Eagle Crest Terrace 84 --- !master_sql -- -tbl_scalar_types_dup DUP_KEYS k1 bigint bigint Yes true \N true - c_bool boolean boolean Yes false \N NONE true - c_tinyint tinyint tinyint Yes false \N NONE true - c_smallint smallint smallint Yes false \N NONE true - c_int bigint bigint Yes false \N NONE true - c_bigint bigint bigint Yes false \N NONE true - c_largeint largeint largeint Yes false \N NONE true - c_float float float Yes false \N NONE true - c_double double double Yes false \N NONE true - c_decimal DECIMAL(20, 3) decimalv3(20,3) Yes false \N NONE true - c_decimalv3 DECIMAL(20, 3) decimalv3(20,3) Yes false \N NONE true - c_date DATE datev2 Yes false \N NONE true - c_datetime DATETIME datetimev2(0) Yes false \N NONE true - c_datev2 DATE datev2 Yes false \N NONE true - c_datetimev2 DATETIME datetimev2(0) Yes false \N NONE true - c_char char(15) char(15) Yes false \N NONE true - c_varchar varchar(100) varchar(100) Yes false \N NONE true - c_string text text Yes false \N NONE true - -mv_tbl_scalar_types_dup_1 DUP_KEYS mv_c_tinyint tinyint tinyint Yes true \N true `c_tinyint` - mv_c_bool boolean boolean Yes true \N true `c_bool` - mv_k1 bigint bigint Yes true \N true `k1` - mv_c_smallint smallint smallint Yes false \N NONE true `c_smallint` - mv_c_int bigint bigint Yes false \N NONE true `c_int` - mv_c_bigint bigint bigint Yes false \N NONE true `c_bigint` - mv_c_largeint largeint largeint Yes false \N NONE true `c_largeint` - mv_c_float float float Yes false \N NONE true `c_float` - mv_c_double double double Yes false \N NONE true `c_double` - mv_c_decimal DECIMAL(20, 3) decimalv3(20,3) Yes false \N NONE true `c_decimal` - mv_c_decimalv3 DECIMAL(20, 3) decimalv3(20,3) Yes false \N NONE true `c_decimalv3` - mv_c_date DATE datev2 Yes false \N NONE true `c_date` - mv_c_datetime DATETIME datetimev2(0) Yes false \N NONE true `c_datetime` - mv_c_datev2 DATE datev2 Yes false \N NONE true `c_datev2` - mv_c_datetimev2 DATETIME datetimev2(0) Yes false \N NONE true `c_datetimev2` - mv_c_char character(255) character(255) Yes false \N NONE true `c_char` - mv_c_varchar varchar(65533) varchar(65533) Yes false \N NONE true `c_varchar` - mv_c_string text text Yes false \N NONE true `c_string` - diff --git a/regression-test/suites/schema_change_p0/modify_col_type_agg/schema_change_modify_mv_column_type_agg.groovy b/regression-test/suites/schema_change_p0/modify_col_type_agg/schema_change_modify_mv_column_type_agg.groovy index dd5cc5c47ee138..b4be34c76f6a35 100644 --- a/regression-test/suites/schema_change_p0/modify_col_type_agg/schema_change_modify_mv_column_type_agg.groovy +++ b/regression-test/suites/schema_change_p0/modify_col_type_agg/schema_change_modify_mv_column_type_agg.groovy @@ -73,25 +73,8 @@ suite("schema_change_modify_mv_column_type_agg") { qt_sql "SELECT * from ${testTable} order by 1, 2, 3 limit 10" qt_sql "SELECT * from ${testTable} where c_tinyint = 10 order by 1, 2, 3 limit 10 " - sql """ - ALTER table ${testTable} MODIFY COLUMN c_int BIGINT max; - """ - def getJobState = { tableName -> - def jobStateResult = sql """ SHOW ALTER TABLE COLUMN WHERE IndexName='${tableName}' ORDER BY createtime DESC LIMIT 1 """ - return jobStateResult[0][9] - } - int max_try_time = 100 - while (max_try_time--){ - String result = getJobState(testTable) - if (result == "FINISHED") { - break - } else { - sleep(2000) - if (max_try_time < 1){ - assertEquals(1,2) - } - } + test { + sql """ ALTER table ${testTable} MODIFY COLUMN c_int BIGINT max """ + exception "Can not modify column contained by mv" } - qt_master_sql """ desc ${testTable} all """ - sql "INSERT INTO ${testTable} SELECT * from ${testTable}" } diff --git a/regression-test/suites/schema_change_p0/modify_col_type_dup/schema_change_modify_mv_column_type.groovy b/regression-test/suites/schema_change_p0/modify_col_type_dup/schema_change_modify_mv_column_type.groovy index 92c3870c56339b..f68bbea860ec5c 100644 --- a/regression-test/suites/schema_change_p0/modify_col_type_dup/schema_change_modify_mv_column_type.groovy +++ b/regression-test/suites/schema_change_p0/modify_col_type_dup/schema_change_modify_mv_column_type.groovy @@ -73,28 +73,8 @@ suite("schema_change_modify_mv_column_type") { sql "set topn_opt_limit_threshold = 100" qt_sql "SELECT * from ${testTable} order by 1, 2, 3 limit 10" qt_sql "SELECT * from ${testTable} where c_tinyint = 10 order by 1, 2, 3 limit 10 " - - sql """ - ALTER table ${testTable} MODIFY COLUMN c_int BIGINT; - """ - def getJobState = { tableName -> - def jobStateResult = sql """ SHOW ALTER TABLE COLUMN WHERE IndexName='${tableName}' ORDER BY createtime DESC LIMIT 1 """ - return jobStateResult[0][9] - } - int max_try_time = 100 - while (max_try_time--){ - String result = getJobState(testTable) - if (result == "FINISHED") { - break - } else { - sleep(2000) - if (max_try_time < 1){ - assertEquals(1,2) - } - } + test { + sql "ALTER table ${testTable} MODIFY COLUMN c_int BIGINT;" + exception "Can not modify column contained by mv" } - // sync materialized view rewrite will fail when schema change, tmp disable, enable when fixed - sql """set enable_dml_materialized_view_rewrite = false;""" - qt_master_sql """ desc ${testTable} all """ - sql "INSERT INTO ${testTable} SELECT * from ${testTable}" }