From 21db64fa76179464955ae28df679f21661bf55ff Mon Sep 17 00:00:00 2001 From: Hangjie Mo Date: Sun, 17 Sep 2023 11:42:10 +0800 Subject: [PATCH] expression, tests: fix ci, add `TestCompareBuiltin` back (#47021) --- expression/integration_test/BUILD.bazel | 2 +- .../integration_test/integration_test.go | 205 ++++++++++++++++++ .../r/expression/builtin.result | Bin 106729 -> 96752 bytes .../integrationtest/t/expression/builtin.test | 111 ---------- 4 files changed, 206 insertions(+), 112 deletions(-) diff --git a/expression/integration_test/BUILD.bazel b/expression/integration_test/BUILD.bazel index 7c8c025321..4604db389d 100644 --- a/expression/integration_test/BUILD.bazel +++ b/expression/integration_test/BUILD.bazel @@ -8,7 +8,7 @@ go_test( "main_test.go", ], flaky = True, - shard_count = 41, + shard_count = 42, deps = [ "//config", "//domain", diff --git a/expression/integration_test/integration_test.go b/expression/integration_test/integration_test.go index 28a3187017..8bcb0eda3f 100644 --- a/expression/integration_test/integration_test.go +++ b/expression/integration_test/integration_test.go @@ -2497,6 +2497,211 @@ func TestCastJSONTimeDuration(t *testing.T) { )) } +func TestCompareBuiltin(t *testing.T) { + store := testkit.CreateMockStore(t) + + tk := testkit.NewTestKit(t, store) + tk.MustExec("use test") + + // compare as JSON + tk.MustExec("drop table if exists t") + tk.MustExec("CREATE TABLE t (pk int NOT NULL PRIMARY KEY AUTO_INCREMENT, i INT, j JSON);") + tk.MustExec(`INSERT INTO t(i, j) VALUES (0, NULL)`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (1, '{"a": 2}')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (2, '[1,2]')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (3, '{"a":"b", "c":"d","ab":"abc", "bc": ["x", "y"]}')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (4, '["here", ["I", "am"], "!!!"]')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (5, '"scalar string"')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (6, 'true')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (7, 'false')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (8, 'null')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (9, '-1')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (10, CAST(CAST(1 AS UNSIGNED) AS JSON))`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (11, '32767')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (12, '32768')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (13, '-32768')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (14, '-32769')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (15, '2147483647')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (16, '2147483648')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (17, '-2147483648')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (18, '-2147483649')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (19, '18446744073709551615')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (20, '18446744073709551616')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (21, '3.14')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (22, '{}')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (23, '[]')`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (24, CAST(CAST('2015-01-15 23:24:25' AS DATETIME) AS JSON))`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (25, CAST(CAST('23:24:25' AS TIME) AS JSON))`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (26, CAST(CAST('2015-01-15' AS DATE) AS JSON))`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (27, CAST(TIMESTAMP('2015-01-15 23:24:25') AS JSON))`) + tk.MustExec(`INSERT INTO t(i, j) VALUES (28, CAST('[]' AS CHAR CHARACTER SET 'ascii'))`) + + result := tk.MustQuery(`SELECT i, + (j = '"scalar string"') AS c1, + (j = 'scalar string') AS c2, + (j = CAST('"scalar string"' AS JSON)) AS c3, + (j = CAST(CAST(j AS CHAR CHARACTER SET 'utf8mb4') AS JSON)) AS c4, + (j = CAST(NULL AS JSON)) AS c5, + (j = NULL) AS c6, + (j <=> NULL) AS c7, + (j <=> CAST(NULL AS JSON)) AS c8, + (j IN (-1, 2, 32768, 3.14)) AS c9, + (j IN (CAST('[1, 2]' AS JSON), CAST('{}' AS JSON), CAST(3.14 AS JSON))) AS c10, + (j = (SELECT j FROM t WHERE j = CAST('null' AS JSON))) AS c11, + (j = (SELECT j FROM t WHERE j IS NULL)) AS c12, + (j = (SELECT j FROM t WHERE 1<>1)) AS c13, + (j = DATE('2015-01-15')) AS c14, + (j = TIME('23:24:25')) AS c15, + (j = TIMESTAMP('2015-01-15 23:24:25')) AS c16, + (j = CURRENT_TIMESTAMP) AS c17, + (JSON_EXTRACT(j, '$.a') = 2) AS c18 + FROM t + ORDER BY i;`) + result.Check(testkit.Rows("0 1 1 ", + "1 0 0 0 1 0 0 0 0 0 0 0 0 0 1", + "2 0 0 0 1 0 0 0 1 0 0 0 0 0 ", + "3 0 0 0 1 0 0 0 0 0 0 0 0 0 0", + "4 0 0 0 1 0 0 0 0 0 0 0 0 0 ", + "5 0 1 1 1 0 0 0 0 0 0 0 0 0 ", + "6 0 0 0 1 0 0 0 0 0 0 0 0 0 ", + "7 0 0 0 1 0 0 0 0 0 0 0 0 0 ", + "8 0 0 0 1 0 0 0 0 1 0 0 0 0 ", + "9 0 0 0 1 0 0 1 0 0 0 0 0 0 ", + "10 0 0 0 1 0 0 0 0 0 0 0 0 0 ", + "11 0 0 0 1 0 0 0 0 0 0 0 0 0 ", + "12 0 0 0 1 0 0 1 0 0 0 0 0 0 ", + "13 0 0 0 1 0 0 0 0 0 0 0 0 0 ", + "14 0 0 0 1 0 0 0 0 0 0 0 0 0 ", + "15 0 0 0 1 0 0 0 0 0 0 0 0 0 ", + "16 0 0 0 1 0 0 0 0 0 0 0 0 0 ", + "17 0 0 0 1 0 0 0 0 0 0 0 0 0 ", + "18 0 0 0 1 0 0 0 0 0 0 0 0 0 ", + "19 0 0 0 1 0 0 0 0 0 0 0 0 0 ", + "20 0 0 0 1 0 0 0 0 0 0 0 0 0 ", + "21 0 0 0 1 0 0 1 1 0 0 0 0 0 ", + "22 0 0 0 1 0 0 0 1 0 0 0 0 0 ", + "23 0 0 0 1 0 0 0 0 0 0 0 0 0 ", + "24 0 0 0 0 0 0 0 0 0 0 0 1 0 ", + "25 0 0 0 0 0 0 0 0 0 0 1 0 0 ", + "26 0 0 0 0 0 0 0 0 0 1 0 0 0 ", + "27 0 0 0 0 0 0 0 0 0 0 0 1 0 ", + "28 0 0 0 1 0 0 0 0 0 0 0 0 0 ")) + + // for coalesce + result = tk.MustQuery("select coalesce(NULL), coalesce(NULL, NULL), coalesce(NULL, NULL, NULL);") + result.Check(testkit.Rows(" ")) + tk.MustQuery(`select coalesce(cast(1 as json), cast(2 as json));`).Check(testkit.Rows(`1`)) + tk.MustQuery(`select coalesce(NULL, cast(2 as json));`).Check(testkit.Rows(`2`)) + tk.MustQuery(`select coalesce(cast(1 as json), NULL);`).Check(testkit.Rows(`1`)) + tk.MustQuery(`select coalesce(NULL, NULL);`).Check(testkit.Rows(``)) + + tk.MustExec("drop table if exists t2") + tk.MustExec("create table t2(a int, b double, c datetime, d time, e char(20), f bit(10))") + tk.MustExec(`insert into t2 values(1, 1.1, "2017-08-01 12:01:01", "12:01:01", "abcdef", 0b10101)`) + + result = tk.MustQuery("select coalesce(NULL, a), coalesce(NULL, b, a), coalesce(c, NULL, a, b), coalesce(d, NULL), coalesce(d, c), coalesce(NULL, NULL, e, 1), coalesce(f), coalesce(1, a, b, c, d, e, f) from t2") + // coalesce(col_bit) is not same with MySQL, because it's a bug of MySQL(https://bugs.mysql.com/bug.php?id=103289&thanks=4) + result.Check(testkit.Rows(fmt.Sprintf("1 1.1 2017-08-01 12:01:01 12:01:01 %s 12:01:01 abcdef \x00\x15 1", time.Now().In(tk.Session().GetSessionVars().Location()).Format(time.DateOnly)))) + + // nullif + result = tk.MustQuery(`SELECT NULLIF(NULL, 1), NULLIF(1, NULL), NULLIF(1, 1), NULLIF(NULL, NULL);`) + result.Check(testkit.Rows(" 1 ")) + + result = tk.MustQuery(`SELECT NULLIF(1, 1.0), NULLIF(1, "1.0");`) + result.Check(testkit.Rows(" ")) + + result = tk.MustQuery(`SELECT NULLIF("abc", 1);`) + result.Check(testkit.Rows("abc")) + + result = tk.MustQuery(`SELECT NULLIF(1+2, 1);`) + result.Check(testkit.Rows("3")) + + result = tk.MustQuery(`SELECT NULLIF(1, 1+2);`) + result.Check(testkit.Rows("1")) + + result = tk.MustQuery(`SELECT NULLIF(2+3, 1+2);`) + result.Check(testkit.Rows("5")) + + result = tk.MustQuery(`SELECT HEX(NULLIF("abc", 1));`) + result.Check(testkit.Rows("616263")) + + tk.MustExec("drop table if exists t;") + tk.MustExec("create table t(a date)") + result = tk.MustQuery("desc select a = a from t") + result.Check(testkit.Rows( + "Projection_3 10000.00 root eq(test.t.a, test.t.a)->Column#3", + "└─TableReader_5 10000.00 root data:TableFullScan_4", + " └─TableFullScan_4 10000.00 cop[tikv] table:t keep order:false, stats:pseudo", + )) + + // for interval + result = tk.MustQuery(`select interval(null, 1, 2), interval(1, 2, 3), interval(2, 1, 3)`) + result.Check(testkit.Rows("-1 0 1")) + result = tk.MustQuery(`select interval(3, 1, 2), interval(0, "b", "1", "2"), interval("a", "b", "1", "2")`) + result.Check(testkit.Rows("2 1 1")) + result = tk.MustQuery(`select interval(23, 1, 23, 23, 23, 30, 44, 200), interval(23, 1.7, 15.3, 23.1, 30, 44, 200), interval(9007199254740992, 9007199254740993)`) + result.Check(testkit.Rows("4 2 0")) + result = tk.MustQuery(`select interval(cast(9223372036854775808 as unsigned), cast(9223372036854775809 as unsigned)), interval(9223372036854775807, cast(9223372036854775808 as unsigned)), interval(-9223372036854775807, cast(9223372036854775808 as unsigned))`) + result.Check(testkit.Rows("0 0 0")) + result = tk.MustQuery(`select interval(cast(9223372036854775806 as unsigned), 9223372036854775807), interval(cast(9223372036854775806 as unsigned), -9223372036854775807), interval("9007199254740991", "9007199254740992")`) + result.Check(testkit.Rows("0 1 0")) + result = tk.MustQuery(`select interval(9007199254740992, "9007199254740993"), interval("9007199254740992", 9007199254740993), interval("9007199254740992", "9007199254740993")`) + result.Check(testkit.Rows("1 1 1")) + result = tk.MustQuery(`select INTERVAL(100, NULL, NULL, NULL, NULL, NULL, 100);`) + result.Check(testkit.Rows("6")) + result = tk.MustQuery(`SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3);`) + result.Check(testkit.Rows("2")) + + // for greatest + result = tk.MustQuery(`select greatest(1, 2, 3), greatest("a", "b", "c"), greatest(1.1, 1.2, 1.3), greatest("123a", 1, 2)`) + result.Check(testkit.Rows("3 c 1.3 2")) + tk.MustQuery("show warnings").Check(testkit.Rows()) + result = tk.MustQuery(`select greatest(cast("2017-01-01" as datetime), "123", "234", cast("2018-01-01" as date)), greatest(cast("2017-01-01" as date), "123", null)`) + result.Check(testkit.Rows("234 ")) + tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1292|Incorrect time value: '123'", "Warning|1292|Incorrect time value: '234'", "Warning|1292|Incorrect time value: '123'")) + // for least + result = tk.MustQuery(`select least(1, 2, 3), least("a", "b", "c"), least(1.1, 1.2, 1.3), least("123a", 1, 2)`) + result.Check(testkit.Rows("1 a 1.1 1")) + tk.MustQuery("show warnings").Check(testkit.Rows()) + result = tk.MustQuery(`select least(cast("2017-01-01" as datetime), "123", "234", cast("2018-01-01" as date)), least(cast("2017-01-01" as date), "123", null)`) + result.Check(testkit.Rows("123 ")) + tk.MustQuery("show warnings").Check(testkit.RowsWithSep("|", "Warning|1292|Incorrect time value: '123'", "Warning|1292|Incorrect time value: '234'", "Warning|1292|Incorrect time value: '123'")) + tk.MustQuery(`select 1 < 17666000000000000000, 1 > 17666000000000000000, 1 = 17666000000000000000`).Check(testkit.Rows("1 0 0")) + + tk.MustExec("drop table if exists t") + + // insert value at utc timezone + tk.MustExec("set time_zone = '+00:00'") + tk.MustExec("create table t(a timestamp)") + tk.MustExec("insert into t value('1991-05-06 04:59:28')") + // check daylight saving time in Asia/Shanghai + tk.MustExec("set time_zone='Asia/Shanghai'") + tk.MustQuery("select * from t").Check(testkit.Rows("1991-05-06 13:59:28")) + // insert an nonexistent time + tk.MustExec("set time_zone = 'America/Los_Angeles'") + tk.MustExecToErr("insert into t value('2011-03-13 02:00:00')") + // reset timezone to a +8 offset + tk.MustExec("set time_zone = '+08:00'") + tk.MustQuery("select * from t").Check(testkit.Rows("1991-05-06 12:59:28")) + + tk.MustExec("drop table if exists t") + tk.MustExec("create table t(a bigint unsigned)") + tk.MustExec("insert into t value(17666000000000000000)") + tk.MustQuery("select * from t where a = 17666000000000000000").Check(testkit.Rows("17666000000000000000")) + + // test for compare row + result = tk.MustQuery(`select row(1,2,3)=row(1,2,3)`) + result.Check(testkit.Rows("1")) + result = tk.MustQuery(`select row(1,2,3)=row(1+3,2,3)`) + result.Check(testkit.Rows("0")) + result = tk.MustQuery(`select row(1,2,3)<>row(1,2,3)`) + result.Check(testkit.Rows("0")) + result = tk.MustQuery(`select row(1,2,3)<>row(1+3,2,3)`) + result.Check(testkit.Rows("1")) + result = tk.MustQuery(`select row(1+3,2,3)<>row(1+3,2,3)`) + result.Check(testkit.Rows("0")) +} + func TestRegexpPushdown(t *testing.T) { store := testkit.CreateMockStore(t) diff --git a/tests/integrationtest/r/expression/builtin.result b/tests/integrationtest/r/expression/builtin.result index a69697cc4d9c3a766fbe6493fb84bd4aca050b54..27aeeed6873d47d1eca1c547160c3f2e57308608 100644 GIT binary patch delta 21 dcmaEPknO`~)`l&Nb&-=3P6}@CXkbiK004O339|qI delta 8819 zcmezHnf2vCwuUW?b&=C2gfR-#7i24B=9MTY`1yw@_=WoTCvXYfjijs~} zVv>@TQesjvNGvH?$x0zwslEclsZ@$3Xt@cLo>`sf7G%uA`uymY7paP@#p6 zf_h$QP7d5aHyp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- (j IN (CAST('[1, 2]' AS JSON), CAST('{}' AS JSON), CAST(3.14 AS JSON))) AS c10, - (j = (SELECT j FROM t WHERE j = CAST('null' AS JSON))) AS c11, - (j = (SELECT j FROM t WHERE j IS NULL)) AS c12, - (j = (SELECT j FROM t WHERE 1<>1)) AS c13, - (j = DATE('2015-01-15')) AS c14, - (j = TIME('23:24:25')) AS c15, - (j = TIMESTAMP('2015-01-15 23:24:25')) AS c16, - (j = CURRENT_TIMESTAMP) AS c17, - (JSON_EXTRACT(j, '$.a') = 2) AS c18 - FROM t - ORDER BY i; -select coalesce(NULL), coalesce(NULL, NULL), coalesce(NULL, NULL, NULL); -select coalesce(cast(1 as json), cast(2 as json)); -select coalesce(NULL, cast(2 as json)); -select coalesce(cast(1 as json), NULL); -select coalesce(NULL, NULL); -drop table if exists t2; -create table t2(a int, b double, c datetime, d time, e char(20), f bit(10)); -insert into t2 values(1, 1.1, "2017-08-01 12:01:01", "12:01:01", "abcdef", 0b10101); -select coalesce(NULL, a), coalesce(NULL, b, a), coalesce(c, NULL, a, b), coalesce(d, NULL), coalesce(d, c), coalesce(NULL, NULL, e, 1), coalesce(f), coalesce(1, a, b, c, d, e, f) from t2; -SELECT NULLIF(NULL, 1), NULLIF(1, NULL), NULLIF(1, 1), NULLIF(NULL, NULL); -SELECT NULLIF(1, 1.0), NULLIF(1, "1.0"); -SELECT NULLIF("abc", 1); -SELECT NULLIF(1+2, 1); -SELECT NULLIF(1, 1+2); -SELECT NULLIF(2+3, 1+2); -SELECT HEX(NULLIF("abc", 1)); -drop table if exists t; -create table t(a date); -desc select a = a from t; -select interval(null, 1, 2), interval(1, 2, 3), interval(2, 1, 3); -select interval(3, 1, 2), interval(0, "b", "1", "2"), interval("a", "b", "1", "2"); -select interval(23, 1, 23, 23, 23, 30, 44, 200), interval(23, 1.7, 15.3, 23.1, 30, 44, 200), interval(9007199254740992, 9007199254740993); -select interval(cast(9223372036854775808 as unsigned), cast(9223372036854775809 as unsigned)), interval(9223372036854775807, cast(9223372036854775808 as unsigned)), interval(-9223372036854775807, cast(9223372036854775808 as unsigned)); -select interval(cast(9223372036854775806 as unsigned), 9223372036854775807), interval(cast(9223372036854775806 as unsigned), -9223372036854775807), interval("9007199254740991", "9007199254740992"); -select interval(9007199254740992, "9007199254740993"), interval("9007199254740992", 9007199254740993), interval("9007199254740992", "9007199254740993"); -select INTERVAL(100, NULL, NULL, NULL, NULL, NULL, 100); -SELECT INTERVAL(0,(1*5)/2) + INTERVAL(5,4,3); -select greatest(1, 2, 3), greatest("a", "b", "c"), greatest(1.1, 1.2, 1.3), greatest("123a", 1, 2); -show warnings; -select greatest(cast("2017-01-01" as datetime), "123", "234", cast("2018-01-01" as date)), greatest(cast("2017-01-01" as date), "123", null); -show warnings; -select least(1, 2, 3), least("a", "b", "c"), least(1.1, 1.2, 1.3), least("123a", 1, 2); -show warnings; -select least(cast("2017-01-01" as datetime), "123", "234", cast("2018-01-01" as date)), least(cast("2017-01-01" as date), "123", null); -show warnings; -select 1 < 17666000000000000000, 1 > 17666000000000000000, 1 = 17666000000000000000; -drop table if exists t; -set time_zone = '+00:00'; -create table t(a timestamp); -insert into t value('1991-05-06 04:59:28'); -set time_zone='Asia/Shanghai'; -select * from t; -set time_zone = 'America/Los_Angeles'; --- error 1292 -insert into t value('2011-03-13 02:00:00'); -set time_zone = '+08:00'; -select * from t; -drop table if exists t; -create table t(a bigint unsigned); -insert into t value(17666000000000000000); -select * from t where a = 17666000000000000000; -select row(1,2,3)=row(1,2,3); -select row(1,2,3)=row(1+3,2,3); -select row(1,2,3)<>row(1,2,3); -select row(1,2,3)<>row(1+3,2,3); -select row(1+3,2,3)<>row(1+3,2,3); -set time_zone=default - # TestNullifWithIsNull # issue 23157: make sure if Nullif expr is correct combined with IsNull expr. drop table if exists t;