From 6c12422a5b60eab46d08851d78d427f4c600dd08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CEricZequan=E2=80=9D?= Date: Wed, 4 Sep 2024 18:18:05 +0800 Subject: [PATCH] fix ci MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: “EricZequan” --- pkg/expression/explain.go | 11 ++--------- tests/integrationtest/t/infoschema/infoschema.test | 2 +- .../t/planner/core/casetest/index/index.test | 2 +- .../t/planner/core/tests/prepare/issue.test | 2 +- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/pkg/expression/explain.go b/pkg/expression/explain.go index 250801ece4b44..eb3cea34038fa 100644 --- a/pkg/expression/explain.go +++ b/pkg/expression/explain.go @@ -141,18 +141,11 @@ func (expr *Constant) ExplainInfo(ctx EvalContext) string { if redact == errors.RedactLogEnable { return "?" } - dt, err := expr.Eval(ctx, chunk.Row{}) + _, err := expr.Eval(ctx, chunk.Row{}) if err != nil { return "not recognized const value" } - if redact == errors.RedactLogMarker { - builder := new(strings.Builder) - builder.WriteString("‹") - builder.WriteString(dt.StringTruncate()) - builder.WriteString("›") - return builder.String() - } - return dt.StringTruncate() + return expr.StringWithCtx(ctx, redact) } // ExplainNormalizedInfo implements the Expression interface. diff --git a/tests/integrationtest/t/infoschema/infoschema.test b/tests/integrationtest/t/infoschema/infoschema.test index fe8d1cd50a099..345b56512a6e4 100644 --- a/tests/integrationtest/t/infoschema/infoschema.test +++ b/tests/integrationtest/t/infoschema/infoschema.test @@ -244,4 +244,4 @@ select sequence_schema, sequence_name from information_schema.sequences where se select sequence_schema, sequence_name from information_schema.sequences where sequence_schema = 'db1' and sequence_name = 's2'; select sequence_schema, sequence_name from information_schema.sequences; drop database db1; -drop database db2; +drop database db2; \ No newline at end of file diff --git a/tests/integrationtest/t/planner/core/casetest/index/index.test b/tests/integrationtest/t/planner/core/casetest/index/index.test index 81bad2f3d6f9e..b5ead757b6228 100644 --- a/tests/integrationtest/t/planner/core/casetest/index/index.test +++ b/tests/integrationtest/t/planner/core/casetest/index/index.test @@ -294,4 +294,4 @@ EXPLAIN format='brief' SELECT /*+ use_index_merge(t, fpi, nslc_old, nslc) */ * F drop table if exists t; CREATE TABLE t (nslc json DEFAULT NULL,fpi json DEFAULT NULL,point_of_sale_country int,KEY nslc ((cast(nslc as char(1000) array)),point_of_sale_country),KEY fpi ((cast(fpi as unsigned array)))); explain format='brief' SELECT /*+ use_index_merge(t, nslc) */ * FROM t WHERE 57260686 member of (fpi) AND "OC8p1763XTkt.org/s/link" member of (nslc) LIMIT 1; -explain format='brief' SELECT /*+ use_index_merge(t, fpi) */ * FROM t WHERE 57260686 member of (fpi) AND "OC8p1763XTkt.org/s/link" member of (nslc) LIMIT 1; +explain format='brief' SELECT /*+ use_index_merge(t, fpi) */ * FROM t WHERE 57260686 member of (fpi) AND "OC8p1763XTkt.org/s/link" member of (nslc) LIMIT 1; \ No newline at end of file diff --git a/tests/integrationtest/t/planner/core/tests/prepare/issue.test b/tests/integrationtest/t/planner/core/tests/prepare/issue.test index 566ab528030cb..50a7448d34eb1 100644 --- a/tests/integrationtest/t/planner/core/tests/prepare/issue.test +++ b/tests/integrationtest/t/planner/core/tests/prepare/issue.test @@ -2,7 +2,7 @@ set tidb_enable_prepared_plan_cache=1; drop table if exists UK_MU15569; CREATE TABLE `UK_MU15569` (`COL1` varbinary(20) DEFAULT NULL,`COL2` bit(16) DEFAULT NULL,`COL3` time DEFAULT NULL,`COL4` int(11) DEFAULT NULL,UNIQUE KEY `U_M_COL4` (`COL1`(10),`COL2`),UNIQUE KEY `U_M_COL5` (`COL3`,`COL2`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; -insert into UK_MU15569 values(BINARY 'ABCDEFG', 0xCA74, '-836:46:08', 735655453); +insert into UK_MU15569 values(0x1C4FDBA09B42D999AC3019B6A9C0C787FBA08446, 0xCA74, '-836:46:08', 735655453); prepare stmt from 'select * from UK_MU15569 where col2 >= ? and col1 is not null and col3 = ?;'; set @a=-32373, @b='545:50:46.85487'; execute stmt using @a,@b;