From 3738dec53efa46bd77001f13f7d0db6101dc3deb Mon Sep 17 00:00:00 2001 From: wjHuang Date: Tue, 8 Feb 2022 12:53:35 +0800 Subject: [PATCH] *: enable the new collation by default (#32016) ref pingcap/tidb#32015 --- cmd/explaintest/disable_new_collation.toml | 1 + config/config.go | 9 +- config/config.toml.example | 2 +- ddl/column_test.go | 4 - ddl/column_type_change_test.go | 3 - ddl/db_integration_test.go | 6 +- ddl/db_partition_test.go | 5 - ddl/db_test.go | 8 +- ddl/serial_test.go | 6 - executor/analyze_test.go | 2 - executor/collation_test.go | 4 - executor/executor_test.go | 58 ---- executor/insert_test.go | 4 - executor/parallel_apply_test.go | 2 +- executor/seqtest/seq_executor_test.go | 6 - executor/write_test.go | 12 - expression/aggregation/agg_to_pb_test.go | 14 +- expression/builtin_like_test.go | 2 - expression/builtin_other_test.go | 2 - expression/builtin_string_test.go | 15 +- expression/collation_test.go | 4 - expression/distsql_builtin_test.go | 2 +- expression/expr_to_pb_test.go | 122 ++++---- expression/integration_serial_test.go | 122 -------- expression/integration_test.go | 4 + planner/core/enforce_mpp_test.go | 1 + planner/core/expression_rewriter_test.go | 4 - planner/core/integration_test.go | 18 -- planner/core/logical_plans_test.go | 3 - planner/core/partition_pruning_test.go | 3 - planner/core/plan_to_pb_test.go | 2 +- planner/core/stringer_test.go | 2 +- .../integration_serial_suite_out.json | 274 +++++++++--------- planner/core/testdata/plan_suite_out.json | 40 +-- server/tidb_serial_test.go | 3 - session/clustered_index_test.go | 9 - session/session.go | 4 +- session/session_test.go | 3 - statistics/handle/handle_test.go | 4 - statistics/selectivity_test.go | 2 - table/tables/index_test.go | 3 - types/enum_test.go | 4 - types/set_test.go | 4 - util/codec/collation_test.go | 7 - util/collate/collate.go | 8 +- util/misc_test.go | 4 +- util/ranger/ranger_test.go | 3 - 47 files changed, 256 insertions(+), 568 deletions(-) diff --git a/cmd/explaintest/disable_new_collation.toml b/cmd/explaintest/disable_new_collation.toml index 138892acf40db..c66f92d0b30c8 100644 --- a/cmd/explaintest/disable_new_collation.toml +++ b/cmd/explaintest/disable_new_collation.toml @@ -15,6 +15,7 @@ lease = "0" mem-quota-query = 34359738368 host = "127.0.0.1" +new_collations_enabled_on_first_bootstrap = false [status] status-host = "127.0.0.1" diff --git a/config/config.go b/config/config.go index da01925e79faf..3e4a6f50765d1 100644 --- a/config/config.go +++ b/config/config.go @@ -744,10 +744,11 @@ var defaultConf = Config{ AutoTLS: false, RSAKeySize: 4096, }, - DeprecateIntegerDisplayWidth: false, - EnableEnumLengthLimit: true, - StoresRefreshInterval: defTiKVCfg.StoresRefreshInterval, - EnableForwarding: defTiKVCfg.EnableForwarding, + DeprecateIntegerDisplayWidth: false, + EnableEnumLengthLimit: true, + StoresRefreshInterval: defTiKVCfg.StoresRefreshInterval, + EnableForwarding: defTiKVCfg.EnableForwarding, + NewCollationsEnabledOnFirstBootstrap: true, } var ( diff --git a/config/config.toml.example b/config/config.toml.example index 6a54dd3230462..37af4ddf79b51 100644 --- a/config/config.toml.example +++ b/config/config.toml.example @@ -109,7 +109,7 @@ repair-table-list = [] max-server-connections = 0 # Whether new collations are enabled, as indicated by its name, this configuration entry take effect ONLY when a TiDB cluster bootstraps for the first time. -new_collations_enabled_on_first_bootstrap = false +new_collations_enabled_on_first_bootstrap = true # Don't register information of this TiDB to etcd, so this instance of TiDB won't appear in the services like dashboard. # This option is useful when you want to embed TiDB into your service(i.e. use TiDB as a library). diff --git a/ddl/column_test.go b/ddl/column_test.go index fe0e58575f1be..210d967991686 100644 --- a/ddl/column_test.go +++ b/ddl/column_test.go @@ -37,7 +37,6 @@ import ( "github.com/pingcap/tidb/table/tables" "github.com/pingcap/tidb/tablecodec" "github.com/pingcap/tidb/types" - "github.com/pingcap/tidb/util/collate" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" ) @@ -1171,9 +1170,6 @@ func (s *testColumnSuiteToVerify) TestDropColumns() { } func TestModifyColumn(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, err := mockstore.NewMockStore() require.NoError(t, err) d, err := testNewDDLAndStart( diff --git a/ddl/column_type_change_test.go b/ddl/column_type_change_test.go index 2e5f88cfa038a..a5028bbe4abfd 100644 --- a/ddl/column_type_change_test.go +++ b/ddl/column_type_change_test.go @@ -41,7 +41,6 @@ import ( "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/table/tables" "github.com/pingcap/tidb/tablecodec" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/dbterror" "github.com/pingcap/tidb/util/testkit" ) @@ -440,8 +439,6 @@ func (s *testColumnTypeChangeSuite) TestColumnTypeChangeFromIntegerToOthers(c *C func (s *testColumnTypeChangeSuite) TestColumnTypeChangeBetweenVarcharAndNonVarchar(c *C) { tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk.MustExec("drop database if exists col_type_change_char;") tk.MustExec("create database col_type_change_char;") tk.MustExec("use col_type_change_char;") diff --git a/ddl/db_integration_test.go b/ddl/db_integration_test.go index cff9301f1e442..89d962d40d420 100644 --- a/ddl/db_integration_test.go +++ b/ddl/db_integration_test.go @@ -956,11 +956,11 @@ func (s *testIntegrationSuite4) TestChangingTableCharset(c *C) { tk.MustExec("drop table t") tk.MustExec("create table t(a varchar(5) charset utf8 collate utf8_unicode_ci) charset utf8 collate utf8_unicode_ci") - tk.MustExec("alter table t collate utf8_danish_ci") + tk.MustExec("alter table t collate utf8_general_ci") tbl = testGetTableByName(c, s.ctx, "test", "t") c.Assert(tbl, NotNil) c.Assert(tbl.Meta().Charset, Equals, "utf8") - c.Assert(tbl.Meta().Collate, Equals, "utf8_danish_ci") + c.Assert(tbl.Meta().Collate, Equals, "utf8_general_ci") for _, col := range tbl.Meta().Columns { c.Assert(col.Charset, Equals, "utf8") // Column collate should remain unchanged. @@ -2836,7 +2836,7 @@ func (s *testIntegrationSuite3) TestStrictDoubleTypeCheck(c *C) { } func (s *testSerialDBSuite) TestDuplicateErrorMessage(c *C) { - defer collate.SetNewCollationEnabledForTest(false) + defer collate.SetNewCollationEnabledForTest(true) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") diff --git a/ddl/db_partition_test.go b/ddl/db_partition_test.go index 5ee406470c96a..6292072fad176 100644 --- a/ddl/db_partition_test.go +++ b/ddl/db_partition_test.go @@ -48,7 +48,6 @@ import ( ntestkit "github.com/pingcap/tidb/testkit" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/admin" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/israce" "github.com/pingcap/tidb/util/logutil" "github.com/pingcap/tidb/util/mock" @@ -367,8 +366,6 @@ func (s *testIntegrationSuite2) TestCreateTableWithHashPartition(c *C) { } func (s *testSerialDBSuite1) TestCreateTableWithRangeColumnPartition(c *C) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test;") tk.MustExec("drop table if exists log_message_1;") @@ -3388,8 +3385,6 @@ func (s *testSerialDBSuite1) TestPartitionListWithTimeType(c *C) { } func (s *testSerialDBSuite1) TestPartitionListWithNewCollation(c *C) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk := testkit.NewTestKitWithInit(c, s.store) tk.MustExec("use test;") tk.MustExec("drop table if exists t;") diff --git a/ddl/db_test.go b/ddl/db_test.go index 97b9954d9a4e0..46199d7852545 100644 --- a/ddl/db_test.go +++ b/ddl/db_test.go @@ -58,7 +58,6 @@ import ( "github.com/pingcap/tidb/util" "github.com/pingcap/tidb/util/admin" "github.com/pingcap/tidb/util/codec" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/domainutil" "github.com/pingcap/tidb/util/israce" "github.com/pingcap/tidb/util/mock" @@ -2867,8 +2866,6 @@ func (s *testSerialDBSuite) TestCreateTable(c *C) { tk.MustExec("use test") failSQL := "create table t_enum (a enum('e','e'));" tk.MustGetErrCode(failSQL, errno.ErrDuplicatedValueInType) - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk = testkit.NewTestKit(c, s.store) tk.MustExec("use test") failSQL = "create table t_enum (a enum('e','E')) charset=utf8 collate=utf8_general_ci;" @@ -3173,8 +3170,8 @@ func (s *testDBSuite2) TestCreateTableWithSetCol(c *C) { tk.MustGetErrCode(failedSQL, errno.ErrInvalidDefault) failedSQL = "create table t_set (a set('1', '4', '10') default '1,4,11');" tk.MustGetErrCode(failedSQL, errno.ErrInvalidDefault) - failedSQL = "create table t_set (a set('1', '4', '10') default '1 ,4');" - tk.MustGetErrCode(failedSQL, errno.ErrInvalidDefault) + // Success when the new collation is enabled. + tk.MustExec("create table t_set (a set('1', '4', '10') default '1 ,4');") // The type of default value is int. failedSQL = "create table t_set (a set('1', '4', '10') default 0);" tk.MustGetErrCode(failedSQL, errno.ErrInvalidDefault) @@ -3183,6 +3180,7 @@ func (s *testDBSuite2) TestCreateTableWithSetCol(c *C) { // The type of default value is int. // It's for successful cases + tk.MustExec("drop table if exists t_set") tk.MustExec("create table t_set (a set('1', '4', '10', '21') default 1);") tk.MustQuery("show create table t_set").Check(testkit.Rows("t_set CREATE TABLE `t_set` (\n" + " `a` set('1','4','10','21') DEFAULT '1'\n" + diff --git a/ddl/serial_test.go b/ddl/serial_test.go index b06bf67f824ca..53cdf0d7790bd 100644 --- a/ddl/serial_test.go +++ b/ddl/serial_test.go @@ -45,7 +45,6 @@ import ( "github.com/pingcap/tidb/store/mockstore" "github.com/pingcap/tidb/tablecodec" "github.com/pingcap/tidb/util/admin" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/gcutil" "github.com/pingcap/tidb/util/mock" "github.com/pingcap/tidb/util/testkit" @@ -1521,9 +1520,6 @@ func (s *testSerialSuite) TestAutoRandomWithPreSplitRegion(c *C) { } func (s *testSerialSuite) TestModifyingColumn4NewCollations(c *C) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - tk := testkit.NewTestKit(c, s.store) tk.MustExec("create database dct") tk.MustExec("use dct") @@ -1557,8 +1553,6 @@ func (s *testSerialSuite) TestModifyingColumn4NewCollations(c *C) { } func (s *testSerialSuite) TestForbidUnsupportedCollations(c *C) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk := testkit.NewTestKit(c, s.store) mustGetUnsupportedCollation := func(sql string, coll string) { diff --git a/executor/analyze_test.go b/executor/analyze_test.go index e5ff7f5878908..d877e559171ac 100644 --- a/executor/analyze_test.go +++ b/executor/analyze_test.go @@ -1108,8 +1108,6 @@ func testAnalyzeIncremental(tk *testkit.TestKit, t *testing.T, dom *domain.Domai } func TestIssue20874(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() diff --git a/executor/collation_test.go b/executor/collation_test.go index 83d0b7251d6bd..d4b957ee413d6 100644 --- a/executor/collation_test.go +++ b/executor/collation_test.go @@ -21,15 +21,11 @@ import ( "github.com/pingcap/tidb/parser/mysql" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/mock" "github.com/stretchr/testify/require" ) func TestVecGroupChecker(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - tp := &types.FieldType{Tp: mysql.TypeVarchar} col0 := &expression.Column{ RetType: tp, diff --git a/executor/executor_test.go b/executor/executor_test.go index 4e03687fc3653..1ca941450f790 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -73,7 +73,6 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util" "github.com/pingcap/tidb/util/admin" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/deadlockhistory" "github.com/pingcap/tidb/util/gcutil" "github.com/pingcap/tidb/util/israce" @@ -322,14 +321,6 @@ func (s *testSuiteP1) TestShow(c *C) { c.Assert(len(tk.MustQuery("show index in t").Rows()), Equals, 1) c.Assert(len(tk.MustQuery("show index from t").Rows()), Equals, 1) - tk.MustQuery("show charset").Check(testkit.Rows( - "ascii US ASCII ascii_bin 1", - "binary binary binary 1", - "gbk Chinese Internal Code Specification gbk_bin 2", - "latin1 Latin1 latin1_bin 1", - "utf8 UTF-8 Unicode utf8_bin 3", - "utf8mb4 UTF-8 Unicode utf8mb4_bin 4", - )) c.Assert(len(tk.MustQuery("show master status").Rows()), Equals, 1) tk.MustQuery("show create database test_show").Check(testkit.Rows("test_show CREATE DATABASE `test_show` /*!40100 DEFAULT CHARACTER SET utf8mb4 */")) tk.MustQuery("show privileges").Check(testkit.Rows("Alter Tables To alter the table", @@ -5730,54 +5721,9 @@ func (s *testSerialSuite2) TestUnsignedFeedback(c *C) { c.Assert(result.Rows()[2][6], Equals, "keep order:false") } -func (s *testSuiteWithCliBaseCharset) TestCharsetFeatureWithoutNewCollation(c *C) { - tk := testkit.NewTestKit(c, s.store) - tk.MustExec("use test") - tk.MustQuery("show charset").Check(testkit.Rows( - "ascii US ASCII ascii_bin 1", - "binary binary binary 1", - "gbk Chinese Internal Code Specification gbk_bin 2", - "latin1 Latin1 latin1_bin 1", - "utf8 UTF-8 Unicode utf8_bin 3", - "utf8mb4 UTF-8 Unicode utf8mb4_bin 4", - )) - tk.MustQuery("show collation").Check(testkit.Rows( - "utf8mb4_bin utf8mb4 46 Yes Yes 1", - "latin1_bin latin1 47 Yes Yes 1", - "binary binary 63 Yes Yes 1", - "ascii_bin ascii 65 Yes Yes 1", - "utf8_bin utf8 83 Yes Yes 1", - "gbk_bin gbk 87 Yes Yes 1", - )) - tk.MustExec("create table t5(a char(20), b char(20) charset utf8, c binary) charset gbk collate gbk_bin;") -} - func (s *testSuiteWithCliBaseCharset) TestCharsetFeature(c *C) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") - tk.MustQuery("show charset").Check(testkit.Rows( - "ascii US ASCII ascii_bin 1", - "binary binary binary 1", - "gbk Chinese Internal Code Specification gbk_chinese_ci 2", - "latin1 Latin1 latin1_bin 1", - "utf8 UTF-8 Unicode utf8_bin 3", - "utf8mb4 UTF-8 Unicode utf8mb4_bin 4", - )) - tk.MustQuery("show collation").Check(testkit.Rows( - "ascii_bin ascii 65 Yes Yes 1", - "binary binary 63 Yes Yes 1", - "gbk_bin gbk 87 Yes 1", - "gbk_chinese_ci gbk 28 Yes Yes 1", - "latin1_bin latin1 47 Yes Yes 1", - "utf8_bin utf8 83 Yes Yes 1", - "utf8_general_ci utf8 33 Yes 1", - "utf8_unicode_ci utf8 192 Yes 1", - "utf8mb4_bin utf8mb4 46 Yes Yes 1", - "utf8mb4_general_ci utf8mb4 45 Yes 1", - "utf8mb4_unicode_ci utf8mb4 224 Yes 1", - )) tk.MustExec("set names gbk;") tk.MustQuery("select @@character_set_connection;").Check(testkit.Rows("gbk")) @@ -5820,8 +5766,6 @@ func (s *testSuiteWithCliBaseCharset) TestCharsetFeature(c *C) { } func (s *testSuiteWithCliBaseCharset) TestCharsetFeatureCollation(c *C) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("drop table if exists t;") @@ -5847,8 +5791,6 @@ func (s *testSuiteWithCliBaseCharset) TestCharsetFeatureCollation(c *C) { } func (s *testSuiteWithCliBaseCharset) TestCharsetWithPrefixIndex(c *C) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("drop table if exists t") diff --git a/executor/insert_test.go b/executor/insert_test.go index c72fd6134401d..1af9dbe87060f 100644 --- a/executor/insert_test.go +++ b/executor/insert_test.go @@ -30,7 +30,6 @@ import ( "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/execdetails" "github.com/pingcap/tidb/util/israce" "github.com/pingcap/tidb/util/testkit" @@ -1496,9 +1495,6 @@ func (s *testSuite10) TestInsertRuntimeStat(c *C) { } func (s *testSerialSuite) TestDuplicateEntryMessage(c *C) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test;") for _, enable := range []variable.ClusteredIndexDefMode{variable.ClusteredIndexDefModeOn, variable.ClusteredIndexDefModeOff, variable.ClusteredIndexDefModeIntOnly} { diff --git a/executor/parallel_apply_test.go b/executor/parallel_apply_test.go index 809b4c5247e5a..e9bf204c1dad4 100644 --- a/executor/parallel_apply_test.go +++ b/executor/parallel_apply_test.go @@ -392,7 +392,6 @@ func (s *testSerialSuite) TestApplyWithOtherFeatures(c *C) { tk.MustExec("set tidb_enable_parallel_apply=true") // collation 1 - collate.SetNewCollationEnabledForTest(true) tk.MustExec("drop table if exists t, t1") tk.MustExec("create table t(a varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci, b int)") tk.MustExec("create table t1(a varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci, b int)") @@ -405,6 +404,7 @@ func (s *testSerialSuite) TestApplyWithOtherFeatures(c *C) { sql = "select (select min(t1.b) from t1 where t1.a >= t.a and t1.b >= t.b), (select sum(t1.b) from t1 where t1.a >= t.a and t1.b >= t.b) from t" tk.MustQuery(sql).Sort().Check(testkit.Rows("1 10", "2 9", "3 7", "4 4")) collate.SetNewCollationEnabledForTest(false) + defer collate.SetNewCollationEnabledForTest(true) // plan cache orgEnable := core.PreparedPlanCacheEnabled() diff --git a/executor/seqtest/seq_executor_test.go b/executor/seqtest/seq_executor_test.go index e6f6b899353c6..f203ebbfd2df7 100644 --- a/executor/seqtest/seq_executor_test.go +++ b/executor/seqtest/seq_executor_test.go @@ -50,7 +50,6 @@ import ( "github.com/pingcap/tidb/store/mockstore" "github.com/pingcap/tidb/tablecodec" "github.com/pingcap/tidb/testkit" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/gcutil" "github.com/pingcap/tidb/util/testutil" "github.com/stretchr/testify/require" @@ -1194,8 +1193,6 @@ func TestCoprocessorPriority(t *testing.T) { } func TestShowForNewCollations(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -1221,9 +1218,6 @@ func TestForbidUnsupportedCollations(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - tk := testkit.NewTestKit(t, store) mustGetUnsupportedCollation := func(sql string, coll string) { tk.MustGetErrMsg(sql, fmt.Sprintf("[ddl:1273]Unsupported collation when new collation is enabled: '%s'", coll)) diff --git a/executor/write_test.go b/executor/write_test.go index 2abd1e7a10563..04b3864337744 100644 --- a/executor/write_test.go +++ b/executor/write_test.go @@ -37,7 +37,6 @@ import ( "github.com/pingcap/tidb/testkit" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/mock" "github.com/pingcap/tidb/util/testutil" "github.com/stretchr/testify/require" @@ -1139,8 +1138,6 @@ func TestReplace(t *testing.T) { } func TestReplaceWithCICollation(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) @@ -4256,9 +4253,6 @@ func TestListColumnsPartitionWithGlobalIndex(t *testing.T) { } func TestIssue20724(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) @@ -4272,9 +4266,6 @@ func TestIssue20724(t *testing.T) { } func TestIssue20840(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) @@ -4289,9 +4280,6 @@ func TestIssue20840(t *testing.T) { } func TestIssueInsertPrefixIndexForNonUTF8Collation(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() tk := testkit.NewTestKit(t, store) diff --git a/expression/aggregation/agg_to_pb_test.go b/expression/aggregation/agg_to_pb_test.go index 9aa886e2d70ea..d616308588a20 100644 --- a/expression/aggregation/agg_to_pb_test.go +++ b/expression/aggregation/agg_to_pb_test.go @@ -51,13 +51,13 @@ func TestAggFunc2Pb(t *testing.T) { } jsons := []string{ - `{"tp":3002,"children":[{"tp":201,"val":"gAAAAAAAAAE=","sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":63,"charset":"binary"},"has_distinct":false}],"sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":63,"charset":"binary"},"has_distinct":%v}`, - `{"tp":3001,"children":[{"tp":201,"val":"gAAAAAAAAAE=","sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":63,"charset":"binary"},"has_distinct":false}],"sig":0,"field_type":{"tp":8,"flag":0,"flen":-1,"decimal":-1,"collate":63,"charset":"binary"},"has_distinct":%v}`, - `{"tp":3003,"children":[{"tp":201,"val":"gAAAAAAAAAE=","sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":63,"charset":"binary"},"has_distinct":false}],"sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":63,"charset":"binary"},"has_distinct":%v}`, - `{"tp":3007,"val":"AAAAAAAABAA=","children":[{"tp":201,"val":"gAAAAAAAAAE=","sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":63,"charset":"binary"},"has_distinct":false}],"sig":0,"field_type":{"tp":15,"flag":0,"flen":-1,"decimal":-1,"collate":46,"charset":"utf8mb4"},"has_distinct":%v}`, - `{"tp":3005,"children":[{"tp":201,"val":"gAAAAAAAAAE=","sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":63,"charset":"binary"},"has_distinct":false}],"sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":63,"charset":"binary"},"has_distinct":%v}`, - `{"tp":3004,"children":[{"tp":201,"val":"gAAAAAAAAAE=","sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":63,"charset":"binary"},"has_distinct":false}],"sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":63,"charset":"binary"},"has_distinct":%v}`, - `{"tp":3006,"children":[{"tp":201,"val":"gAAAAAAAAAE=","sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":63,"charset":"binary"},"has_distinct":false}],"sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":63,"charset":"binary"},"has_distinct":%v}`, + `{"tp":3002,"children":[{"tp":201,"val":"gAAAAAAAAAE=","sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":-63,"charset":"binary"},"has_distinct":false}],"sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":-63,"charset":"binary"},"has_distinct":%v}`, + `{"tp":3001,"children":[{"tp":201,"val":"gAAAAAAAAAE=","sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":-63,"charset":"binary"},"has_distinct":false}],"sig":0,"field_type":{"tp":8,"flag":0,"flen":-1,"decimal":-1,"collate":-63,"charset":"binary"},"has_distinct":%v}`, + `{"tp":3003,"children":[{"tp":201,"val":"gAAAAAAAAAE=","sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":-63,"charset":"binary"},"has_distinct":false}],"sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":-63,"charset":"binary"},"has_distinct":%v}`, + `{"tp":3007,"val":"AAAAAAAABAA=","children":[{"tp":201,"val":"gAAAAAAAAAE=","sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":-63,"charset":"binary"},"has_distinct":false}],"sig":0,"field_type":{"tp":15,"flag":0,"flen":-1,"decimal":-1,"collate":-46,"charset":"utf8mb4"},"has_distinct":%v}`, + `{"tp":3005,"children":[{"tp":201,"val":"gAAAAAAAAAE=","sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":-63,"charset":"binary"},"has_distinct":false}],"sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":-63,"charset":"binary"},"has_distinct":%v}`, + `{"tp":3004,"children":[{"tp":201,"val":"gAAAAAAAAAE=","sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":-63,"charset":"binary"},"has_distinct":false}],"sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":-63,"charset":"binary"},"has_distinct":%v}`, + `{"tp":3006,"children":[{"tp":201,"val":"gAAAAAAAAAE=","sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":-63,"charset":"binary"},"has_distinct":false}],"sig":0,"field_type":{"tp":5,"flag":0,"flen":-1,"decimal":-1,"collate":-63,"charset":"binary"},"has_distinct":%v}`, } for i, funcName := range funcNames { for _, hasDistinct := range []bool{true, false} { diff --git a/expression/builtin_like_test.go b/expression/builtin_like_test.go index 87f759ec9cf21..15145ea7c9ce2 100644 --- a/expression/builtin_like_test.go +++ b/expression/builtin_like_test.go @@ -98,8 +98,6 @@ func TestRegexp(t *testing.T) { } func TestCILike(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) ctx := createContext(t) tests := []struct { input string diff --git a/expression/builtin_other_test.go b/expression/builtin_other_test.go index f786c1b6aeb81..1e865a93cff7d 100644 --- a/expression/builtin_other_test.go +++ b/expression/builtin_other_test.go @@ -298,8 +298,6 @@ func TestInFunc(t *testing.T) { require.NoError(t, err) require.Equalf(t, tc.res, d.GetValue(), "%v", types.MakeDatums(tc.args)) } - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) strD1 := types.NewCollationStringDatum("a", "utf8_general_ci") strD2 := types.NewCollationStringDatum("Á", "utf8_general_ci") fn, err := fc.getFunction(ctx, datumsToConstants([]types.Datum{strD1, strD2})) diff --git a/expression/builtin_string_test.go b/expression/builtin_string_test.go index aedb7dc8089ba..0082a4524705c 100644 --- a/expression/builtin_string_test.go +++ b/expression/builtin_string_test.go @@ -32,7 +32,6 @@ import ( "github.com/pingcap/tidb/testkit/trequire" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/mock" "github.com/stretchr/testify/require" ) @@ -2554,16 +2553,16 @@ func TestWeightString(t *testing.T) { {7, "NONE", 0, nil}, {7.0, "NONE", 0, nil}, {"a", "NONE", 0, "a"}, - {"a ", "NONE", 0, "a "}, + {"a ", "NONE", 0, "a"}, {"中", "NONE", 0, "中"}, - {"中 ", "NONE", 0, "中 "}, + {"中 ", "NONE", 0, "中"}, {nil, "CHAR", 5, nil}, {7, "CHAR", 5, nil}, {7.0, "NONE", 0, nil}, - {"a", "CHAR", 5, "a "}, - {"a ", "CHAR", 5, "a "}, - {"中", "CHAR", 5, "中 "}, - {"中 ", "CHAR", 5, "中 "}, + {"a", "CHAR", 5, "a"}, + {"a ", "CHAR", 5, "a"}, + {"中", "CHAR", 5, "中"}, + {"中 ", "CHAR", 5, "中"}, {nil, "BINARY", 5, nil}, {7, "BINARY", 2, "7\x00"}, {7.0, "NONE", 0, nil}, @@ -2663,8 +2662,6 @@ func TestTranslate(t *testing.T) { func TestCIWeightString(t *testing.T) { ctx := createContext(t) - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) type weightStringTest struct { str string diff --git a/expression/collation_test.go b/expression/collation_test.go index 9e11c66089d12..9062dc3cbf3ba 100644 --- a/expression/collation_test.go +++ b/expression/collation_test.go @@ -22,7 +22,6 @@ import ( "github.com/pingcap/tidb/parser/mysql" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/mock" "github.com/stretchr/testify/require" ) @@ -637,9 +636,6 @@ func TestDeriveCollation(t *testing.T) { } func TestCompareString(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - require.Equal(t, 0, types.CompareString("a", "A", "utf8_general_ci")) require.Equal(t, 0, types.CompareString("À", "A", "utf8_general_ci")) require.Equal(t, 0, types.CompareString("😜", "😃", "utf8_general_ci")) diff --git a/expression/distsql_builtin_test.go b/expression/distsql_builtin_test.go index 95fb3f1049adb..26f47169e9098 100644 --- a/expression/distsql_builtin_test.go +++ b/expression/distsql_builtin_test.go @@ -793,6 +793,7 @@ func TestEval(t *testing.T) { } func TestPBToExprWithNewCollation(t *testing.T) { + collate.SetNewCollationEnabledForTest(false) sc := new(stmtctx.StatementContext) fieldTps := make([]*types.FieldType, 1) @@ -829,7 +830,6 @@ func TestPBToExprWithNewCollation(t *testing.T) { } collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) for _, cs := range cases { ft := types.NewFieldType(mysql.TypeString) diff --git a/expression/expr_to_pb_test.go b/expression/expr_to_pb_test.go index 3806f5ed1228c..2986596f0bc17 100644 --- a/expression/expr_to_pb_test.go +++ b/expression/expr_to_pb_test.go @@ -28,7 +28,6 @@ import ( "github.com/pingcap/tidb/parser/mysql" "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/mock" "github.com/pingcap/tipb/go-tipb" "github.com/stretchr/testify/require" @@ -176,29 +175,29 @@ func TestColumn2Pb(t *testing.T) { pbExprs, err := ExpressionsToPBList(sc, colExprs, client) require.NoError(t, err) jsons := []string{ - "{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":2,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAAAM=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAAAQ=\",\"sig\":0,\"field_type\":{\"tp\":4,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAAAU=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAAAY=\",\"sig\":0,\"field_type\":{\"tp\":6,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAAAc=\",\"sig\":0,\"field_type\":{\"tp\":7,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAAAg=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAAAk=\",\"sig\":0,\"field_type\":{\"tp\":9,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAAAo=\",\"sig\":0,\"field_type\":{\"tp\":10,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAAAs=\",\"sig\":0,\"field_type\":{\"tp\":11,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAAAw=\",\"sig\":0,\"field_type\":{\"tp\":12,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAAA0=\",\"sig\":0,\"field_type\":{\"tp\":13,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAAA8=\",\"sig\":0,\"field_type\":{\"tp\":15,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":46,\"charset\":\"utf8mb4\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAABA=\",\"sig\":0,\"field_type\":{\"tp\":245,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAABE=\",\"sig\":0,\"field_type\":{\"tp\":246,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAABI=\",\"sig\":0,\"field_type\":{\"tp\":249,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAABM=\",\"sig\":0,\"field_type\":{\"tp\":250,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAABQ=\",\"sig\":0,\"field_type\":{\"tp\":251,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAABU=\",\"sig\":0,\"field_type\":{\"tp\":252,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAABY=\",\"sig\":0,\"field_type\":{\"tp\":253,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":46,\"charset\":\"utf8mb4\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAABc=\",\"sig\":0,\"field_type\":{\"tp\":254,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":46,\"charset\":\"utf8mb4\"},\"has_distinct\":false}", - "{\"tp\":201,\"val\":\"gAAAAAAAABg=\",\"sig\":0,\"field_type\":{\"tp\":247,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":2,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAAAM=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAAAQ=\",\"sig\":0,\"field_type\":{\"tp\":4,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAAAU=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAAAY=\",\"sig\":0,\"field_type\":{\"tp\":6,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAAAc=\",\"sig\":0,\"field_type\":{\"tp\":7,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAAAg=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAAAk=\",\"sig\":0,\"field_type\":{\"tp\":9,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAAAo=\",\"sig\":0,\"field_type\":{\"tp\":10,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAAAs=\",\"sig\":0,\"field_type\":{\"tp\":11,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAAAw=\",\"sig\":0,\"field_type\":{\"tp\":12,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAAA0=\",\"sig\":0,\"field_type\":{\"tp\":13,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAAA8=\",\"sig\":0,\"field_type\":{\"tp\":15,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-46,\"charset\":\"utf8mb4\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAABA=\",\"sig\":0,\"field_type\":{\"tp\":245,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAABE=\",\"sig\":0,\"field_type\":{\"tp\":246,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAABI=\",\"sig\":0,\"field_type\":{\"tp\":249,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAABM=\",\"sig\":0,\"field_type\":{\"tp\":250,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAABQ=\",\"sig\":0,\"field_type\":{\"tp\":251,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAABU=\",\"sig\":0,\"field_type\":{\"tp\":252,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAABY=\",\"sig\":0,\"field_type\":{\"tp\":253,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-46,\"charset\":\"utf8mb4\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAABc=\",\"sig\":0,\"field_type\":{\"tp\":254,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-46,\"charset\":\"utf8mb4\"},\"has_distinct\":false}", + "{\"tp\":201,\"val\":\"gAAAAAAAABg=\",\"sig\":0,\"field_type\":{\"tp\":247,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", } for i, pbExpr := range pbExprs { require.NotNil(t, pbExprs) @@ -237,13 +236,13 @@ func TestCompareFunc2Pb(t *testing.T) { require.NoError(t, err) require.Len(t, pbExprs, len(compareExprs)) jsons := []string{ - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":100,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":110,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":120,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":130,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":140,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":150,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":160,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":100,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":110,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":120,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":130,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":140,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":150,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":8,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":160,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", } for i, pbExpr := range pbExprs { require.NotNil(t, pbExprs) @@ -281,8 +280,8 @@ func TestLikeFunc2Pb(t *testing.T) { pbExprs, err := ExpressionsToPBList(sc, likeFuncs, client) require.NoError(t, err) results := []string{ - `{"tp":10000,"children":[{"tp":5,"val":"c3RyaW5n","sig":0,"field_type":{"tp":254,"flag":1,"flen":-1,"decimal":-1,"collate":83,"charset":"utf8"},"has_distinct":false},{"tp":5,"val":"cGF0dGVybg==","sig":0,"field_type":{"tp":254,"flag":1,"flen":-1,"decimal":-1,"collate":83,"charset":"utf8"},"has_distinct":false},{"tp":10000,"val":"CAA=","children":[{"tp":5,"val":"XA==","sig":0,"field_type":{"tp":254,"flag":1,"flen":-1,"decimal":-1,"collate":83,"charset":"utf8"},"has_distinct":false}],"sig":30,"field_type":{"tp":8,"flag":128,"flen":-1,"decimal":0,"collate":63,"charset":"binary"},"has_distinct":false}],"sig":4310,"field_type":{"tp":8,"flag":524416,"flen":1,"decimal":0,"collate":63,"charset":"binary"},"has_distinct":false}`, - `{"tp":10000,"children":[{"tp":5,"val":"c3RyaW5n","sig":0,"field_type":{"tp":254,"flag":1,"flen":-1,"decimal":-1,"collate":83,"charset":"utf8"},"has_distinct":false},{"tp":5,"val":"JWFiYyU=","sig":0,"field_type":{"tp":254,"flag":1,"flen":-1,"decimal":-1,"collate":83,"charset":"utf8"},"has_distinct":false},{"tp":10000,"val":"CAA=","children":[{"tp":5,"val":"XA==","sig":0,"field_type":{"tp":254,"flag":1,"flen":-1,"decimal":-1,"collate":83,"charset":"utf8"},"has_distinct":false}],"sig":30,"field_type":{"tp":8,"flag":128,"flen":-1,"decimal":0,"collate":63,"charset":"binary"},"has_distinct":false}],"sig":4310,"field_type":{"tp":8,"flag":524416,"flen":1,"decimal":0,"collate":63,"charset":"binary"},"has_distinct":false}`, + `{"tp":10000,"children":[{"tp":5,"val":"c3RyaW5n","sig":0,"field_type":{"tp":254,"flag":1,"flen":-1,"decimal":-1,"collate":-83,"charset":"utf8"},"has_distinct":false},{"tp":5,"val":"cGF0dGVybg==","sig":0,"field_type":{"tp":254,"flag":1,"flen":-1,"decimal":-1,"collate":-83,"charset":"utf8"},"has_distinct":false},{"tp":10000,"val":"CAA=","children":[{"tp":5,"val":"XA==","sig":0,"field_type":{"tp":254,"flag":1,"flen":-1,"decimal":-1,"collate":-83,"charset":"utf8"},"has_distinct":false}],"sig":30,"field_type":{"tp":8,"flag":128,"flen":-1,"decimal":0,"collate":-83,"charset":"binary"},"has_distinct":false}],"sig":4310,"field_type":{"tp":8,"flag":524416,"flen":1,"decimal":0,"collate":-83,"charset":"binary"},"has_distinct":false}`, + `{"tp":10000,"children":[{"tp":5,"val":"c3RyaW5n","sig":0,"field_type":{"tp":254,"flag":1,"flen":-1,"decimal":-1,"collate":-83,"charset":"utf8"},"has_distinct":false},{"tp":5,"val":"JWFiYyU=","sig":0,"field_type":{"tp":254,"flag":1,"flen":-1,"decimal":-1,"collate":-83,"charset":"utf8"},"has_distinct":false},{"tp":10000,"val":"CAA=","children":[{"tp":5,"val":"XA==","sig":0,"field_type":{"tp":254,"flag":1,"flen":-1,"decimal":-1,"collate":-83,"charset":"utf8"},"has_distinct":false}],"sig":30,"field_type":{"tp":8,"flag":128,"flen":-1,"decimal":0,"collate":-83,"charset":"binary"},"has_distinct":false}],"sig":4310,"field_type":{"tp":8,"flag":524416,"flen":1,"decimal":0,"collate":-83,"charset":"binary"},"has_distinct":false}`, } for i, pbExpr := range pbExprs { js, err := json.Marshal(pbExpr) @@ -309,11 +308,11 @@ func TestArithmeticalFunc2Pb(t *testing.T) { } jsons := make(map[string]string) - jsons[ast.Plus] = "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":200,\"field_type\":{\"tp\":5,\"flag\":128,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}" - jsons[ast.Minus] = "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":204,\"field_type\":{\"tp\":5,\"flag\":128,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}" - jsons[ast.Mul] = "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":208,\"field_type\":{\"tp\":5,\"flag\":128,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}" - jsons[ast.Div] = "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":211,\"field_type\":{\"tp\":5,\"flag\":128,\"flen\":23,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}" - jsons[ast.Mod] = "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":215,\"field_type\":{\"tp\":5,\"flag\":128,\"flen\":23,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}" + jsons[ast.Plus] = "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":200,\"field_type\":{\"tp\":5,\"flag\":128,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}" + jsons[ast.Minus] = "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":204,\"field_type\":{\"tp\":5,\"flag\":128,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}" + jsons[ast.Mul] = "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":208,\"field_type\":{\"tp\":5,\"flag\":128,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}" + jsons[ast.Div] = "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":211,\"field_type\":{\"tp\":5,\"flag\":128,\"flen\":23,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}" + jsons[ast.Mod] = "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":215,\"field_type\":{\"tp\":5,\"flag\":128,\"flen\":23,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}" pbExprs, err := ExpressionsToPBList(sc, arithmeticalFuncs, client) require.NoError(t, err) @@ -355,7 +354,7 @@ func TestDateFunc2Pb(t *testing.T) { require.NotNil(t, pbExprs[0]) js, err := json.Marshal(pbExprs[0]) require.NoError(t, err) - require.Equal(t, "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":12,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":254,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":46,\"charset\":\"utf8mb4\"},\"has_distinct\":false}],\"sig\":6001,\"field_type\":{\"tp\":253,\"flag\":0,\"flen\":0,\"decimal\":-1,\"collate\":46,\"charset\":\"utf8mb4\"},\"has_distinct\":false}", string(js)) + require.Equal(t, "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":12,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":254,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-46,\"charset\":\"utf8mb4\"},\"has_distinct\":false}],\"sig\":6001,\"field_type\":{\"tp\":253,\"flag\":0,\"flen\":0,\"decimal\":-1,\"collate\":-46,\"charset\":\"utf8mb4\"},\"has_distinct\":false}", string(js)) } func TestLogicalFunc2Pb(t *testing.T) { @@ -382,10 +381,10 @@ func TestLogicalFunc2Pb(t *testing.T) { pbExprs, err := ExpressionsToPBList(sc, logicalFuncs, client) require.NoError(t, err) jsons := []string{ - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3101,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3102,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3103,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3104,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3101,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3102,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3103,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":1,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3104,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", } for i, pbExpr := range pbExprs { js, err := json.Marshal(pbExpr) @@ -418,12 +417,12 @@ func TestBitwiseFunc2Pb(t *testing.T) { pbExprs, err := ExpressionsToPBList(sc, bitwiseFuncs, client) require.NoError(t, err) jsons := []string{ - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3118,\"field_type\":{\"tp\":8,\"flag\":160,\"flen\":20,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3119,\"field_type\":{\"tp\":8,\"flag\":160,\"flen\":20,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3120,\"field_type\":{\"tp\":8,\"flag\":160,\"flen\":20,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3129,\"field_type\":{\"tp\":8,\"flag\":160,\"flen\":20,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3130,\"field_type\":{\"tp\":8,\"flag\":160,\"flen\":20,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3121,\"field_type\":{\"tp\":8,\"flag\":160,\"flen\":20,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3118,\"field_type\":{\"tp\":8,\"flag\":160,\"flen\":20,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3119,\"field_type\":{\"tp\":8,\"flag\":160,\"flen\":20,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3120,\"field_type\":{\"tp\":8,\"flag\":160,\"flen\":20,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3129,\"field_type\":{\"tp\":8,\"flag\":160,\"flen\":20,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3130,\"field_type\":{\"tp\":8,\"flag\":160,\"flen\":20,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3121,\"field_type\":{\"tp\":8,\"flag\":160,\"flen\":20,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", } for i, pbExpr := range pbExprs { js, err := json.Marshal(pbExpr) @@ -461,9 +460,9 @@ func TestControlFunc2Pb(t *testing.T) { pbExprs, err := ExpressionsToPBList(sc, controlFuncs, client) require.NoError(t, err) jsons := []string{ - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAM=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":4208,\"field_type\":{\"tp\":3,\"flag\":128,\"flen\":-1,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAM=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":4107,\"field_type\":{\"tp\":3,\"flag\":128,\"flen\":24,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":4101,\"field_type\":{\"tp\":3,\"flag\":128,\"flen\":24,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAM=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":4208,\"field_type\":{\"tp\":3,\"flag\":128,\"flen\":-1,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAM=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":4107,\"field_type\":{\"tp\":3,\"flag\":128,\"flen\":24,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},{\"tp\":201,\"val\":\"gAAAAAAAAAI=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":4101,\"field_type\":{\"tp\":3,\"flag\":128,\"flen\":24,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", "null", } for i, pbExpr := range pbExprs { @@ -493,8 +492,8 @@ func TestOtherFunc2Pb(t *testing.T) { pbExprs, err := ExpressionsToPBList(sc, otherFuncs, client) require.NoError(t, err) jsons := map[string]string{ - ast.Coalesce: "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":4201,\"field_type\":{\"tp\":3,\"flag\":128,\"flen\":0,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", - ast.IsNull: "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3116,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false}", + ast.Coalesce: "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":4201,\"field_type\":{\"tp\":3,\"flag\":128,\"flen\":0,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", + ast.IsNull: "{\"tp\":10000,\"children\":[{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":3,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}],\"sig\":3116,\"field_type\":{\"tp\":8,\"flag\":524416,\"flen\":1,\"decimal\":0,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false}", } for i, pbExpr := range pbExprs { js, err := json.Marshal(pbExpr) @@ -1280,13 +1279,13 @@ func TestGroupByItem2Pb(t *testing.T) { pbByItem := GroupByItemToPB(sc, client, item) js, err := json.Marshal(pbByItem) require.NoError(t, err) - require.Equal(t, "{\"expr\":{\"tp\":201,\"val\":\"gAAAAAAAAAA=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},\"desc\":false}", string(js)) + require.Equal(t, "{\"expr\":{\"tp\":201,\"val\":\"gAAAAAAAAAA=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},\"desc\":false}", string(js)) item = genColumn(mysql.TypeDouble, 1) pbByItem = GroupByItemToPB(sc, client, item) js, err = json.Marshal(pbByItem) require.NoError(t, err) - require.Equal(t, "{\"expr\":{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},\"desc\":false}", string(js)) + require.Equal(t, "{\"expr\":{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},\"desc\":false}", string(js)) } func TestSortByItem2Pb(t *testing.T) { @@ -1297,25 +1296,22 @@ func TestSortByItem2Pb(t *testing.T) { pbByItem := SortByItemToPB(sc, client, item, false) js, err := json.Marshal(pbByItem) require.NoError(t, err) - require.Equal(t, "{\"expr\":{\"tp\":201,\"val\":\"gAAAAAAAAAA=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},\"desc\":false}", string(js)) + require.Equal(t, "{\"expr\":{\"tp\":201,\"val\":\"gAAAAAAAAAA=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},\"desc\":false}", string(js)) item = genColumn(mysql.TypeDouble, 1) pbByItem = SortByItemToPB(sc, client, item, false) js, err = json.Marshal(pbByItem) require.NoError(t, err) - require.Equal(t, "{\"expr\":{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},\"desc\":false}", string(js)) + require.Equal(t, "{\"expr\":{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},\"desc\":false}", string(js)) item = genColumn(mysql.TypeDouble, 1) pbByItem = SortByItemToPB(sc, client, item, true) js, err = json.Marshal(pbByItem) require.NoError(t, err) - require.Equal(t, "{\"expr\":{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":63,\"charset\":\"binary\"},\"has_distinct\":false},\"desc\":true}", string(js)) + require.Equal(t, "{\"expr\":{\"tp\":201,\"val\":\"gAAAAAAAAAE=\",\"sig\":0,\"field_type\":{\"tp\":5,\"flag\":0,\"flen\":-1,\"decimal\":-1,\"collate\":-63,\"charset\":\"binary\"},\"has_distinct\":false},\"desc\":true}", string(js)) } func TestPushCollationDown(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - fc, err := NewFunction(mock.NewContext(), ast.EQ, types.NewFieldType(mysql.TypeUnspecified), genColumn(mysql.TypeVarchar, 0), genColumn(mysql.TypeVarchar, 1)) require.NoError(t, err) client := new(mock.Client) @@ -1340,8 +1336,6 @@ func columnCollation(c *Column, chs, coll string) *Column { } func TestNewCollationsEnabled(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) var colExprs []Expression sc := new(stmtctx.StatementContext) client := new(mock.Client) diff --git a/expression/integration_serial_test.go b/expression/integration_serial_test.go index 65b7e121732c6..80e9f396d0151 100644 --- a/expression/integration_serial_test.go +++ b/expression/integration_serial_test.go @@ -34,7 +34,6 @@ import ( "github.com/pingcap/tidb/table/tables" "github.com/pingcap/tidb/testkit" "github.com/pingcap/tidb/types" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/kvcache" "github.com/pingcap/tidb/util/testutil" "github.com/stretchr/testify/require" @@ -82,9 +81,6 @@ func TestIssue17727(t *testing.T) { } func TestIssue17891(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -97,9 +93,6 @@ func TestIssue17891(t *testing.T) { } func TestIssue31174(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -120,9 +113,6 @@ func TestIssue31174(t *testing.T) { } func TestIssue20268(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -139,8 +129,6 @@ func TestCollationBasic(t *testing.T) { defer clean() tk := testkit.NewTestKit(t, store) - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk.MustExec("use test") tk.MustExec("create table t_ci(a varchar(10) collate utf8mb4_general_ci, unique key(a))") tk.MustExec("insert into t_ci values ('a')") @@ -216,8 +204,6 @@ func TestWeightString(t *testing.T) { defer clean() tk := testkit.NewTestKit(t, store) - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) type testCase struct { input []string @@ -291,8 +277,6 @@ func TestCollationCreateIndex(t *testing.T) { defer clean() tk := testkit.NewTestKit(t, store) - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk.MustExec("use test") tk.MustExec("drop table if exists t") tk.MustExec("create table t (a varchar(10) collate utf8mb4_general_ci);") @@ -326,8 +310,6 @@ func TestCollateConstantPropagation(t *testing.T) { defer clean() tk := testkit.NewTestKit(t, store) - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk.MustExec("use test") tk.MustExec("drop table if exists t") @@ -398,8 +380,6 @@ func TestMixCollation(t *testing.T) { defer clean() tk := testkit.NewTestKit(t, store) - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk.MustGetErrMsg(`select 'a' collate utf8mb4_bin = 'a' collate utf8mb4_general_ci;`, "[expression:1267]Illegal mix of collations (utf8mb4_bin,EXPLICIT) and (utf8mb4_general_ci,EXPLICIT) for operation '='") @@ -491,8 +471,6 @@ func prepare4Join(tk *testkit.TestKit) { } func TestCollateHashJoin(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -517,8 +495,6 @@ func TestCollateHashJoin(t *testing.T) { } func TestCollateHashJoin2(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -539,8 +515,6 @@ func prepare4Join2(tk *testkit.TestKit) { } func TestCollateMergeJoin(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -565,8 +539,6 @@ func TestCollateMergeJoin(t *testing.T) { } func TestCollateMergeJoin2(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -577,8 +549,6 @@ func TestCollateMergeJoin2(t *testing.T) { } func TestCollateIndexMergeJoin(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -594,8 +564,6 @@ func TestCollateIndexMergeJoin(t *testing.T) { } func TestNewCollationCheckClusterIndexTable(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -623,8 +591,6 @@ func prepare4Collation(tk *testkit.TestKit, hasIndex bool) { } func TestCollateSelection(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -637,8 +603,6 @@ func TestCollateSelection(t *testing.T) { } func TestCollateSort(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -658,8 +622,6 @@ func TestCollateSort(t *testing.T) { } func TestCollateHashAgg(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -686,8 +648,6 @@ func TestCollateHashAgg(t *testing.T) { } func TestCollateStreamAgg(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -704,8 +664,6 @@ func TestCollateStreamAgg(t *testing.T) { } func TestCollateIndexReader(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -722,8 +680,6 @@ func TestCollateIndexReader(t *testing.T) { } func TestCollateIndexLookup(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -741,8 +697,6 @@ func TestCollateIndexLookup(t *testing.T) { } func TestIssue16668(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -755,8 +709,6 @@ func TestIssue16668(t *testing.T) { } func TestIssue27091(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -774,8 +726,6 @@ func TestIssue27091(t *testing.T) { } func TestCollateStringFunction(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -901,9 +851,6 @@ func TestCollateStringFunction(t *testing.T) { } func TestCollateLike(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -937,8 +884,6 @@ func TestCollateLike(t *testing.T) { } func TestCollateSubQuery(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -955,8 +900,6 @@ func TestCollateSubQuery(t *testing.T) { } func TestCollateDDL(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -967,8 +910,6 @@ func TestCollateDDL(t *testing.T) { } func TestNewCollationWithClusterIndex(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -982,8 +923,6 @@ func TestNewCollationWithClusterIndex(t *testing.T) { } func TestNewCollationBinaryFlag(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -1027,8 +966,6 @@ func TestNewCollationBinaryFlag(t *testing.T) { } func TestIssue17176(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -1044,9 +981,6 @@ func TestIssue17176(t *testing.T) { } func TestIssue18638(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -1060,9 +994,6 @@ func TestIssue18638(t *testing.T) { } func TestCollationText(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -1077,9 +1008,6 @@ func TestCollationText(t *testing.T) { } func TestIssue18662(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -1095,9 +1023,6 @@ func TestIssue18662(t *testing.T) { } func TestIssue19116(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -1122,9 +1047,6 @@ func TestIssue19116(t *testing.T) { } func TestIssue17063(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -1142,9 +1064,6 @@ func TestIssue17063(t *testing.T) { } func TestIssue11177(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -1160,9 +1079,6 @@ func TestIssue11177(t *testing.T) { } func TestIssue19804(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -1182,9 +1098,6 @@ func TestIssue19804(t *testing.T) { } func TestIssue20209(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -1196,9 +1109,6 @@ func TestIssue20209(t *testing.T) { } func TestIssue18949(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -1214,9 +1124,6 @@ func TestIssue18949(t *testing.T) { } func TestClusteredIndexAndNewCollationIndexEncodeDecodeV5(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -1287,9 +1194,6 @@ func TestClusteredIndexAndNewCollationIndexEncodeDecodeV5(t *testing.T) { } func TestClusteredIndexAndNewCollation(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -1321,8 +1225,6 @@ func TestClusteredIndexAndNewCollation(t *testing.T) { } func TestIssue20608(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -1331,9 +1233,6 @@ func TestIssue20608(t *testing.T) { } func TestIssue20161(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -1347,8 +1246,6 @@ func TestIssue20161(t *testing.T) { } func TestCollationIndexJoin(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -1384,8 +1281,6 @@ func TestCollationIndexJoin(t *testing.T) { } func TestCollationMergeJoin(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -1413,8 +1308,6 @@ func TestCollationMergeJoin(t *testing.T) { } func TestIssue20876(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -1439,9 +1332,6 @@ func TestLikeWithCollation(t *testing.T) { defer clean() tk := testkit.NewTestKit(t, store) - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - tk.MustQuery(`select 'a' like 'A' collate utf8mb4_unicode_ci;`).Check(testkit.Rows("1")) tk.MustGetErrMsg(`select 'a' collate utf8mb4_bin like 'A' collate utf8mb4_unicode_ci;`, "[expression:1267]Illegal mix of collations (utf8mb4_bin,EXPLICIT) and (utf8mb4_unicode_ci,EXPLICIT) for operation 'like'") tk.MustQuery(`select '😛' collate utf8mb4_general_ci like '😋';`).Check(testkit.Rows("1")) @@ -1456,9 +1346,6 @@ func TestCollationPrefixClusteredIndex(t *testing.T) { tk := testkit.NewTestKit(t, store) tk.MustExec("use test") - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - tk.MustExec("drop table if exists t") tk.MustExec("create table t (k char(20), v int, primary key (k(4)) clustered, key (k)) collate utf8mb4_general_ci;") tk.MustExec("insert into t values('01233', 1);") @@ -1474,9 +1361,6 @@ func TestIssue23805(t *testing.T) { tk := testkit.NewTestKit(t, store) tk.MustExec("use test") - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - tk.MustExec("CREATE TABLE `tbl_5` (" + " `col_25` time NOT NULL DEFAULT '05:35:58'," + " `col_26` blob NOT NULL," + @@ -1492,8 +1376,6 @@ func TestIssue23805(t *testing.T) { } func TestIssue26662(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -1507,8 +1389,6 @@ func TestIssue26662(t *testing.T) { } func TestIssue30245(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) store, clean := testkit.CreateMockStore(t) defer clean() @@ -1523,8 +1403,6 @@ func TestCollationForBinaryLiteral(t *testing.T) { defer clean() tk := testkit.NewTestKit(t, store) - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk.MustExec("use test") tk.MustExec("drop table if exists t") tk.MustExec("CREATE TABLE t (`COL1` tinyblob NOT NULL, `COL2` binary(1) NOT NULL, `COL3` bigint(11) NOT NULL, PRIMARY KEY (`COL1`(5),`COL2`,`COL3`) /*T![clustered_index] CLUSTERED */)") diff --git a/expression/integration_test.go b/expression/integration_test.go index 58e440c72e20d..f6aff8d9e8096 100644 --- a/expression/integration_test.go +++ b/expression/integration_test.go @@ -46,6 +46,7 @@ import ( "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/types/json" "github.com/pingcap/tidb/util/codec" + "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/kvcache" "github.com/pingcap/tidb/util/sem" "github.com/pingcap/tidb/util/sqlexec" @@ -2776,6 +2777,9 @@ func TestTiDBDecodeKeyFunc(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() + collate.SetNewCollationEnabledForTest(false) + defer collate.SetNewCollationEnabledForTest(true) + tk := testkit.NewTestKit(t, store) var result *testkit.Result diff --git a/planner/core/enforce_mpp_test.go b/planner/core/enforce_mpp_test.go index f9eb265c1313f..4ee16565a9c8a 100644 --- a/planner/core/enforce_mpp_test.go +++ b/planner/core/enforce_mpp_test.go @@ -308,6 +308,7 @@ func (s *testEnforceMPPSuite) TestEnforceMPPWarning3(c *C) { res.Check(testkit.Rows(output[i].Plan...)) c.Assert(s.testData.ConvertSQLWarnToStrings(tk.Se.GetSessionVars().StmtCtx.GetWarnings()), DeepEquals, output[i].Warn) } + collate.SetNewCollationEnabledForTest(true) } // Test enforce mpp warning for joins diff --git a/planner/core/expression_rewriter_test.go b/planner/core/expression_rewriter_test.go index ba8f01cfb7431..b5242d997b0a1 100644 --- a/planner/core/expression_rewriter_test.go +++ b/planner/core/expression_rewriter_test.go @@ -19,7 +19,6 @@ import ( "github.com/pingcap/tidb/parser/mysql" "github.com/pingcap/tidb/parser/terror" "github.com/pingcap/tidb/planner/core" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/testkit" "github.com/pingcap/tidb/util/testleak" "github.com/pingcap/tidb/util/testutil" @@ -448,9 +447,6 @@ func (s *testExpressionRewriterSuite) TestIssue24705(c *C) { } func (s *testExpressionRewriterSuiteSerial) TestBetweenExprCollation(c *C) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - defer testleak.AfterTest(c)() store, dom, err := newStoreWithBootstrap() c.Assert(err, IsNil) diff --git a/planner/core/integration_test.go b/planner/core/integration_test.go index 0a208645cd67f..f16ecbf35b9b4 100644 --- a/planner/core/integration_test.go +++ b/planner/core/integration_test.go @@ -36,7 +36,6 @@ import ( "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/statistics/handle" "github.com/pingcap/tidb/table" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/testkit" "github.com/pingcap/tidb/util/testutil" ) @@ -888,8 +887,6 @@ func (s *testIntegrationSerialSuite) TestJoinNotSupportedByTiFlash(c *C) { } func (s *testIntegrationSerialSuite) TestMPPWithHashExchangeUnderNewCollation(c *C) { - defer collate.SetNewCollationEnabledForTest(false) - collate.SetNewCollationEnabledForTest(true) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("drop table if exists table_1") @@ -938,7 +935,6 @@ func (s *testIntegrationSerialSuite) TestMPPWithHashExchangeUnderNewCollation(c } func (s *testIntegrationSerialSuite) TestMPPWithBroadcastExchangeUnderNewCollation(c *C) { - defer collate.SetNewCollationEnabledForTest(false) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("drop table if exists table_1") @@ -960,7 +956,6 @@ func (s *testIntegrationSerialSuite) TestMPPWithBroadcastExchangeUnderNewCollati } } - collate.SetNewCollationEnabledForTest(true) tk.MustExec("set @@session.tidb_isolation_read_engines = 'tiflash'") tk.MustExec("set @@session.tidb_allow_mpp = 1") var input []string @@ -980,8 +975,6 @@ func (s *testIntegrationSerialSuite) TestMPPWithBroadcastExchangeUnderNewCollati } func (s *testIntegrationSerialSuite) TestPartitionTableDynamicModeUnderNewCollation(c *C) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk := testkit.NewTestKitWithInit(c, s.store) tk.MustExec("create database test_new_collation") tk.MustExec("use test_new_collation") @@ -1020,7 +1013,6 @@ func (s *testIntegrationSerialSuite) TestPartitionTableDynamicModeUnderNewCollat } func (s *testIntegrationSerialSuite) TestMPPAvgRewrite(c *C) { - defer collate.SetNewCollationEnabledForTest(false) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("drop table if exists table_1") @@ -1042,7 +1034,6 @@ func (s *testIntegrationSerialSuite) TestMPPAvgRewrite(c *C) { } } - collate.SetNewCollationEnabledForTest(true) tk.MustExec("set @@session.tidb_isolation_read_engines = 'tiflash'") tk.MustExec("set @@session.tidb_allow_mpp = 1") var input []string @@ -2797,9 +2788,6 @@ func (s *testIntegrationSuite) TestDeleteUsingJoin(c *C) { } func (s *testIntegrationSerialSuite) Test19942(c *C) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.Se.GetSessionVars().EnableClusteredIndex = variable.ClusteredIndexDefModeOn @@ -4203,8 +4191,6 @@ func (s *testIntegrationSuite) TestSequenceAsDataSource(c *C) { } func (s *testIntegrationSerialSuite) TestIssue27167(c *C) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk := testkit.NewTestKit(c, s.store) tk.MustExec("set names utf8mb4") tk.MustExec("use test") @@ -4240,8 +4226,6 @@ func (s *testIntegrationSerialSuite) TestIssue27167(c *C) { } func (s *testIntegrationSerialSuite) TestIssue25300(c *C) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec(`create table t (a char(65) collate utf8_unicode_ci, b text collate utf8_general_ci not null);`) @@ -5172,8 +5156,6 @@ func (s *testIntegrationSuite) TestIssue29705(c *C) { } func (s *testIntegrationSerialSuite) TestIssue30271(c *C) { - defer collate.SetNewCollationEnabledForTest(false) - collate.SetNewCollationEnabledForTest(true) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") tk.MustExec("drop table if exists t") diff --git a/planner/core/logical_plans_test.go b/planner/core/logical_plans_test.go index 69db1e9f8a839..502bf976dbee3 100644 --- a/planner/core/logical_plans_test.go +++ b/planner/core/logical_plans_test.go @@ -26,7 +26,6 @@ import ( "github.com/pingcap/tidb/planner/util" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/testleak" ) @@ -177,7 +176,6 @@ func (s *testUnitTestSuit) TestIndexPathSplitCorColCond(c *C) { remained: "[]", }, } - collate.SetNewCollationEnabledForTest(true) for _, tt := range testCases { comment := Commentf("failed at case:\nexpr: %v\ncorColIDs: %v\nidxColIDs: %v\nidxColLens: %v\naccess: %v\nremained: %v\n", tt.expr, tt.corColIDs, tt.idxColIDs, tt.idxColLens, tt.access, tt.remained) filters, err := expression.ParseSimpleExprsWithNames(s.ctx, tt.expr, totalSchema, names) @@ -206,5 +204,4 @@ func (s *testUnitTestSuit) TestIndexPathSplitCorColCond(c *C) { c.Assert(fmt.Sprintf("%s", access), Equals, tt.access, comment) c.Assert(fmt.Sprintf("%s", remained), Equals, tt.remained, comment) } - collate.SetNewCollationEnabledForTest(false) } diff --git a/planner/core/partition_pruning_test.go b/planner/core/partition_pruning_test.go index 4ba103b01ea96..6b3edd23cc450 100644 --- a/planner/core/partition_pruning_test.go +++ b/planner/core/partition_pruning_test.go @@ -23,7 +23,6 @@ import ( "github.com/pingcap/tidb/parser/model" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/types" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/mock" ) @@ -318,8 +317,6 @@ func (s *testPartitionPruningSuite) TestPartitionRangePrunner2VarChar(c *C) { } func (s *testPartitionPruningSuite) TestPartitionRangePrunner2CharWithCollation(c *C) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tc := prepareTestCtx(c, "create table t (a char(32) collate utf8mb4_unicode_ci)", "a", diff --git a/planner/core/plan_to_pb_test.go b/planner/core/plan_to_pb_test.go index 866f104887fef..e4267024c884f 100644 --- a/planner/core/plan_to_pb_test.go +++ b/planner/core/plan_to_pb_test.go @@ -28,6 +28,7 @@ import ( func TestColumnToProto(t *testing.T) { // Make sure the Flag is set in tipb.ColumnInfo + collate.SetNewCollationEnabledForTest(false) tp := types.NewFieldType(mysql.TypeLong) tp.Flag = 10 tp.Collate = "utf8_bin" @@ -59,7 +60,6 @@ func TestColumnToProto(t *testing.T) { require.Equal(t, int32(8), pc.Collation) collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) pc = util.ColumnToProto(col) expect = &tipb.ColumnInfo{ColumnId: 0, Tp: 3, Collation: -83, ColumnLen: -1, Decimal: -1, Flag: 10, Elems: []string(nil), DefaultVal: []uint8(nil), PkHandle: false, XXX_unrecognized: []uint8(nil)} diff --git a/planner/core/stringer_test.go b/planner/core/stringer_test.go index e4163c7c29c8e..b356dbe4ca3da 100644 --- a/planner/core/stringer_test.go +++ b/planner/core/stringer_test.go @@ -38,7 +38,7 @@ func TestPlanStringer(t *testing.T) { }{ { sql: "show columns from t like 'a'", - plan: "Show(field:[a])", + plan: "Show(field_pattern:[(?i)a])", }, { sql: "show columns from t like 'a%'", diff --git a/planner/core/testdata/integration_serial_suite_out.json b/planner/core/testdata/integration_serial_suite_out.json index 112bb95e43c64..59e1c68a5dee7 100644 --- a/planner/core/testdata/integration_serial_suite_out.json +++ b/planner/core/testdata/integration_serial_suite_out.json @@ -107,7 +107,7 @@ " └─Projection_22 3.00 0.00 batchCop[tiflash] Column#4", " └─HashAgg_8 3.00 77.00 batchCop[tiflash] group by:test.t2.a, funcs:count(1)->Column#4", " └─ExchangeReceiver_21 3.00 68.00 batchCop[tiflash] ", - " └─ExchangeSender_20 3.00 68.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t2.a, collate: N/A]", + " └─ExchangeSender_20 3.00 68.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t2.a, collate: binary]", " └─TableFullScan_19 3.00 65.00 batchCop[tiflash] table:t2 keep order:false" ] }, @@ -804,11 +804,11 @@ " └─ExchangeSender 2.00 cop[tiflash] ExchangeType: PassThrough", " └─HashJoin 2.00 cop[tiflash] left outer join, equal:[eq(test.a.id, test.b.id)]", " ├─ExchangeReceiver(Build) 3.00 cop[tiflash] ", - " │ └─ExchangeSender 3.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: N/A]", + " │ └─ExchangeSender 3.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: binary]", " │ └─Selection 3.00 cop[tiflash] not(isnull(test.b.id))", " │ └─TableFullScan 3.00 cop[tiflash] table:b keep order:false", " └─ExchangeReceiver(Probe) 2.00 cop[tiflash] ", - " └─ExchangeSender 2.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: N/A]", + " └─ExchangeSender 2.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: binary]", " └─TableFullScan 2.00 cop[tiflash] table:a keep order:false" ] }, @@ -820,11 +820,11 @@ " └─ExchangeSender 2.00 cop[tiflash] ExchangeType: PassThrough", " └─HashJoin 2.00 cop[tiflash] right outer join, equal:[eq(test.b.id, test.a.id)]", " ├─ExchangeReceiver(Build) 3.00 cop[tiflash] ", - " │ └─ExchangeSender 3.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: N/A]", + " │ └─ExchangeSender 3.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: binary]", " │ └─Selection 3.00 cop[tiflash] not(isnull(test.b.id))", " │ └─TableFullScan 3.00 cop[tiflash] table:b keep order:false", " └─ExchangeReceiver(Probe) 2.00 cop[tiflash] ", - " └─ExchangeSender 2.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: N/A]", + " └─ExchangeSender 2.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: binary]", " └─TableFullScan 2.00 cop[tiflash] table:a keep order:false" ] } @@ -841,10 +841,10 @@ " └─ExchangeSender 2.00 cop[tiflash] ExchangeType: PassThrough", " └─HashJoin 2.00 cop[tiflash] left outer join, equal:[eq(test.a.id, test.b.id)]", " ├─ExchangeReceiver(Build) 2.00 cop[tiflash] ", - " │ └─ExchangeSender 2.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: N/A]", + " │ └─ExchangeSender 2.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: binary]", " │ └─TableFullScan 2.00 cop[tiflash] table:a keep order:false", " └─ExchangeReceiver(Probe) 3.00 cop[tiflash] ", - " └─ExchangeSender 3.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: N/A]", + " └─ExchangeSender 3.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: binary]", " └─Selection 3.00 cop[tiflash] not(isnull(test.b.id))", " └─TableFullScan 3.00 cop[tiflash] table:b keep order:false" ] @@ -857,10 +857,10 @@ " └─ExchangeSender 2.00 cop[tiflash] ExchangeType: PassThrough", " └─HashJoin 2.00 cop[tiflash] right outer join, equal:[eq(test.b.id, test.a.id)]", " ├─ExchangeReceiver(Build) 2.00 cop[tiflash] ", - " │ └─ExchangeSender 2.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: N/A]", + " │ └─ExchangeSender 2.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.a.id, collate: binary]", " │ └─TableFullScan 2.00 cop[tiflash] table:a keep order:false", " └─ExchangeReceiver(Probe) 3.00 cop[tiflash] ", - " └─ExchangeSender 3.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: N/A]", + " └─ExchangeSender 3.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.b.id, collate: binary]", " └─Selection 3.00 cop[tiflash] not(isnull(test.b.id))", " └─TableFullScan 3.00 cop[tiflash] table:b keep order:false" ] @@ -879,11 +879,11 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#12", " └─HashJoin 32.00 batchCop[tiflash] inner join, equal:[eq(test.d1_t.d1_k, test.fact_t.d1_k)]", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " │ └─Selection 4.00 batchCop[tiflash] not(isnull(test.d1_t.d1_k))", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false", " └─ExchangeReceiver(Probe) 16.00 batchCop[tiflash] ", - " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " └─Selection 16.00 batchCop[tiflash] not(isnull(test.fact_t.d1_k))", " └─TableFullScan 16.00 batchCop[tiflash] table:fact_t keep order:false" ] @@ -897,25 +897,25 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#18", " └─HashJoin 128.00 batchCop[tiflash] inner join, equal:[eq(test.fact_t.d3_k, test.d3_t.d3_k)]", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d3_t.d3_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d3_t.d3_k, collate: binary]", " │ └─Selection 4.00 batchCop[tiflash] not(isnull(test.d3_t.d3_k))", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d3_t keep order:false", " └─ExchangeReceiver(Probe) 64.00 batchCop[tiflash] ", - " └─ExchangeSender 64.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d3_k, collate: N/A]", + " └─ExchangeSender 64.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d3_k, collate: binary]", " └─HashJoin 64.00 batchCop[tiflash] inner join, equal:[eq(test.fact_t.d2_k, test.d2_t.d2_k)]", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d2_t.d2_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d2_t.d2_k, collate: binary]", " │ └─Selection 4.00 batchCop[tiflash] not(isnull(test.d2_t.d2_k))", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d2_t keep order:false", " └─ExchangeReceiver(Probe) 32.00 batchCop[tiflash] ", - " └─ExchangeSender 32.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d2_k, collate: N/A]", + " └─ExchangeSender 32.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d2_k, collate: binary]", " └─HashJoin 32.00 batchCop[tiflash] inner join, equal:[eq(test.d1_t.d1_k, test.fact_t.d1_k)]", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " │ └─Selection 4.00 batchCop[tiflash] not(isnull(test.d1_t.d1_k))", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false", " └─ExchangeReceiver(Probe) 16.00 batchCop[tiflash] ", - " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " └─Selection 16.00 batchCop[tiflash] not(isnull(test.fact_t.d1_k)), not(isnull(test.fact_t.d2_k)), not(isnull(test.fact_t.d3_k))", " └─TableFullScan 16.00 batchCop[tiflash] table:fact_t keep order:false" ] @@ -929,11 +929,11 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#12", " └─HashJoin 32.00 batchCop[tiflash] inner join, equal:[eq(test.d1_t.d1_k, test.fact_t.d1_k)]", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " │ └─Selection 4.00 batchCop[tiflash] not(isnull(test.d1_t.d1_k))", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false", " └─ExchangeReceiver(Probe) 16.00 batchCop[tiflash] ", - " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " └─Selection 16.00 batchCop[tiflash] not(isnull(test.fact_t.d1_k))", " └─TableFullScan 16.00 batchCop[tiflash] table:fact_t keep order:false" ] @@ -947,21 +947,21 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#18", " └─HashJoin 128.00 batchCop[tiflash] inner join, equal:[eq(test.fact_t.d1_k, test.d3_t.value)]", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d3_t.value, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d3_t.value, collate: binary]", " │ └─Selection 4.00 batchCop[tiflash] not(isnull(test.d3_t.value))", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d3_t keep order:false", " └─HashJoin(Probe) 64.00 batchCop[tiflash] inner join, equal:[eq(test.fact_t.d1_k, test.d2_t.value)]", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d2_t.value, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d2_t.value, collate: binary]", " │ └─Selection 4.00 batchCop[tiflash] not(isnull(test.d2_t.value))", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d2_t keep order:false", " └─HashJoin(Probe) 32.00 batchCop[tiflash] inner join, equal:[eq(test.d1_t.d1_k, test.fact_t.d1_k)]", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " │ └─Selection 4.00 batchCop[tiflash] not(isnull(test.d1_t.d1_k))", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false", " └─ExchangeReceiver(Probe) 16.00 batchCop[tiflash] ", - " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " └─Selection 16.00 batchCop[tiflash] not(isnull(test.fact_t.d1_k))", " └─TableFullScan 16.00 batchCop[tiflash] table:fact_t keep order:false" ] @@ -975,11 +975,11 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#12", " └─HashJoin 32.00 batchCop[tiflash] left outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " │ └─Selection 4.00 batchCop[tiflash] not(isnull(test.d1_t.d1_k))", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false", " └─ExchangeReceiver(Probe) 16.00 batchCop[tiflash] ", - " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " └─TableFullScan 16.00 batchCop[tiflash] table:fact_t keep order:false" ] }, @@ -992,10 +992,10 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#12", " └─HashJoin 32.00 batchCop[tiflash] right outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false", " └─ExchangeReceiver(Probe) 16.00 batchCop[tiflash] ", - " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " └─Selection 16.00 batchCop[tiflash] not(isnull(test.fact_t.d1_k))", " └─TableFullScan 16.00 batchCop[tiflash] table:fact_t keep order:false" ] @@ -1009,11 +1009,11 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#12", " └─HashJoin 32.00 batchCop[tiflash] inner join, equal:[eq(test.d1_t.d1_k, test.fact_t.d1_k)], other cond:gt(test.fact_t.col1, test.d1_t.value)", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " │ └─Selection 4.00 batchCop[tiflash] not(isnull(test.d1_t.d1_k)), not(isnull(test.d1_t.value))", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false", " └─ExchangeReceiver(Probe) 16.00 batchCop[tiflash] ", - " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " └─Selection 16.00 batchCop[tiflash] not(isnull(test.fact_t.col1)), not(isnull(test.fact_t.d1_k))", " └─TableFullScan 16.00 batchCop[tiflash] table:fact_t keep order:false" ] @@ -1027,11 +1027,11 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#12", " └─HashJoin 32.00 batchCop[tiflash] left outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], left cond:[gt(test.fact_t.col1, 10)]", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " │ └─Selection 4.00 batchCop[tiflash] not(isnull(test.d1_t.d1_k))", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false", " └─ExchangeReceiver(Probe) 16.00 batchCop[tiflash] ", - " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " └─TableFullScan 16.00 batchCop[tiflash] table:fact_t keep order:false" ] }, @@ -1044,18 +1044,18 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#22", " └─HashJoin 204.80 batchCop[tiflash] inner join, equal:[eq(test.d1_t.d1_k, test.fact_t.d1_k)]", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " │ └─Selection 4.00 batchCop[tiflash] not(isnull(test.d1_t.d1_k))", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false", " └─Projection(Probe) 102.40 batchCop[tiflash] test.fact_t.d1_k", " └─Selection 102.40 batchCop[tiflash] gt(case(isnull(test.fact_t.col1), plus(test.fact_t.col1, 5), 10), 5)", " └─HashJoin 128.00 batchCop[tiflash] right outer join, equal:[eq(test.fact_t.d1_k, test.fact_t.d1_k)]", " ├─ExchangeReceiver(Build) 16.00 batchCop[tiflash] ", - " │ └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " │ └─Selection 16.00 batchCop[tiflash] not(isnull(test.fact_t.d1_k))", " │ └─TableFullScan 16.00 batchCop[tiflash] table:t1 keep order:false", " └─ExchangeReceiver(Probe) 16.00 batchCop[tiflash] ", - " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " └─Selection 16.00 batchCop[tiflash] not(isnull(test.fact_t.d1_k))", " └─TableFullScan 16.00 batchCop[tiflash] table:t2 keep order:false" ] @@ -1069,11 +1069,11 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#12", " └─HashJoin 32.00 batchCop[tiflash] left outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], left cond:[gt(test.fact_t.col2, 10)], other cond:gt(test.fact_t.col1, test.d1_t.value)", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " │ └─Selection 4.00 batchCop[tiflash] not(isnull(test.d1_t.d1_k)), not(isnull(test.d1_t.value))", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false", " └─ExchangeReceiver(Probe) 16.00 batchCop[tiflash] ", - " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " └─TableFullScan 16.00 batchCop[tiflash] table:fact_t keep order:false" ] }, @@ -1086,10 +1086,10 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#12", " └─HashJoin 32.00 batchCop[tiflash] right outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], right cond:gt(test.d1_t.value, 10)", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false", " └─ExchangeReceiver(Probe) 16.00 batchCop[tiflash] ", - " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " └─Selection 16.00 batchCop[tiflash] not(isnull(test.fact_t.d1_k))", " └─TableFullScan 16.00 batchCop[tiflash] table:fact_t keep order:false" ] @@ -1103,11 +1103,11 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#12", " └─HashJoin 32.00 batchCop[tiflash] right outer join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], right cond:gt(test.d1_t.value, 10), other cond:gt(test.fact_t.col1, test.d1_t.value)", " ├─ExchangeReceiver(Build) 16.00 batchCop[tiflash] ", - " │ └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " │ └─Selection 16.00 batchCop[tiflash] not(isnull(test.fact_t.col1)), not(isnull(test.fact_t.d1_k))", " │ └─TableFullScan 16.00 batchCop[tiflash] table:fact_t keep order:false", " └─ExchangeReceiver(Probe) 4.00 batchCop[tiflash] ", - " └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false" ] }, @@ -1120,11 +1120,11 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#13", " └─HashJoin 12.80 batchCop[tiflash] semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " │ └─Selection 4.00 batchCop[tiflash] not(isnull(test.d1_t.d1_k))", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false", " └─ExchangeReceiver(Probe) 16.00 batchCop[tiflash] ", - " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " └─Selection 16.00 batchCop[tiflash] not(isnull(test.fact_t.d1_k))", " └─TableFullScan 16.00 batchCop[tiflash] table:fact_t keep order:false" ] @@ -1138,11 +1138,11 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#13", " └─HashJoin 12.80 batchCop[tiflash] semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], other cond:gt(test.d1_t.value, test.fact_t.col1)", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " │ └─Selection 4.00 batchCop[tiflash] not(isnull(test.d1_t.d1_k)), not(isnull(test.d1_t.value))", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false", " └─ExchangeReceiver(Probe) 16.00 batchCop[tiflash] ", - " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " └─Selection 16.00 batchCop[tiflash] not(isnull(test.fact_t.col1)), not(isnull(test.fact_t.d1_k))", " └─TableFullScan 16.00 batchCop[tiflash] table:fact_t keep order:false" ] @@ -1156,10 +1156,10 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#13", " └─HashJoin 12.80 batchCop[tiflash] anti semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)]", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false", " └─ExchangeReceiver(Probe) 16.00 batchCop[tiflash] ", - " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " └─TableFullScan 16.00 batchCop[tiflash] table:fact_t keep order:false" ] }, @@ -1172,10 +1172,10 @@ " └─HashAgg 1.00 batchCop[tiflash] funcs:count(1)->Column#13", " └─HashJoin 12.80 batchCop[tiflash] anti semi join, equal:[eq(test.fact_t.d1_k, test.d1_t.d1_k)], other cond:gt(test.d1_t.value, test.fact_t.col1)", " ├─ExchangeReceiver(Build) 4.00 batchCop[tiflash] ", - " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: N/A]", + " │ └─ExchangeSender 4.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.d1_t.d1_k, collate: binary]", " │ └─TableFullScan 4.00 batchCop[tiflash] table:d1_t keep order:false", " └─ExchangeReceiver(Probe) 16.00 batchCop[tiflash] ", - " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: N/A]", + " └─ExchangeSender 16.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.fact_t.d1_k, collate: binary]", " └─TableFullScan 16.00 batchCop[tiflash] table:fact_t keep order:false" ] } @@ -1192,17 +1192,17 @@ " └─Projection 1.00 cop[tiflash] Column#13", " └─HashJoin 1.00 cop[tiflash] left outer join, equal:[eq(test.t3.v1, test.t1.v1) eq(test.t3.v2, test.t1.v2)]", " ├─ExchangeReceiver(Build) 1.00 cop[tiflash] ", - " │ └─ExchangeSender 1.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#23, collate: N/A], [name: Column#24, collate: N/A]", + " │ └─ExchangeSender 1.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#23, collate: binary], [name: Column#24, collate: binary]", " │ └─Projection 1.00 cop[tiflash] test.t3.v1, test.t3.v2, cast(test.t3.v1, decimal(20,2))->Column#23, cast(test.t3.v2, decimal(20,2))->Column#24", " │ └─TableFullScan 1.00 cop[tiflash] table:a keep order:false", " └─Projection(Probe) 2.00 cop[tiflash] test.t1.v1, test.t1.v2, plus(test.t1.v1, test.t1.v2)->Column#13", " └─HashJoin 2.00 cop[tiflash] left outer join, equal:[eq(test.t1.v1, test.t2.v1) eq(test.t1.v2, test.t2.v2)]", " ├─ExchangeReceiver(Build) 2.00 cop[tiflash] ", - " │ └─ExchangeSender 2.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t1.v1, collate: N/A], [name: test.t1.v2, collate: N/A]", + " │ └─ExchangeSender 2.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t1.v1, collate: binary], [name: test.t1.v2, collate: binary]", " │ └─Selection 2.00 cop[tiflash] not(isnull(test.t1.v1)), not(isnull(test.t1.v2))", " │ └─TableFullScan 2.00 cop[tiflash] table:t1 keep order:false", " └─ExchangeReceiver(Probe) 8.00 cop[tiflash] ", - " └─ExchangeSender 8.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#15, collate: N/A], [name: Column#16, collate: N/A]", + " └─ExchangeSender 8.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#15, collate: binary], [name: Column#16, collate: binary]", " └─Projection 8.00 cop[tiflash] test.t2.v1, test.t2.v2, cast(test.t2.v1, decimal(20,2))->Column#15, cast(test.t2.v2, decimal(20,2))->Column#16", " └─Selection 8.00 cop[tiflash] not(isnull(test.t2.v1)), not(isnull(test.t2.v2))", " └─TableFullScan 8.00 cop[tiflash] table:t2 keep order:false" @@ -1216,14 +1216,14 @@ " └─Projection 2.00 batchCop[tiflash] Column#9, test.t2.v1, test.t2.v2", " └─HashAgg 2.00 batchCop[tiflash] group by:test.t2.v1, test.t2.v2, funcs:sum(Column#22)->Column#9, funcs:firstrow(test.t2.v1)->test.t2.v1, funcs:firstrow(test.t2.v2)->test.t2.v2", " └─ExchangeReceiver 2.00 batchCop[tiflash] ", - " └─ExchangeSender 2.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t2.v1, collate: N/A], [name: test.t2.v2, collate: N/A]", + " └─ExchangeSender 2.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t2.v1, collate: binary], [name: test.t2.v2, collate: binary]", " └─HashAgg 2.00 batchCop[tiflash] group by:test.t2.v1, test.t2.v2, funcs:count(1)->Column#22", " └─HashJoin 2.00 batchCop[tiflash] left outer join, equal:[eq(test.t1.v1, test.t2.v1) eq(test.t1.v2, test.t2.v2)]", " ├─ExchangeReceiver(Build) 2.00 batchCop[tiflash] ", - " │ └─ExchangeSender 2.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t1.v1, collate: N/A], [name: test.t1.v2, collate: N/A]", + " │ └─ExchangeSender 2.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t1.v1, collate: binary], [name: test.t1.v2, collate: binary]", " │ └─TableFullScan 2.00 batchCop[tiflash] table:t1 keep order:false", " └─ExchangeReceiver(Probe) 8.00 batchCop[tiflash] ", - " └─ExchangeSender 8.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#14, collate: N/A], [name: Column#15, collate: N/A]", + " └─ExchangeSender 8.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#14, collate: binary], [name: Column#15, collate: binary]", " └─Projection 8.00 batchCop[tiflash] test.t2.v1, test.t2.v2, cast(test.t2.v1, decimal(20,2))->Column#14, cast(test.t2.v2, decimal(20,2))->Column#15", " └─Selection 8.00 batchCop[tiflash] not(isnull(test.t2.v1)), not(isnull(test.t2.v2))", " └─TableFullScan 8.00 batchCop[tiflash] table:t2 keep order:false" @@ -1237,14 +1237,14 @@ " └─Projection 1.00 batchCop[tiflash] Column#9, test.t2.v1, test.t2.v2", " └─HashAgg 1.00 batchCop[tiflash] group by:test.t2.v1, test.t2.v2, funcs:sum(Column#16)->Column#9, funcs:firstrow(test.t2.v1)->test.t2.v1, funcs:firstrow(test.t2.v2)->test.t2.v2", " └─ExchangeReceiver 1.00 batchCop[tiflash] ", - " └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t2.v1, collate: N/A], [name: test.t2.v2, collate: N/A]", + " └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t2.v1, collate: binary], [name: test.t2.v2, collate: binary]", " └─HashAgg 1.00 batchCop[tiflash] group by:test.t2.v1, test.t2.v2, funcs:count(1)->Column#16", " └─HashJoin 1.00 batchCop[tiflash] left outer join, equal:[eq(test.t3.v1, test.t2.v1) eq(test.t3.v2, test.t2.v2)]", " ├─ExchangeReceiver(Build) 1.00 batchCop[tiflash] ", - " │ └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t3.v1, collate: N/A], [name: test.t3.v2, collate: N/A]", + " │ └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t3.v1, collate: binary], [name: test.t3.v2, collate: binary]", " │ └─TableFullScan 1.00 batchCop[tiflash] table:t3 keep order:false", " └─ExchangeReceiver(Probe) 8.00 batchCop[tiflash] ", - " └─ExchangeSender 8.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t2.v1, collate: N/A], [name: test.t2.v2, collate: N/A]", + " └─ExchangeSender 8.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t2.v1, collate: binary], [name: test.t2.v2, collate: binary]", " └─Selection 8.00 batchCop[tiflash] not(isnull(test.t2.v1)), not(isnull(test.t2.v2))", " └─TableFullScan 8.00 batchCop[tiflash] table:t2 keep order:false" ] @@ -2141,7 +2141,7 @@ " └─Projection 8000.00 batchCop[tiflash] div(Column#5, cast(case(eq(Column#20, 0), 1, Column#20), decimal(20,0) BINARY))->Column#5, test.t.id", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:sum(Column#21)->Column#20, funcs:sum(Column#22)->Column#5, funcs:firstrow(test.t.id)->test.t.id", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#26, funcs:count(Column#24)->Column#21, funcs:sum(Column#25)->Column#22", " └─Projection 10000.00 batchCop[tiflash] plus(test.t.value, 2)->Column#24, plus(test.t.value, 2)->Column#25, test.t.id", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" @@ -2241,12 +2241,12 @@ " └─ExchangeSender 12500.00 cop[tiflash] ExchangeType: PassThrough", " └─HashJoin 12500.00 cop[tiflash] inner join, equal:[eq(Column#13, Column#14) eq(Column#15, Column#16)]", " ├─ExchangeReceiver(Build) 10000.00 cop[tiflash] ", - " │ └─ExchangeSender 10000.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#21, collate: N/A], [name: Column#15, collate: N/A]", + " │ └─ExchangeSender 10000.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#21, collate: binary], [name: Column#15, collate: binary]", " │ └─Projection 10000.00 cop[tiflash] test.t.c1, test.t.c2, Column#13, Column#15, cast(Column#13, decimal(34,8) BINARY)->Column#21", " │ └─Projection 10000.00 cop[tiflash] test.t.c1, test.t.c2, mul(test.t.c1, 3)->Column#13, plus(test.t.c1, 1)->Column#15", " │ └─TableFullScan 10000.00 cop[tiflash] table:t1 keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 10000.00 cop[tiflash] ", - " └─ExchangeSender 10000.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#22, collate: N/A], [name: Column#16, collate: N/A]", + " └─ExchangeSender 10000.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#22, collate: binary], [name: Column#16, collate: binary]", " └─Projection 10000.00 cop[tiflash] test.t.c1, test.t.c2, test.t.c3, Column#14, Column#16, cast(Column#14, decimal(34,8) BINARY)->Column#22", " └─Projection 10000.00 cop[tiflash] test.t.c1, test.t.c2, test.t.c3, div(test.t.c3, 2)->Column#14, minus(test.t.c2, 10)->Column#16", " └─TableFullScan 10000.00 cop[tiflash] table:t2 keep order:false, stats:pseudo" @@ -2260,22 +2260,22 @@ " └─ExchangeSender 7976.02 batchCop[tiflash] ExchangeType: PassThrough", " └─HashJoin 7976.02 batchCop[tiflash] inner join, equal:[eq(test.t.c1, test.t.c2) eq(test.t.c2, test.t.c3) eq(test.t.c5, test.t.c1)]", " ├─ExchangeReceiver(Build) 7976.02 batchCop[tiflash] ", - " │ └─ExchangeSender 7976.02 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c1, collate: N/A], [name: Column#31, collate: N/A], [name: test.t.c5, collate: N/A]", + " │ └─ExchangeSender 7976.02 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c1, collate: binary], [name: Column#31, collate: binary], [name: test.t.c5, collate: binary]", " │ └─Projection 7976.02 batchCop[tiflash] Column#7, test.t.c1, test.t.c2, test.t.c5, cast(test.t.c2, decimal(10,5))->Column#31", " │ └─Projection 7976.02 batchCop[tiflash] Column#7, test.t.c1, test.t.c2, test.t.c5", " │ └─HashAgg 7976.02 batchCop[tiflash] group by:test.t.c1, test.t.c2, test.t.c5, funcs:sum(Column#15)->Column#7, funcs:firstrow(test.t.c1)->test.t.c1, funcs:firstrow(test.t.c2)->test.t.c2, funcs:firstrow(test.t.c5)->test.t.c5", " │ └─ExchangeReceiver 7976.02 batchCop[tiflash] ", - " │ └─ExchangeSender 7976.02 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c1, collate: N/A], [name: test.t.c2, collate: N/A], [name: test.t.c5, collate: N/A]", + " │ └─ExchangeSender 7976.02 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c1, collate: binary], [name: test.t.c2, collate: binary], [name: test.t.c5, collate: binary]", " │ └─HashAgg 7976.02 batchCop[tiflash] group by:test.t.c1, test.t.c2, test.t.c5, funcs:count(1)->Column#15", " │ └─Selection 9970.03 batchCop[tiflash] not(isnull(test.t.c1)), not(isnull(test.t.c2)), not(isnull(test.t.c5))", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 7984.01 batchCop[tiflash] ", - " └─ExchangeSender 7984.01 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c2, collate: N/A], [name: Column#32, collate: N/A], [name: Column#33, collate: N/A]", + " └─ExchangeSender 7984.01 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c2, collate: binary], [name: Column#32, collate: binary], [name: Column#33, collate: binary]", " └─Projection 7984.01 batchCop[tiflash] Column#14, test.t.c1, test.t.c2, test.t.c3, cast(test.t.c3, decimal(10,5))->Column#32, cast(test.t.c1, decimal(40,20))->Column#33", " └─Projection 7984.01 batchCop[tiflash] Column#14, test.t.c1, test.t.c2, test.t.c3", " └─HashAgg 7984.01 batchCop[tiflash] group by:test.t.c1, test.t.c2, test.t.c3, funcs:sum(Column#23)->Column#14, funcs:firstrow(test.t.c1)->test.t.c1, funcs:firstrow(test.t.c2)->test.t.c2, funcs:firstrow(test.t.c3)->test.t.c3", " └─ExchangeReceiver 7984.01 batchCop[tiflash] ", - " └─ExchangeSender 7984.01 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c2, collate: N/A], [name: test.t.c3, collate: N/A], [name: test.t.c1, collate: N/A]", + " └─ExchangeSender 7984.01 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c2, collate: binary], [name: test.t.c3, collate: binary], [name: test.t.c1, collate: binary]", " └─HashAgg 7984.01 batchCop[tiflash] group by:test.t.c1, test.t.c2, test.t.c3, funcs:count(1)->Column#23", " └─Selection 9980.01 batchCop[tiflash] not(isnull(test.t.c1)), not(isnull(test.t.c2))", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" @@ -2288,11 +2288,11 @@ "└─ExchangeSender 12462.54 cop[tiflash] ExchangeType: PassThrough", " └─HashJoin 12462.54 cop[tiflash] inner join, equal:[eq(test.t.c1, test.t.c2) eq(test.t.c2, test.t.c2) eq(test.t.c3, test.t.c3) eq(test.t.c4, test.t.c4) eq(test.t.c5, test.t.c5)]", " ├─ExchangeReceiver(Build) 9970.03 cop[tiflash] ", - " │ └─ExchangeSender 9970.03 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c1, collate: N/A], [name: test.t.c2, collate: N/A], [name: test.t.c3, collate: N/A], [name: test.t.c4, collate: N/A], [name: test.t.c5, collate: N/A]", + " │ └─ExchangeSender 9970.03 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c1, collate: binary], [name: test.t.c2, collate: binary], [name: test.t.c3, collate: binary], [name: test.t.c4, collate: binary], [name: test.t.c5, collate: binary]", " │ └─Selection 9970.03 cop[tiflash] not(isnull(test.t.c1)), not(isnull(test.t.c2)), not(isnull(test.t.c5))", " │ └─TableFullScan 10000.00 cop[tiflash] table:t1 keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 9980.01 cop[tiflash] ", - " └─ExchangeSender 9980.01 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c2, collate: N/A], [name: test.t.c2, collate: N/A], [name: test.t.c3, collate: N/A], [name: test.t.c4, collate: N/A], [name: test.t.c5, collate: N/A]", + " └─ExchangeSender 9980.01 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c2, collate: binary], [name: test.t.c2, collate: binary], [name: test.t.c3, collate: binary], [name: test.t.c4, collate: binary], [name: test.t.c5, collate: binary]", " └─Selection 9980.01 cop[tiflash] not(isnull(test.t.c2)), not(isnull(test.t.c5))", " └─TableFullScan 10000.00 cop[tiflash] table:t2 keep order:false, stats:pseudo" ] @@ -2305,12 +2305,12 @@ " └─ExchangeSender 12462.54 cop[tiflash] ExchangeType: PassThrough", " └─HashJoin 12462.54 cop[tiflash] inner join, equal:[eq(test.t.c2, test.t.c1) eq(test.t.c3, test.t.c2) eq(test.t.c1, test.t.c3) eq(test.t.c3, test.t.c4) eq(test.t.c5, test.t.c1)]", " ├─ExchangeReceiver(Build) 9970.03 cop[tiflash] ", - " │ └─ExchangeSender 9970.03 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c2, collate: N/A], [name: Column#13, collate: N/A], [name: Column#15, collate: N/A], [name: test.t.c3, collate: N/A], [name: test.t.c5, collate: N/A]", + " │ └─ExchangeSender 9970.03 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c2, collate: binary], [name: Column#13, collate: binary], [name: Column#15, collate: binary], [name: test.t.c3, collate: binary], [name: test.t.c5, collate: binary]", " │ └─Projection 9970.03 cop[tiflash] test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, cast(test.t.c3, decimal(10,5))->Column#13, cast(test.t.c1, decimal(10,5))->Column#15", " │ └─Selection 9970.03 cop[tiflash] not(isnull(test.t.c1)), not(isnull(test.t.c2)), not(isnull(test.t.c5))", " │ └─TableFullScan 10000.00 cop[tiflash] table:t2 keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 9980.01 cop[tiflash] ", - " └─ExchangeSender 9980.01 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c1, collate: N/A], [name: Column#14, collate: N/A], [name: Column#16, collate: N/A], [name: test.t.c4, collate: N/A], [name: Column#17, collate: N/A]", + " └─ExchangeSender 9980.01 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c1, collate: binary], [name: Column#14, collate: binary], [name: Column#16, collate: binary], [name: test.t.c4, collate: binary], [name: Column#17, collate: binary]", " └─Projection 9980.01 cop[tiflash] test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, cast(test.t.c2, decimal(10,5))->Column#14, cast(test.t.c3, decimal(10,5))->Column#16, cast(test.t.c1, decimal(40,20))->Column#17", " └─Selection 9980.01 cop[tiflash] not(isnull(test.t.c1)), not(isnull(test.t.c2))", " └─TableFullScan 10000.00 cop[tiflash] table:t1 keep order:false, stats:pseudo" @@ -2324,12 +2324,12 @@ " └─ExchangeSender 12500.00 cop[tiflash] ExchangeType: PassThrough", " └─HashJoin 12500.00 cop[tiflash] inner join, equal:[eq(Column#13, Column#14)]", " ├─ExchangeReceiver(Build) 10000.00 cop[tiflash] ", - " │ └─ExchangeSender 10000.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#17, collate: N/A]", + " │ └─ExchangeSender 10000.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#17, collate: binary]", " │ └─Projection 10000.00 cop[tiflash] test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, Column#13, cast(Column#13, decimal(17,9) BINARY)->Column#17", " │ └─Projection 10000.00 cop[tiflash] test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, plus(test.t.c1, test.t.c2)->Column#13", " │ └─TableFullScan 10000.00 cop[tiflash] table:t1 keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 10000.00 cop[tiflash] ", - " └─ExchangeSender 10000.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#14, collate: N/A]", + " └─ExchangeSender 10000.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#14, collate: binary]", " └─Projection 10000.00 cop[tiflash] test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, div(test.t.c2, test.t.c3)->Column#14", " └─TableFullScan 10000.00 cop[tiflash] table:t2 keep order:false, stats:pseudo" ] @@ -2342,12 +2342,12 @@ " └─ExchangeSender 7984.01 cop[tiflash] ExchangeType: PassThrough", " └─HashJoin 7984.01 cop[tiflash] semi join, equal:[eq(test.t.c1, test.t.c2) eq(test.t.c2, test.t.c3) eq(test.t.c3, test.t.c1) eq(test.t.c4, test.t.c3) eq(test.t.c1, test.t.c5)]", " ├─ExchangeReceiver(Build) 9970.03 cop[tiflash] ", - " │ └─ExchangeSender 9970.03 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c2, collate: N/A], [name: Column#14, collate: N/A], [name: Column#16, collate: N/A], [name: test.t.c3, collate: N/A], [name: test.t.c5, collate: N/A]", + " │ └─ExchangeSender 9970.03 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c2, collate: binary], [name: Column#14, collate: binary], [name: Column#16, collate: binary], [name: test.t.c3, collate: binary], [name: test.t.c5, collate: binary]", " │ └─Projection 9970.03 cop[tiflash] test.t.c1, test.t.c2, test.t.c3, test.t.c5, cast(test.t.c3, decimal(10,5))->Column#14, cast(test.t.c1, decimal(10,5))->Column#16", " │ └─Selection 9970.03 cop[tiflash] not(isnull(test.t.c1)), not(isnull(test.t.c2)), not(isnull(test.t.c5))", " │ └─TableFullScan 10000.00 cop[tiflash] table:t2 keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 9980.01 cop[tiflash] ", - " └─ExchangeSender 9980.01 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c1, collate: N/A], [name: Column#13, collate: N/A], [name: Column#15, collate: N/A], [name: test.t.c4, collate: N/A], [name: Column#17, collate: N/A]", + " └─ExchangeSender 9980.01 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c1, collate: binary], [name: Column#13, collate: binary], [name: Column#15, collate: binary], [name: test.t.c4, collate: binary], [name: Column#17, collate: binary]", " └─Projection 9980.01 cop[tiflash] test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, cast(test.t.c2, decimal(10,5))->Column#13, cast(test.t.c3, decimal(10,5))->Column#15, cast(test.t.c1, decimal(40,20))->Column#17", " └─Selection 9980.01 cop[tiflash] not(isnull(test.t.c1)), not(isnull(test.t.c2))", " └─TableFullScan 10000.00 cop[tiflash] table:t1 keep order:false, stats:pseudo" @@ -2361,24 +2361,24 @@ " └─ExchangeSender 19492.21 cop[tiflash] ExchangeType: PassThrough", " └─HashJoin 19492.21 cop[tiflash] right outer join, equal:[eq(test.t.c3, test.t.c4)]", " ├─ExchangeReceiver(Build) 10000.00 cop[tiflash] ", - " │ └─ExchangeSender 10000.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#27, collate: N/A]", + " │ └─ExchangeSender 10000.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#27, collate: binary]", " │ └─Projection 10000.00 cop[tiflash] test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, cast(test.t.c4, decimal(40,20))->Column#27", " │ └─TableFullScan 10000.00 cop[tiflash] table:t4 keep order:false, stats:pseudo", " └─Projection(Probe) 15593.77 cop[tiflash] test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5", " └─HashJoin 15593.77 cop[tiflash] inner join, equal:[eq(test.t.c5, test.t.c3)]", " ├─ExchangeReceiver(Build) 10000.00 cop[tiflash] ", - " │ └─ExchangeSender 10000.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#25, collate: N/A]", + " │ └─ExchangeSender 10000.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#25, collate: binary]", " │ └─Projection 10000.00 cop[tiflash] test.t.c1, test.t.c2, test.t.c3, test.t.c4, test.t.c5, cast(test.t.c3, decimal(40,20))->Column#25", " │ └─TableFullScan 10000.00 cop[tiflash] table:t3 keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 12475.01 cop[tiflash] ", - " └─ExchangeSender 12475.01 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c5, collate: N/A]", + " └─ExchangeSender 12475.01 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c5, collate: binary]", " └─HashJoin 12475.01 cop[tiflash] inner join, equal:[eq(test.t.c2, test.t.c1)]", " ├─ExchangeReceiver(Build) 9980.01 cop[tiflash] ", - " │ └─ExchangeSender 9980.01 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c2, collate: N/A]", + " │ └─ExchangeSender 9980.01 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c2, collate: binary]", " │ └─Selection 9980.01 cop[tiflash] not(isnull(test.t.c2)), not(isnull(test.t.c5))", " │ └─TableFullScan 10000.00 cop[tiflash] table:t2 keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 9990.00 cop[tiflash] ", - " └─ExchangeSender 9990.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c1, collate: N/A]", + " └─ExchangeSender 9990.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.c1, collate: binary]", " └─Selection 9990.00 cop[tiflash] not(isnull(test.t.c1))", " └─TableFullScan 10000.00 cop[tiflash] table:t1 keep order:false, stats:pseudo" ] @@ -2391,20 +2391,20 @@ " └─Projection 8000.00 batchCop[tiflash] test.tt.col_varchar_64, test.tt.col_char_64_not_null", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.tt.col_char_64_not_null, test.tt.col_varchar_64, funcs:firstrow(test.tt.col_varchar_64)->test.tt.col_varchar_64, funcs:firstrow(test.tt.col_char_64_not_null)->test.tt.col_char_64_not_null", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.tt.col_varchar_64, collate: N/A], [name: test.tt.col_char_64_not_null, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.tt.col_varchar_64, collate: utf8mb4_bin], [name: test.tt.col_char_64_not_null, collate: utf8mb4_bin]", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.tt.col_char_64_not_null, test.tt.col_varchar_64, ", " └─HashJoin 15609.38 batchCop[tiflash] inner join, equal:[eq(test.tt.col_char_64_not_null, test.tt.col_varchar_64)]", " ├─ExchangeReceiver(Build) 10000.00 batchCop[tiflash] ", - " │ └─ExchangeSender 10000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.tt.col_char_64_not_null, collate: N/A]", + " │ └─ExchangeSender 10000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.tt.col_char_64_not_null, collate: utf8mb4_bin]", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t1 keep order:false, stats:pseudo", " └─HashJoin(Probe) 12487.50 batchCop[tiflash] inner join, equal:[eq(test.tt.col_varchar_key, test.tt.col_varchar_64) eq(Column#19, test.tt.col_decimal_30_10_key)]", " ├─ExchangeReceiver(Build) 9990.00 batchCop[tiflash] ", - " │ └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.tt.col_varchar_key, collate: N/A]", + " │ └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.tt.col_varchar_key, collate: utf8mb4_bin]", " │ └─Projection 9990.00 batchCop[tiflash] test.tt.col_varchar_key, cast(test.tt.col_tinyint, decimal(20,0) BINARY)->Column#19", " │ └─Selection 9990.00 batchCop[tiflash] not(isnull(test.tt.col_varchar_key))", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t2 keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 9990.00 batchCop[tiflash] ", - " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.tt.col_varchar_64, collate: N/A]", + " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.tt.col_varchar_64, collate: utf8mb4_bin]", " └─Selection 9990.00 batchCop[tiflash] not(isnull(test.tt.col_varchar_64))", " └─TableFullScan 10000.00 batchCop[tiflash] table:t3 keep order:false, stats:pseudo" ] @@ -2464,7 +2464,7 @@ " └─Projection 8000.00 batchCop[tiflash] Column#4, test.t.id", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:sum(Column#7)->Column#4, funcs:firstrow(test.t.id)->test.t.id", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:count(1)->Column#7", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] @@ -2478,7 +2478,7 @@ " └─Projection 8000.00 batchCop[tiflash] Column#4, test.t.id", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#10, funcs:sum(Column#11)->Column#4, funcs:firstrow(Column#12)->test.t.id", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#10, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#10, collate: binary]", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#17, funcs:count(1)->Column#11, funcs:firstrow(Column#16)->Column#12", " └─Projection 10000.00 batchCop[tiflash] test.t.id, plus(test.t.id, 1)->Column#17", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" @@ -2493,12 +2493,12 @@ " ├─Projection(Build) 7992.00 batchCop[tiflash] Column#7, test.t.id", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:sum(Column#8)->Column#7, funcs:firstrow(test.t.id)->test.t.id", " │ └─ExchangeReceiver 7992.00 batchCop[tiflash] ", - " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:count(1)->Column#8", " │ └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 9990.00 batchCop[tiflash] ", - " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] @@ -2525,7 +2525,7 @@ " └─Projection 8000.00 batchCop[tiflash] div(Column#4, cast(case(eq(Column#9, 0), 1, Column#9), decimal(20,0) BINARY))->Column#4, test.t.id", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:sum(Column#10)->Column#9, funcs:sum(Column#11)->Column#4, funcs:firstrow(test.t.id)->test.t.id", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:count(test.t.value)->Column#10, funcs:sum(test.t.value)->Column#11", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] @@ -2540,7 +2540,7 @@ " └─Projection 8000.00 batchCop[tiflash] div(Column#4, cast(case(eq(Column#17, 0), 1, Column#17), decimal(20,0) BINARY))->Column#4", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:sum(Column#18)->Column#17, funcs:sum(Column#19)->Column#4", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:count(test.t.value)->Column#18, funcs:sum(test.t.value)->Column#19", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] @@ -2555,7 +2555,7 @@ " └─Projection 8000.00 batchCop[tiflash] div(Column#4, cast(case(eq(Column#10, 0), 1, Column#10), decimal(20,0) BINARY))->Column#4, test.t.id", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:sum(Column#11)->Column#10, funcs:sum(Column#12)->Column#4, funcs:firstrow(test.t.id)->test.t.id", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:count(test.t.value)->Column#11, funcs:sum(test.t.value)->Column#12", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] @@ -2569,7 +2569,7 @@ " └─Projection 8000.00 batchCop[tiflash] div(Column#4, cast(case(eq(Column#11, 0), 1, Column#11), decimal(20,0) BINARY))->Column#4, test.t.id", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:sum(Column#12)->Column#11, funcs:sum(Column#13)->Column#4, funcs:firstrow(test.t.id)->test.t.id", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:count(test.t.value)->Column#12, funcs:sum(test.t.value)->Column#13", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] @@ -2583,7 +2583,7 @@ " └─Projection 8000.00 batchCop[tiflash] div(Column#4, cast(case(eq(Column#11, 0), 1, Column#11), decimal(20,0) BINARY))->Column#4, test.t.id", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:sum(Column#12)->Column#11, funcs:sum(Column#13)->Column#4, funcs:firstrow(test.t.id)->test.t.id", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:count(test.t.value)->Column#12, funcs:sum(test.t.value)->Column#13", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] @@ -2598,11 +2598,11 @@ " └─Projection 12487.50 batchCop[tiflash] cast(test.t.id, decimal(10,0) BINARY)->Column#10, test.t.id", " └─HashJoin 12487.50 batchCop[tiflash] inner join, equal:[eq(test.t.id, test.t.id)]", " ├─ExchangeReceiver(Build) 9990.00 batchCop[tiflash] ", - " │ └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " │ └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " │ └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 9990.00 batchCop[tiflash] ", - " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " └─TableFullScan 10000.00 batchCop[tiflash] table:t1 keep order:false, stats:pseudo" ] @@ -2616,7 +2616,7 @@ " ├─Projection(Build) 7992.00 batchCop[tiflash] test.t.id", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:firstrow(test.t.id)->test.t.id", " │ └─ExchangeReceiver 7992.00 batchCop[tiflash] ", - " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, ", " │ └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo", @@ -2627,12 +2627,12 @@ " ├─Projection(Build) 7992.00 batchCop[tiflash] test.t.id, Column#13", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:firstrow(test.t.id)->test.t.id, funcs:sum(Column#17)->Column#13", " │ └─ExchangeReceiver 7992.00 batchCop[tiflash] ", - " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:count(1)->Column#17", " │ └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 9990.00 batchCop[tiflash] ", - " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] @@ -2645,7 +2645,7 @@ " └─Projection 8000.00 batchCop[tiflash] Column#4, test.t.id", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:count(distinct test.t.value)->Column#4, funcs:firstrow(test.t.id)->test.t.id", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, test.t.value, ", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] @@ -2667,12 +2667,12 @@ " ├─Projection(Build) 7992.00 batchCop[tiflash] Column#7, test.t.id", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:count(distinct test.t.value)->Column#7, funcs:firstrow(test.t.id)->test.t.id", " │ └─ExchangeReceiver 7992.00 batchCop[tiflash] ", - " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, test.t.value, ", " │ └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 9990.00 batchCop[tiflash] ", - " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] @@ -2686,13 +2686,13 @@ " ├─Projection(Build) 7992.00 batchCop[tiflash] Column#7, test.t.id", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:sum(Column#8)->Column#7, funcs:firstrow(test.t.id)->test.t.id", " │ └─ExchangeReceiver 7992.00 batchCop[tiflash] ", - " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:Column#19, funcs:count(Column#18)->Column#8", " │ └─Projection 9990.00 batchCop[tiflash] div(1, test.t.value)->Column#18, test.t.id", " │ └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 9990.00 batchCop[tiflash] ", - " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] @@ -2708,7 +2708,7 @@ " └─Projection 6400.00 batchCop[tiflash] test.t.id, test.t.value", " └─HashAgg 6400.00 batchCop[tiflash] group by:test.t.id, test.t.value, funcs:firstrow(test.t.id)->test.t.id, funcs:firstrow(test.t.value)->test.t.value", " └─ExchangeReceiver 6400.00 batchCop[tiflash] ", - " └─ExchangeSender 6400.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.value, collate: N/A]", + " └─ExchangeSender 6400.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.value, collate: binary]", " └─HashAgg 6400.00 batchCop[tiflash] group by:test.t.id, test.t.value, ", " └─Selection 8000.00 batchCop[tiflash] gt(cast(test.t.id, decimal(20,0) BINARY), test.t.value)", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" @@ -2726,12 +2726,12 @@ " ├─Projection(Build) 7984.01 batchCop[tiflash] Column#7, test.t.id, test.t.value", " │ └─HashAgg 7984.01 batchCop[tiflash] group by:test.t.id, test.t.value, funcs:sum(Column#24)->Column#7, funcs:firstrow(test.t.id)->test.t.id, funcs:firstrow(test.t.value)->test.t.value", " │ └─ExchangeReceiver 7984.01 batchCop[tiflash] ", - " │ └─ExchangeSender 7984.01 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " │ └─ExchangeSender 7984.01 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " │ └─HashAgg 7984.01 batchCop[tiflash] group by:test.t.id, test.t.value, funcs:count(1)->Column#24", " │ └─Selection 9980.01 batchCop[tiflash] not(isnull(test.t.id)), not(isnull(test.t.value))", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 10000.00 batchCop[tiflash] ", - " └─ExchangeSender 10000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 10000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─TableFullScan 10000.00 batchCop[tiflash] table:B keep order:false, stats:pseudo" ] }, @@ -2792,7 +2792,7 @@ " │ └─Projection 7992.00 batchCop[tiflash] Column#7, test.t.id", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:sum(Column#8)->Column#7, funcs:firstrow(test.t.id)->test.t.id", " │ └─ExchangeReceiver 7992.00 batchCop[tiflash] ", - " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:count(1)->Column#8", " │ └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo", @@ -2813,7 +2813,7 @@ " │ └─Projection 8000.00 batchCop[tiflash] Column#7, test.t.id", " │ └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:sum(Column#11)->Column#7, funcs:firstrow(test.t.id)->test.t.id", " │ └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " │ └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " │ └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " │ └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, funcs:count(1)->Column#11", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo", " └─Selection(Probe) 9990.00 batchCop[tiflash] not(isnull(test.t.id))", @@ -2833,7 +2833,7 @@ " │ └─Projection 7992.00 batchCop[tiflash] Column#7, test.t.id, test.t.value", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, test.t.value, funcs:sum(Column#10)->Column#7, funcs:firstrow(test.t.id)->test.t.id, funcs:firstrow(test.t.value)->test.t.value", " │ └─ExchangeReceiver 7992.00 batchCop[tiflash] ", - " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.value, collate: N/A], [name: test.t.id, collate: N/A]", + " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.value, collate: binary], [name: test.t.id, collate: binary]", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, test.t.value, funcs:count(1)->Column#10", " │ └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo", @@ -2863,7 +2863,7 @@ " └─Projection 7992.00 batchCop[tiflash] Column#7", " └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:sum(Column#8)->Column#7", " └─ExchangeReceiver 7992.00 batchCop[tiflash] ", - " └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─HashAgg 7992.00 batchCop[tiflash] group by:Column#11, funcs:sum(Column#10)->Column#8", " └─Projection 12487.50 batchCop[tiflash] cast(test.t.id, decimal(10,0) BINARY)->Column#10, test.t.id", " └─HashJoin 12487.50 batchCop[tiflash] inner join, equal:[eq(test.t.id, test.t.id)]", @@ -2886,14 +2886,14 @@ " │ └─Projection 7992.00 batchCop[tiflash] test.t.id", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:firstrow(test.t.id)->test.t.id", " │ └─ExchangeReceiver 7992.00 batchCop[tiflash] ", - " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, ", " │ └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo", " └─Projection(Probe) 7992.00 batchCop[tiflash] Column#7, test.t.id", " └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:sum(Column#9)->Column#7, funcs:firstrow(test.t.id)->test.t.id", " └─ExchangeReceiver 7992.00 batchCop[tiflash] ", - " └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:sum(test.t.value)->Column#9", " └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" @@ -2910,14 +2910,14 @@ " │ └─Projection 7992.00 batchCop[tiflash] test.t.id", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:firstrow(test.t.id)->test.t.id", " │ └─ExchangeReceiver 7992.00 batchCop[tiflash] ", - " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, ", " │ └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo", " └─Projection(Probe) 7992.00 batchCop[tiflash] Column#11, test.t.id", " └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:sum(Column#17)->Column#11, funcs:firstrow(test.t.id)->test.t.id", " └─ExchangeReceiver 7992.00 batchCop[tiflash] ", - " └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " └─HashAgg 7992.00 batchCop[tiflash] group by:Column#33, funcs:sum(Column#32)->Column#17", " └─Projection 9990.00 batchCop[tiflash] cast(test.t.id, decimal(10,0) BINARY)->Column#32, test.t.id", " └─HashJoin 9990.00 batchCop[tiflash] inner join, equal:[eq(test.t.id, test.t.id)]", @@ -2926,7 +2926,7 @@ " │ └─Projection 7992.00 batchCop[tiflash] test.t.id, Column#13", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:firstrow(test.t.id)->test.t.id, funcs:sum(Column#16)->Column#13", " │ └─ExchangeReceiver 7992.00 batchCop[tiflash] ", - " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:count(1)->Column#16", " │ └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo", @@ -3277,7 +3277,7 @@ " └─Projection 8000.00 batchCop[tiflash] Column#5", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.ts.col_2, funcs:group_concat(Column#9 separator \",\")->Column#5", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: utf8mb4_bin]", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#13, funcs:group_concat(Column#10, Column#11, Column#12 separator \",\")->Column#9", " └─Projection 10000.00 batchCop[tiflash] test.ts.col_0, test.ts.col_1, cast(test.ts.id, var_string(20))->Column#12, test.ts.col_2", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" @@ -3295,7 +3295,7 @@ " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#9, funcs:group_concat(distinct Column#6, Column#7, Column#8 separator \",\")->Column#5", " └─Projection 8000.00 batchCop[tiflash] test.ts.col_0, test.ts.col_1, cast(test.ts.id, var_string(20))->Column#8, test.ts.col_2", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: utf8mb4_bin]", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.ts.col_0, test.ts.col_1, test.ts.col_2, test.ts.id, ", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" ], @@ -3312,7 +3312,7 @@ " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#10, funcs:group_concat(Column#6, Column#7, Column#8 order by Column#9 separator \",\")->Column#5", " └─Projection 10000.00 batchCop[tiflash] test.ts.col_0, test.ts.col_1, cast(test.ts.id, var_string(20))->Column#8, test.ts.col_0, test.ts.col_2", " └─ExchangeReceiver 10000.00 batchCop[tiflash] ", - " └─ExchangeSender 10000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: N/A]", + " └─ExchangeSender 10000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: utf8mb4_bin]", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" ], "Warning": [ @@ -3328,7 +3328,7 @@ " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#10, funcs:group_concat(distinct Column#6, Column#7, Column#8 order by Column#9 separator \",\")->Column#5", " └─Projection 8000.00 batchCop[tiflash] test.ts.col_0, test.ts.col_1, cast(test.ts.id, var_string(20))->Column#8, test.ts.col_0, test.ts.col_2", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: utf8mb4_bin]", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.ts.col_0, test.ts.col_1, test.ts.col_2, test.ts.id, ", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" ], @@ -3345,7 +3345,7 @@ " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#9, funcs:group_concat(Column#6, Column#7 order by Column#8 separator \",\")->Column#5", " └─Projection 10000.00 batchCop[tiflash] test.ts.col_1, cast(test.ts.id, var_string(20))->Column#7, test.ts.col_0, test.ts.col_2", " └─ExchangeReceiver 10000.00 batchCop[tiflash] ", - " └─ExchangeSender 10000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: N/A]", + " └─ExchangeSender 10000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: utf8mb4_bin]", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" ], "Warning": [ @@ -3361,7 +3361,7 @@ " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#9, funcs:group_concat(distinct Column#6, Column#7 order by Column#8 separator \",\")->Column#5", " └─Projection 8000.00 batchCop[tiflash] test.ts.col_1, cast(test.ts.id, var_string(20))->Column#7, test.ts.col_0, test.ts.col_2", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: utf8mb4_bin]", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.ts.col_1, test.ts.col_2, test.ts.id, funcs:firstrow(test.ts.col_0)->test.ts.col_0", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" ], @@ -3378,7 +3378,7 @@ " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#20, funcs:group_concat(Column#13, Column#14, Column#15 order by Column#16 separator \",\")->Column#5, funcs:count(1)->Column#6, funcs:min(Column#17)->Column#7, funcs:count(Column#18)->Column#11, funcs:sum(Column#19)->Column#8", " └─Projection 10000.00 batchCop[tiflash] test.ts.col_0, test.ts.col_1, cast(test.ts.id, var_string(20))->Column#15, test.ts.col_0, test.ts.col_0, test.ts.id, cast(test.ts.id, decimal(14,4) BINARY)->Column#19, test.ts.col_2", " └─ExchangeReceiver 10000.00 batchCop[tiflash] ", - " └─ExchangeSender 10000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: N/A]", + " └─ExchangeSender 10000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: utf8mb4_bin]", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" ], "Warning": [ @@ -3394,7 +3394,7 @@ " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#44, funcs:group_concat(distinct Column#36, Column#37, Column#38 order by Column#39 separator \",\")->Column#5, funcs:sum(Column#40)->Column#6, funcs:max(Column#41)->Column#7, funcs:sum(Column#42)->Column#24, funcs:sum(Column#43)->Column#8", " └─Projection 8000.00 batchCop[tiflash] test.ts.col_0, test.ts.col_1, cast(test.ts.id, var_string(20))->Column#38, test.ts.col_0, Column#25, Column#26, Column#27, Column#28, test.ts.col_2", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: utf8mb4_bin]", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#32, Column#33, Column#34, Column#35, funcs:count(1)->Column#25, funcs:max(Column#29)->Column#26, funcs:count(Column#30)->Column#27, funcs:sum(Column#31)->Column#28", " └─Projection 10000.00 batchCop[tiflash] test.ts.col_1, test.ts.id, cast(test.ts.id, decimal(14,4) BINARY)->Column#31, test.ts.col_2, test.ts.col_0, test.ts.col_1, test.ts.id", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" @@ -3445,7 +3445,7 @@ " └─Projection 8000.00 batchCop[tiflash] Column#5, Column#6, Column#7, div(Column#8, cast(case(eq(Column#27, 0), 1, Column#27), decimal(20,0) BINARY))->Column#8", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.ts.col_2, funcs:group_concat(Column#28 separator \",\")->Column#5, funcs:sum(Column#29)->Column#6, funcs:min(Column#30)->Column#7, funcs:sum(Column#31)->Column#27, funcs:sum(Column#32)->Column#8", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: utf8mb4_bin]", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#40, funcs:group_concat(Column#33, Column#34, Column#35 separator \",\")->Column#28, funcs:count(Column#36)->Column#29, funcs:min(Column#37)->Column#30, funcs:count(Column#38)->Column#31, funcs:sum(Column#39)->Column#32", " └─Projection 10000.00 batchCop[tiflash] test.ts.col_0, test.ts.col_1, cast(test.ts.id, var_string(20))->Column#35, test.ts.id, test.ts.col_0, test.ts.id, cast(test.ts.id, decimal(14,4) BINARY)->Column#39, test.ts.col_2", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" @@ -3463,7 +3463,7 @@ " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#44, funcs:group_concat(distinct Column#37, Column#38, Column#39 separator \",\")->Column#5, funcs:sum(Column#40)->Column#6, funcs:max(Column#41)->Column#7, funcs:sum(Column#42)->Column#24, funcs:sum(Column#43)->Column#8", " └─Projection 8000.00 batchCop[tiflash] test.ts.col_0, test.ts.col_1, cast(test.ts.id, var_string(20))->Column#39, Column#25, Column#26, Column#27, Column#28, test.ts.col_2", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: utf8mb4_bin]", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#33, Column#34, Column#35, Column#36, funcs:count(Column#29)->Column#25, funcs:max(Column#30)->Column#26, funcs:count(Column#31)->Column#27, funcs:sum(Column#32)->Column#28", " └─Projection 10000.00 batchCop[tiflash] test.ts.id, test.ts.col_1, test.ts.id, cast(test.ts.id, decimal(14,4) BINARY)->Column#32, test.ts.col_2, test.ts.col_0, test.ts.col_1, test.ts.id", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" @@ -3513,7 +3513,7 @@ " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#29, funcs:group_concat(Column#21, Column#22, Column#23 separator \",\")->Column#5, funcs:count(Column#24)->Column#6, funcs:group_concat(Column#25 order by Column#26 separator \",\")->Column#7, funcs:count(Column#27)->Column#17, funcs:sum(Column#28)->Column#8", " └─Projection 10000.00 batchCop[tiflash] test.ts.col_0, test.ts.col_1, cast(test.ts.id, var_string(20))->Column#23, test.ts.id, test.ts.col_0, test.ts.col_0, test.ts.id, cast(test.ts.id, decimal(14,4) BINARY)->Column#28, test.ts.col_2", " └─ExchangeReceiver 10000.00 batchCop[tiflash] ", - " └─ExchangeSender 10000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: N/A]", + " └─ExchangeSender 10000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: utf8mb4_bin]", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" ], "Warning": [ @@ -3529,7 +3529,7 @@ " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#25, funcs:group_concat(distinct Column#17 separator \",\")->Column#5, funcs:count(Column#18)->Column#6, funcs:group_concat(Column#19, Column#20 order by Column#21, Column#22 separator \",\")->Column#7, funcs:count(Column#23)->Column#14, funcs:sum(Column#24)->Column#8", " └─Projection 10000.00 batchCop[tiflash] test.ts.col_0, test.ts.id, test.ts.col_1, cast(test.ts.id, var_string(20))->Column#20, test.ts.col_1, test.ts.id, test.ts.id, cast(test.ts.id, decimal(14,4) BINARY)->Column#24, test.ts.col_2", " └─ExchangeReceiver 10000.00 batchCop[tiflash] ", - " └─ExchangeSender 10000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: N/A]", + " └─ExchangeSender 10000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_2, collate: utf8mb4_bin]", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" ], "Warning": [ @@ -3595,7 +3595,7 @@ " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#47, funcs:group_concat(distinct Column#39, Column#40, Column#41 separator \",\")->Column#5, funcs:count(distinct Column#42)->Column#6, funcs:group_concat(Column#43 separator \",\")->Column#7, funcs:max(Column#44)->Column#8, funcs:sum(Column#45)->Column#25, funcs:sum(Column#46)->Column#9", " └─Projection 8000.00 batchCop[tiflash] test.ts.col_0, test.ts.col_1, cast(test.ts.id, var_string(20))->Column#41, test.ts.col_2, Column#26, Column#27, Column#28, Column#29, test.ts.col_0", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_0, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_0, collate: utf8mb4_bin]", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#35, Column#36, Column#37, Column#38, funcs:group_concat(Column#30, Column#31 separator \",\")->Column#26, funcs:max(Column#32)->Column#27, funcs:count(Column#33)->Column#28, funcs:sum(Column#34)->Column#29", " └─Projection 10000.00 batchCop[tiflash] test.ts.col_1, cast(test.ts.id, var_string(20))->Column#31, test.ts.col_1, test.ts.id, cast(test.ts.id, decimal(14,4) BINARY)->Column#34, test.ts.col_0, test.ts.col_1, test.ts.id, test.ts.col_2", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" @@ -3684,7 +3684,7 @@ " └─HashAgg 1.00 batchCop[tiflash] group by:Column#20, funcs:group_concat(distinct Column#18, Column#19 separator \",\")->Column#5", " └─Projection 1.00 batchCop[tiflash] cast(Column#16, var_string(20))->Column#18, cast(Column#17, var_string(20))->Column#19, Column#15", " └─ExchangeReceiver 1.00 batchCop[tiflash] ", - " └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#15, collate: N/A]", + " └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#15, collate: binary]", " └─HashAgg 1.00 batchCop[tiflash] group by:0, 1, 10, ", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" ], @@ -3701,7 +3701,7 @@ " └─HashAgg 1.00 batchCop[tiflash] group by:Column#16, funcs:group_concat(distinct Column#14, Column#15 separator \",\")->Column#5", " └─Projection 1.00 batchCop[tiflash] cast(Column#13, var_string(20))->Column#14, cast(Column#13, var_string(20))->Column#15, Column#12", " └─ExchangeReceiver 1.00 batchCop[tiflash] ", - " └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#12, collate: N/A]", + " └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#12, collate: binary]", " └─HashAgg 1.00 batchCop[tiflash] group by:0, 1, ", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" ], @@ -3718,7 +3718,7 @@ " └─HashAgg 1.00 batchCop[tiflash] group by:Column#20, funcs:group_concat(distinct Column#18, Column#19 separator \",\")->Column#5", " └─Projection 1.00 batchCop[tiflash] cast(Column#16, var_string(20))->Column#18, Column#17, Column#15", " └─ExchangeReceiver 1.00 batchCop[tiflash] ", - " └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#15, collate: N/A]", + " └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#15, collate: binary]", " └─HashAgg 1.00 batchCop[tiflash] group by:\"GG\", 0, 1, ", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" ], @@ -3810,7 +3810,7 @@ " └─Projection 8000.00 batchCop[tiflash] Column#5", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.ts.id, funcs:group_concat(Column#9 separator \",\")->Column#5", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.id, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.id, collate: binary]", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.ts.id, funcs:group_concat(test.ts.col_0, test.ts.col_0 separator \",\")->Column#9", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" ], @@ -3826,7 +3826,7 @@ " └─Projection 8000.00 batchCop[tiflash] Column#5", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.ts.id, funcs:group_concat(Column#9 separator \",\")->Column#5", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.id, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.id, collate: binary]", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#13, funcs:group_concat(Column#10, Column#11, Column#12 separator \",\")->Column#9", " └─Projection 10000.00 batchCop[tiflash] test.ts.col_0, test.ts.col_0, cast(test.ts.id, var_string(20))->Column#12, test.ts.id", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" @@ -3860,7 +3860,7 @@ " └─Projection 8000.00 batchCop[tiflash] Column#5", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.ts.col_1, funcs:group_concat(distinct test.ts.col_0 order by Column#9 separator \",\")->Column#5", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_1, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_1, collate: utf8mb4_bin]", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#11, Column#12, funcs:firstrow(Column#10)->Column#9", " └─Projection 10000.00 batchCop[tiflash] lt(test.ts.id, 10)->Column#10, test.ts.col_1, test.ts.col_0", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" @@ -3878,7 +3878,7 @@ " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#19, funcs:group_concat(distinct Column#17 order by Column#18 separator \",\")->Column#5", " └─Projection 8000.00 batchCop[tiflash] cast(Column#12, var_string(20))->Column#17, Column#13, test.ts.col_1", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_1, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.ts.col_1, collate: utf8mb4_bin]", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#15, Column#16, funcs:firstrow(Column#14)->Column#13", " └─Projection 10000.00 batchCop[tiflash] lt(test.ts.id, 10)->Column#14, test.ts.col_1, gt(cast(test.ts.col_0, double BINARY), 10)->Column#16", " └─TableFullScan 10000.00 batchCop[tiflash] table:ts keep order:false, stats:pseudo" @@ -3920,7 +3920,7 @@ " └─Projection 8000.00 batchCop[tiflash] Column#5, test.t.id", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, test.t.name, funcs:sum(Column#7)->Column#5, funcs:firstrow(test.t.id)->test.t.id", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.name, collate: N/A], [name: test.t.id, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.name, collate: utf8mb4_bin], [name: test.t.id, collate: binary]", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, test.t.name, funcs:count(1)->Column#7", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] @@ -3934,7 +3934,7 @@ " └─Projection 8000.00 batchCop[tiflash] Column#5", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.name, funcs:sum(Column#8)->Column#5", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.name, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.name, collate: utf8mb4_bin]", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.name, funcs:count(1)->Column#8", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] @@ -3950,7 +3950,7 @@ " └─Projection 8000.00 batchCop[tiflash] test.t.id, test.t.name", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, test.t.name, funcs:firstrow(test.t.id)->test.t.id, funcs:firstrow(test.t.name)->test.t.name", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.name, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.name, collate: utf8mb4_bin]", " └─HashAgg 8000.00 batchCop[tiflash] group by:test.t.id, test.t.name, ", " └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo" ] @@ -3968,7 +3968,7 @@ " │ └─Projection 7992.00 batchCop[tiflash] test.t.id", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, funcs:firstrow(test.t.id)->test.t.id", " │ └─ExchangeReceiver 7992.00 batchCop[tiflash] ", - " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: N/A]", + " │ └─ExchangeSender 7992.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.id, collate: binary]", " │ └─HashAgg 7992.00 batchCop[tiflash] group by:test.t.id, ", " │ └─Selection 9990.00 batchCop[tiflash] not(isnull(test.t.id))", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:t keep order:false, stats:pseudo", @@ -4015,7 +4015,7 @@ " │ └─Projection 8000.00 cop[tiflash] Column#5, test.t.id", " │ └─HashAgg 8000.00 cop[tiflash] group by:test.t.id, test.t.name, funcs:sum(Column#19)->Column#5, funcs:firstrow(test.t.id)->test.t.id", " │ └─ExchangeReceiver 8000.00 cop[tiflash] ", - " │ └─ExchangeSender 8000.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.name, collate: N/A], [name: test.t.id, collate: N/A]", + " │ └─ExchangeSender 8000.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.t.name, collate: utf8mb4_bin], [name: test.t.id, collate: binary]", " │ └─HashAgg 8000.00 cop[tiflash] group by:test.t.id, test.t.name, funcs:count(1)->Column#19", " │ └─TableFullScan 10000.00 cop[tiflash] table:t keep order:false, stats:pseudo", " └─Projection 10000.00 cop[tiflash] cast(Column#11, bigint(21) BINARY)->Column#12", diff --git a/planner/core/testdata/plan_suite_out.json b/planner/core/testdata/plan_suite_out.json index 92f425c428531..2cfdc44a79666 100644 --- a/planner/core/testdata/plan_suite_out.json +++ b/planner/core/testdata/plan_suite_out.json @@ -1075,11 +1075,11 @@ }, { "SQL": "select a from t where c_str not like 'abc'", - "Best": "IndexReader(Index(t.c_d_e_str)[[-inf,\"abc\") (\"abc\",+inf]])->Projection" + "Best": "IndexReader(Index(t.c_d_e_str)[[NULL,+inf]]->Sel([not(like(test.t.c_str, abc, 92))]))->Projection" }, { "SQL": "select a from t where not (c_str like 'abc' or c_str like 'abd')", - "Best": "IndexReader(Index(t.c_d_e_str)[[-inf,\"abc\") (\"abc\",\"abd\") (\"abd\",+inf]])->Projection" + "Best": "IndexReader(Index(t.c_d_e_str)[[NULL,+inf]]->Sel([and(not(like(test.t.c_str, abc, 92)), not(like(test.t.c_str, abd, 92)))]))->Projection" }, { "SQL": "select a from t where c_str like '_abc'", @@ -2689,7 +2689,7 @@ " └─Projection 8000.00 batchCop[tiflash] Column#5", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#12, funcs:sum(Column#13)->Column#5", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#12, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#12, collate: binary]", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#14, funcs:count(1)->Column#13", " └─Projection 10000.00 batchCop[tiflash] plus(test.employee.deptid, 1)->Column#14", " └─TableFullScan 10000.00 batchCop[tiflash] table:employee keep order:false, stats:pseudo" @@ -2746,7 +2746,7 @@ " └─Projection 1.00 batchCop[tiflash] Column#7", " └─HashAgg 1.00 batchCop[tiflash] group by:Column#12, funcs:sum(Column#13)->Column#7", " └─ExchangeReceiver 1.00 batchCop[tiflash] ", - " └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#12, collate: N/A]", + " └─ExchangeSender 1.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#12, collate: binary]", " └─HashAgg 1.00 batchCop[tiflash] group by:Column#15, funcs:count(Column#14)->Column#13", " └─Projection 1.00 batchCop[tiflash] Column#5, plus(Column#6, 1)->Column#15", " └─Projection 1.00 batchCop[tiflash] Column#5, Column#6", @@ -2876,7 +2876,7 @@ " │ └─Projection 8000.00 batchCop[tiflash] Column#5, test.employee.deptid", " │ └─HashAgg 8000.00 batchCop[tiflash] group by:Column#13, funcs:sum(Column#14)->Column#5, funcs:firstrow(Column#15)->test.employee.deptid", " │ └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " │ └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#13, collate: N/A]", + " │ └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#13, collate: binary]", " │ └─HashAgg 8000.00 batchCop[tiflash] group by:Column#27, funcs:count(Column#25)->Column#14, funcs:firstrow(Column#26)->Column#15", " │ └─Projection 10000.00 batchCop[tiflash] test.employee.empid, test.employee.deptid, plus(test.employee.deptid, 1)->Column#27", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:employee keep order:false, stats:pseudo", @@ -2897,7 +2897,7 @@ " │ └─Projection 8000.00 batchCop[tiflash] Column#9, test.employee.deptid", " │ └─HashAgg 8000.00 batchCop[tiflash] group by:Column#13, funcs:sum(Column#14)->Column#9, funcs:firstrow(Column#15)->test.employee.deptid", " │ └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " │ └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#13, collate: N/A]", + " │ └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#13, collate: binary]", " │ └─HashAgg 8000.00 batchCop[tiflash] group by:Column#27, funcs:count(Column#25)->Column#14, funcs:firstrow(Column#26)->Column#15", " │ └─Projection 10000.00 batchCop[tiflash] test.employee.empid, test.employee.deptid, plus(test.employee.deptid, 1)->Column#27", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:employee keep order:false, stats:pseudo", @@ -2918,7 +2918,7 @@ " │ └─Projection 8000.00 batchCop[tiflash] Column#5, test.employee.deptid", " │ └─HashAgg 8000.00 batchCop[tiflash] group by:Column#17, funcs:sum(Column#18)->Column#5, funcs:firstrow(Column#19)->test.employee.deptid", " │ └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " │ └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#17, collate: N/A]", + " │ └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#17, collate: binary]", " │ └─HashAgg 8000.00 batchCop[tiflash] group by:Column#43, funcs:count(Column#41)->Column#18, funcs:firstrow(Column#42)->Column#19", " │ └─Projection 10000.00 batchCop[tiflash] test.employee.empid, test.employee.deptid, plus(test.employee.deptid, 1)->Column#43", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:employee keep order:false, stats:pseudo", @@ -2927,7 +2927,7 @@ " └─Projection 8000.00 batchCop[tiflash] Column#11, test.employee.deptid", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#20, funcs:sum(Column#21)->Column#11, funcs:firstrow(Column#22)->test.employee.deptid", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#20, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#20, collate: binary]", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#46, funcs:count(Column#44)->Column#21, funcs:firstrow(Column#45)->Column#22", " └─Projection 10000.00 batchCop[tiflash] test.employee.empid, test.employee.deptid, plus(test.employee.deptid, 1)->Column#46", " └─TableFullScan 10000.00 batchCop[tiflash] table:employee keep order:false, stats:pseudo" @@ -2988,11 +2988,11 @@ "└─ExchangeSender 12487.50 cop[tiflash] ExchangeType: PassThrough", " └─HashJoin 12487.50 cop[tiflash] inner join, equal:[eq(test.employee.deptid, test.employee.deptid)]", " ├─ExchangeReceiver(Build) 9990.00 cop[tiflash] ", - " │ └─ExchangeSender 9990.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.employee.deptid, collate: N/A]", + " │ └─ExchangeSender 9990.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.employee.deptid, collate: binary]", " │ └─Selection 9990.00 cop[tiflash] not(isnull(test.employee.deptid))", " │ └─TableFullScan 10000.00 cop[tiflash] table:e1 keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 9990.00 cop[tiflash] ", - " └─ExchangeSender 9990.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.employee.deptid, collate: N/A]", + " └─ExchangeSender 9990.00 cop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: test.employee.deptid, collate: binary]", " └─Selection 9990.00 cop[tiflash] not(isnull(test.employee.deptid))", " └─TableFullScan 10000.00 cop[tiflash] table:e2 keep order:false, stats:pseudo" ] @@ -3005,18 +3005,18 @@ " └─Projection 8000.00 batchCop[tiflash] Column#6, Column#5, test.employee.empid, test.employee.deptid, test.employee.salary", " └─HashJoin 8000.00 batchCop[tiflash] inner join, equal:[eq(test.employee.deptid, Column#6)]", " ├─ExchangeReceiver(Build) 6400.00 batchCop[tiflash] ", - " │ └─ExchangeSender 6400.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#6, collate: N/A]", + " │ └─ExchangeSender 6400.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#6, collate: binary]", " │ └─Projection 6400.00 batchCop[tiflash] plus(test.employee.deptid, 1)->Column#6, Column#5", " │ └─Selection 6400.00 batchCop[tiflash] not(isnull(plus(test.employee.deptid, 1)))", " │ └─Projection 8000.00 batchCop[tiflash] Column#5, test.employee.deptid", " │ └─HashAgg 8000.00 batchCop[tiflash] group by:Column#13, funcs:sum(Column#14)->Column#5, funcs:firstrow(Column#15)->test.employee.deptid", " │ └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " │ └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#13, collate: N/A]", + " │ └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#13, collate: binary]", " │ └─HashAgg 8000.00 batchCop[tiflash] group by:Column#29, funcs:count(Column#27)->Column#14, funcs:firstrow(Column#28)->Column#15", " │ └─Projection 10000.00 batchCop[tiflash] test.employee.empid, test.employee.deptid, plus(test.employee.deptid, 1)->Column#29", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:employee keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 9990.00 batchCop[tiflash] ", - " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#26, collate: N/A]", + " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#26, collate: binary]", " └─Projection 9990.00 batchCop[tiflash] test.employee.empid, test.employee.deptid, test.employee.salary, cast(test.employee.deptid, bigint(20))->Column#26", " └─Selection 9990.00 batchCop[tiflash] not(isnull(test.employee.deptid))", " └─TableFullScan 10000.00 batchCop[tiflash] table:e2 keep order:false, stats:pseudo" @@ -3030,18 +3030,18 @@ " └─Projection 8000.00 batchCop[tiflash] test.employee.empid, test.employee.deptid, test.employee.salary, Column#10, Column#9", " └─HashJoin 8000.00 batchCop[tiflash] inner join, equal:[eq(test.employee.deptid, Column#10)]", " ├─ExchangeReceiver(Build) 6400.00 batchCop[tiflash] ", - " │ └─ExchangeSender 6400.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#10, collate: N/A]", + " │ └─ExchangeSender 6400.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#10, collate: binary]", " │ └─Projection 6400.00 batchCop[tiflash] plus(test.employee.deptid, 1)->Column#10, Column#9", " │ └─Selection 6400.00 batchCop[tiflash] not(isnull(plus(test.employee.deptid, 1)))", " │ └─Projection 8000.00 batchCop[tiflash] Column#9, test.employee.deptid", " │ └─HashAgg 8000.00 batchCop[tiflash] group by:Column#13, funcs:sum(Column#14)->Column#9, funcs:firstrow(Column#15)->test.employee.deptid", " │ └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " │ └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#13, collate: N/A]", + " │ └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#13, collate: binary]", " │ └─HashAgg 8000.00 batchCop[tiflash] group by:Column#29, funcs:count(Column#27)->Column#14, funcs:firstrow(Column#28)->Column#15", " │ └─Projection 10000.00 batchCop[tiflash] test.employee.empid, test.employee.deptid, plus(test.employee.deptid, 1)->Column#29", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:employee keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 9990.00 batchCop[tiflash] ", - " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#26, collate: N/A]", + " └─ExchangeSender 9990.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#26, collate: binary]", " └─Projection 9990.00 batchCop[tiflash] test.employee.empid, test.employee.deptid, test.employee.salary, cast(test.employee.deptid, bigint(20))->Column#26", " └─Selection 9990.00 batchCop[tiflash] not(isnull(test.employee.deptid))", " └─TableFullScan 10000.00 batchCop[tiflash] table:e1 keep order:false, stats:pseudo" @@ -3054,24 +3054,24 @@ "└─ExchangeSender 6400.00 batchCop[tiflash] ExchangeType: PassThrough", " └─HashJoin 6400.00 batchCop[tiflash] inner join, equal:[eq(Column#6, Column#12)]", " ├─ExchangeReceiver(Build) 6400.00 batchCop[tiflash] ", - " │ └─ExchangeSender 6400.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#6, collate: N/A]", + " │ └─ExchangeSender 6400.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#6, collate: binary]", " │ └─Projection 6400.00 batchCop[tiflash] plus(test.employee.deptid, 1)->Column#6, Column#5", " │ └─Selection 6400.00 batchCop[tiflash] not(isnull(plus(test.employee.deptid, 1)))", " │ └─Projection 8000.00 batchCop[tiflash] Column#5, test.employee.deptid", " │ └─HashAgg 8000.00 batchCop[tiflash] group by:Column#17, funcs:sum(Column#18)->Column#5, funcs:firstrow(Column#19)->test.employee.deptid", " │ └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " │ └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#17, collate: N/A]", + " │ └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#17, collate: binary]", " │ └─HashAgg 8000.00 batchCop[tiflash] group by:Column#43, funcs:count(Column#41)->Column#18, funcs:firstrow(Column#42)->Column#19", " │ └─Projection 10000.00 batchCop[tiflash] test.employee.empid, test.employee.deptid, plus(test.employee.deptid, 1)->Column#43", " │ └─TableFullScan 10000.00 batchCop[tiflash] table:employee keep order:false, stats:pseudo", " └─ExchangeReceiver(Probe) 6400.00 batchCop[tiflash] ", - " └─ExchangeSender 6400.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#12, collate: N/A]", + " └─ExchangeSender 6400.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#12, collate: binary]", " └─Projection 6400.00 batchCop[tiflash] plus(test.employee.deptid, 1)->Column#12, Column#11", " └─Selection 6400.00 batchCop[tiflash] not(isnull(plus(test.employee.deptid, 1)))", " └─Projection 8000.00 batchCop[tiflash] Column#11, test.employee.deptid", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#20, funcs:sum(Column#21)->Column#11, funcs:firstrow(Column#22)->test.employee.deptid", " └─ExchangeReceiver 8000.00 batchCop[tiflash] ", - " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#20, collate: N/A]", + " └─ExchangeSender 8000.00 batchCop[tiflash] ExchangeType: HashPartition, Hash Cols: [name: Column#20, collate: binary]", " └─HashAgg 8000.00 batchCop[tiflash] group by:Column#46, funcs:count(Column#44)->Column#21, funcs:firstrow(Column#45)->Column#22", " └─Projection 10000.00 batchCop[tiflash] test.employee.empid, test.employee.deptid, plus(test.employee.deptid, 1)->Column#46", " └─TableFullScan 10000.00 batchCop[tiflash] table:employee keep order:false, stats:pseudo" diff --git a/server/tidb_serial_test.go b/server/tidb_serial_test.go index e67589c6ac4a9..39907170ade80 100644 --- a/server/tidb_serial_test.go +++ b/server/tidb_serial_test.go @@ -32,7 +32,6 @@ import ( "github.com/pingcap/tidb/sessionctx/variable" "github.com/pingcap/tidb/testkit" "github.com/pingcap/tidb/util" - "github.com/pingcap/tidb/util/collate" "github.com/stretchr/testify/require" ) @@ -354,8 +353,6 @@ func TestDefaultCharacterAndCollation(t *testing.T) { defer cleanup() // issue #21194 - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) // 255 is the collation id of mysql client 8 default collation_connection qctx, err := ts.tidbdrv.OpenCtx(uint64(0), 0, uint8(255), "test", nil) require.NoError(t, err) diff --git a/session/clustered_index_test.go b/session/clustered_index_test.go index 32de5a4348632..9aca5077c30ea 100644 --- a/session/clustered_index_test.go +++ b/session/clustered_index_test.go @@ -676,9 +676,6 @@ func TestPartitionTable(t *testing.T) { // https://github.com/pingcap/tidb/issues/23106 func TestClusteredIndexDecodeRestoredDataV5(t *testing.T) { - defer collate.SetNewCollationEnabledForTest(false) - collate.SetNewCollationEnabledForTest(true) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -702,9 +699,6 @@ func TestClusteredIndexDecodeRestoredDataV5(t *testing.T) { // https://github.com/pingcap/tidb/issues/23178 func TestPrefixedClusteredIndexUniqueKeyWithNewCollation(t *testing.T) { - defer collate.SetNewCollationEnabledForTest(false) - collate.SetNewCollationEnabledForTest(true) - store, clean := testkit.CreateMockStore(t) defer clean() @@ -724,9 +718,6 @@ func TestPrefixedClusteredIndexUniqueKeyWithNewCollation(t *testing.T) { func TestClusteredIndexNewCollationWithOldRowFormat(t *testing.T) { // This case maybe not useful, because newCollation isn't convenience to run on TiKV(it's required serialSuit) // but unistore doesn't support old row format. - defer collate.SetNewCollationEnabledForTest(false) - collate.SetNewCollationEnabledForTest(true) - store, clean := testkit.CreateMockStore(t) defer clean() diff --git a/session/session.go b/session/session.go index caebed1c500c6..fb61709766fca 100644 --- a/session/session.go +++ b/session/session.go @@ -2654,9 +2654,7 @@ func BootstrapSession(store kv.Storage) (*domain.Domain, error) { return nil, err } - if newCollationEnabled { - collate.EnableNewCollations() - } + collate.SetNewCollationEnabledForTest(newCollationEnabled) newMemoryQuotaQuery, err := loadDefMemQuotaQuery(se) if err != nil { diff --git a/session/session_test.go b/session/session_test.go index fe841eac5ba9e..67fa348aa3c3a 100644 --- a/session/session_test.go +++ b/session/session_test.go @@ -63,7 +63,6 @@ import ( "github.com/pingcap/tidb/tablecodec" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/sqlexec" "github.com/pingcap/tidb/util/testkit" "github.com/pingcap/tidb/util/testleak" @@ -4905,8 +4904,6 @@ func (s *testStatisticsSuite) cleanEnv(c *C, store kv.Storage, do *domain.Domain } func (s *testStatisticsSuite) TestNewCollationStatsWithPrefixIndex(c *C) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) defer s.cleanEnv(c, s.store, s.dom) tk := testkit.NewTestKit(c, s.store) tk.MustExec("use test") diff --git a/statistics/handle/handle_test.go b/statistics/handle/handle_test.go index 570a488049b9f..e5c0a97d1def5 100644 --- a/statistics/handle/handle_test.go +++ b/statistics/handle/handle_test.go @@ -2890,8 +2890,6 @@ func TestCorrelationWithDefinedCollate(t *testing.T) { store, clean := testkit.CreateMockStore(t) defer clean() testKit := testkit.NewTestKit(t, store) - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) testKit.MustExec("use test") testKit.MustExec("drop table if exists t") testKit.MustExec("create table t(a int primary key, b varchar(8) character set utf8mb4 collate utf8mb4_general_ci, c varchar(8) character set utf8mb4 collate utf8mb4_bin)") @@ -2924,8 +2922,6 @@ func TestLoadHistogramWithCollate(t *testing.T) { store, dom, clean := testkit.CreateMockStoreAndDomain(t) defer clean() testKit := testkit.NewTestKit(t, store) - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) testKit.MustExec("use test") testKit.MustExec("drop table if exists t") testKit.MustExec("create table t(a varchar(10) collate utf8mb4_unicode_ci);") diff --git a/statistics/selectivity_test.go b/statistics/selectivity_test.go index c96781db61b51..1e6a6786460d0 100644 --- a/statistics/selectivity_test.go +++ b/statistics/selectivity_test.go @@ -49,8 +49,6 @@ func TestCollationColumnEstimate(t *testing.T) { store, dom, clean := testkit.CreateMockStoreAndDomain(t) defer clean() tk := testkit.NewTestKit(t, store) - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tk.MustExec("use test") tk.MustExec("drop table if exists t") tk.MustExec("create table t(a varchar(20) collate utf8mb4_general_ci)") diff --git a/table/tables/index_test.go b/table/tables/index_test.go index ad597008a3e00..43f0dd98f0b73 100644 --- a/table/tables/index_test.go +++ b/table/tables/index_test.go @@ -29,15 +29,12 @@ import ( "github.com/pingcap/tidb/testkit" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/codec" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/mock" "github.com/pingcap/tidb/util/rowcodec" "github.com/stretchr/testify/require" ) func TestMultiColumnCommonHandle(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) tblInfo := buildTableInfo(t, "create table t (a int, b int, u varchar(64) unique, nu varchar(64), primary key (a, b), index nu (nu))") var idxUnique, idxNonUnique table.Index for _, idxInfo := range tblInfo.Indices { diff --git a/types/enum_test.go b/types/enum_test.go index 8c23ba2d4e707..c7a349a10245d 100644 --- a/types/enum_test.go +++ b/types/enum_test.go @@ -18,14 +18,10 @@ import ( "testing" "github.com/pingcap/tidb/parser/mysql" - "github.com/pingcap/tidb/util/collate" "github.com/stretchr/testify/require" ) func TestEnum(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - t.Run("ParseEnum", func(t *testing.T) { tests := []struct { Elems []string diff --git a/types/set_test.go b/types/set_test.go index adfe78767f8f5..fcc4fe5b850ee 100644 --- a/types/set_test.go +++ b/types/set_test.go @@ -18,14 +18,10 @@ import ( "testing" "github.com/pingcap/tidb/parser/mysql" - "github.com/pingcap/tidb/util/collate" "github.com/stretchr/testify/require" ) func TestSet(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) - elems := []string{"a", "b", "c", "d"} t.Run("ParseSet", func(t *testing.T) { diff --git a/util/codec/collation_test.go b/util/codec/collation_test.go index cf64c9ff570be..5c361069c0807 100644 --- a/util/codec/collation_test.go +++ b/util/codec/collation_test.go @@ -25,7 +25,6 @@ import ( "github.com/pingcap/tidb/sessionctx/stmtctx" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/chunk" - "github.com/pingcap/tidb/util/collate" "github.com/stretchr/testify/require" ) @@ -46,8 +45,6 @@ func prepareCollationData() (int, *chunk.Chunk, *chunk.Chunk) { } func TestHashGroupKeyCollation(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) sc := &stmtctx.StatementContext{TimeZone: time.Local} tp := types.NewFieldType(mysql.TypeString) n, chk1, chk2 := prepareCollationData() @@ -85,8 +82,6 @@ func TestHashGroupKeyCollation(t *testing.T) { } func TestHashChunkRowCollation(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) sc := &stmtctx.StatementContext{TimeZone: time.Local} tp := types.NewFieldType(mysql.TypeString) tps := []*types.FieldType{tp} @@ -129,8 +124,6 @@ func TestHashChunkRowCollation(t *testing.T) { } func TestHashChunkColumnsCollation(t *testing.T) { - collate.SetNewCollationEnabledForTest(true) - defer collate.SetNewCollationEnabledForTest(false) sc := &stmtctx.StatementContext{TimeZone: time.Local} tp := types.NewFieldType(mysql.TypeString) n, chk1, chk2 := prepareCollationData() diff --git a/util/collate/collate.go b/util/collate/collate.go index 1b31abcb62ffb..171f7f7cfe491 100644 --- a/util/collate/collate.go +++ b/util/collate/collate.go @@ -78,11 +78,6 @@ type WildcardPattern interface { DoMatch(str string) bool } -// EnableNewCollations enables the new collation. -func EnableNewCollations() { - SetNewCollationEnabledForTest(true) -} - // SetNewCollationEnabledForTest sets if the new collation are enabled in test. // Note: Be careful to use this function, if this functions is used in tests, make sure the tests are serial. func SetNewCollationEnabledForTest(flag bool) { @@ -371,6 +366,9 @@ func ProtoToCollation(c int32) string { } func init() { + // Set it to 1 in init() to make sure the tests enable the new collation, it would be covered in bootstrap(). + newCollationEnabled = 1 + newCollatorMap = make(map[string]Collator) newCollatorIDMap = make(map[int]Collator) diff --git a/util/misc_test.go b/util/misc_test.go index 11b169669816a..5f21efa4a77dc 100644 --- a/util/misc_test.go +++ b/util/misc_test.go @@ -178,8 +178,8 @@ func TestToPB(t *testing.T) { } column2.Collate = "utf8mb4_bin" - assert.Equal(t, "column_id:1 collation:45 columnLen:-1 decimal:-1 ", ColumnToProto(column).String()) - assert.Equal(t, "column_id:1 collation:45 columnLen:-1 decimal:-1 ", ColumnsToProto([]*model.ColumnInfo{column, column2}, false)[0].String()) + assert.Equal(t, "column_id:1 collation:-45 columnLen:-1 decimal:-1 ", ColumnToProto(column).String()) + assert.Equal(t, "column_id:1 collation:-45 columnLen:-1 decimal:-1 ", ColumnsToProto([]*model.ColumnInfo{column, column2}, false)[0].String()) } func TestComposeURL(t *testing.T) { diff --git a/util/ranger/ranger_test.go b/util/ranger/ranger_test.go index 3e9270f268509..176bbd0866768 100644 --- a/util/ranger/ranger_test.go +++ b/util/ranger/ranger_test.go @@ -31,7 +31,6 @@ import ( "github.com/pingcap/tidb/testkit" "github.com/pingcap/tidb/testkit/testdata" "github.com/pingcap/tidb/types" - "github.com/pingcap/tidb/util/collate" "github.com/pingcap/tidb/util/ranger" "github.com/stretchr/testify/require" ) @@ -1741,8 +1740,6 @@ create table t( }, } - collate.SetNewCollationEnabledForTest(true) - defer func() { collate.SetNewCollationEnabledForTest(false) }() ctx := context.Background() for _, tt := range tests { t.Run(tt.exprStr, func(t *testing.T) {