diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index a4bd1e8..338e3dd 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -3542,6 +3542,6 @@ func isStatusContainsAny(status *tstatus.TStatus, patterns ...string) bool { } func IsSessionVariableRequired(msg string) bool { - re := regexp.MustCompile(`set enable_.+=.+`) + re := regexp.MustCompile(`set enable_.+=.+|Incorrect column name .* Column regex is`) return re.MatchString(msg) } diff --git a/pkg/ccr/job_test.go b/pkg/ccr/job_test.go index 1295e36..598de6a 100644 --- a/pkg/ccr/job_test.go +++ b/pkg/ccr/job_test.go @@ -14,10 +14,11 @@ func TestIsSessionVariableRequired(t *testing.T) { "agg state not enable, need set enable_agg_state=true", "which is greater than 38 is disabled by default. set enable_decimal256 = true to enable it", "if we have a column with decimalv3 type and set enable_decimal_conversion = false", + "Incorrect column name '名称'. Column regex is '^[_a-zA-Z@0-9\\s/][.a-zA-Z0-9_+-/?@#$%^&*\"\\s,:]{0,255}$'", } for i, test := range tests { if !ccr.IsSessionVariableRequired(test) { - t.Errorf("test %d failed", i) + t.Errorf("test %d failed, input: %s", i, test) } } } diff --git a/regression-test/suites/cross_ds/table/create_vars/test_cds_tbl_create_vars.groovy b/regression-test/suites/cross_ds/table/create_vars/test_cds_tbl_create_vars.groovy index 8588fa4..9f3c1a7 100644 --- a/regression-test/suites/cross_ds/table/create_vars/test_cds_tbl_create_vars.groovy +++ b/regression-test/suites/cross_ds/table/create_vars/test_cds_tbl_create_vars.groovy @@ -57,7 +57,9 @@ suite('test_cds_tbl_create_vars') { """ assertTrue(helper.checkShowTimesOf("SHOW CREATE TABLE ${tableName}_agg", exist, 30, 'target')) - } catch (Exception) { } + } catch (Exception e) { + logger.warn("create table with agg state failed: ${e}") + } try { logger.info('create table with decimal 256') @@ -78,5 +80,31 @@ suite('test_cds_tbl_create_vars') { ) """ assertTrue(helper.checkShowTimesOf("SHOW CREATE TABLE ${tableName}_decimal_256", exist, 30, 'target')) - } catch (Exception) { } + } catch (Exception e) { + logger.warn("create table with decimal 256 failed: ${e}") + } + + try { + logger.info('create table with unicode column name') + sql '''set enable_unicode_name_support=true''' + sql """ + CREATE TABLE ${tableName}_unicode_column ( + `k1` int NULL, + `名称` text NULL, + `k3` char(50) NULL, + `k4` varchar(200) NULL, + `k5` datetime NULL + ) ENGINE=OLAP + DUPLICATE KEY(`k1`) + DISTRIBUTED BY RANDOM BUCKETS 1 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "light_schema_change" = "true", + "binlog.enable" = "true" + ); + """ + assertTrue(helper.checkShowTimesOf("SHOW CREATE TABLE ${tableName}_unicode_column", exist, 30, 'target')) + } catch (Exception e) { + logger.warn("create table with unicode column failed: ${e}") } +}