1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-27691: make working view-protocol

Tests with checking metadata or that cannot be run with
the view-protocol are excluded from --view-protocol.
For tests that do not allow the use of an additional connection,
the util connection is disabled with "--disable_service_connection".
Also cases with bugs for --view-protocol are disabled.
This commit is contained in:
Lena Startseva
2022-06-09 10:32:51 +07:00
parent 1dd6255ffe
commit 72ba96a48e
273 changed files with 1867 additions and 158 deletions

View File

@ -24,11 +24,16 @@ SELECT 'a' IN ('a','b',NULL);
SELECT 'a' NOT IN ('a','b');
SELECT 'a' NOT IN ('a','b',NULL);
#enable after fix MDEV-27871
--disable_view_protocol
SELECT TIMESTAMP'2001-01-01 10:20:30' IN ('2001-01-01 10:20:30','2001-02-02 10:20:30');
SELECT TIMESTAMP'2001-01-01 10:20:30' IN ('2001-01-01 10:20:30','2001-02-02 10:20:30',NULL);
SELECT TIMESTAMP'2001-01-01 10:20:30' NOT IN ('2001-01-01 10:20:30','2001-02-02 10:20:30');
SELECT TIMESTAMP'2001-01-01 10:20:30' NOT IN ('2001-01-01 10:20:30','2001-02-02 10:20:30',NULL);
--enable_view_protocol
SELECT TIME'10:20:30' IN ('10:20:30','10:20:30');
SELECT TIME'10:20:30' IN ('10:20:30','10:20:30',NULL);
SELECT TIME'10:20:30' NOT IN ('10:20:30','10:20:30');
@ -81,6 +86,9 @@ SELECT a NOT IN ('a','b','c') FROM t1;
SELECT a NOT IN ('a','b','c',NULL) FROM t1;
DROP TABLE t1;
#enable after fix MDEV-27871
--disable_view_protocol
CREATE TABLE t1 (a DATE);
SELECT a IN ('2001-01-01',DATE'2001-01-02',20010102,20010102.0,20010102e0) FROM t1;
SELECT a IN ('2001-01-01',DATE'2001-01-02',20010102,20010102.0,20010102e0,NULL) FROM t1;
@ -102,6 +110,8 @@ SELECT a NOT IN ('2001-01-01',TIMESTAMP'2001-01-01 10:20:30',DATE'2001-01-01',TI
SELECT a NOT IN ('2001-01-01',TIMESTAMP'2001-01-01 10:20:30',DATE'2001-01-01',TIME'10:20:30',20010101102030,20010101102030.0,20010101102030e0,NULL) FROM t1;
DROP TABLE t1;
--enable_view_protocol
--echo # Constant predicant, compatible types, no bisect
--echo # Bisect is not used because of non-constant expressions in the list
CREATE TABLE t1 (a INT);
@ -146,6 +156,9 @@ SELECT TIME'10:20:30' NOT IN (a,'10:20:30') FROM t1;
SELECT TIME'10:20:30' NOT IN (a,'10:20:30',NULL) FROM t1;
DROP TABLE t1;
#enable after fix MDEV-27871
--disable_view_protocol
CREATE TABLE t1 (a DATETIME);
SELECT TIMESTAMP'2001-01-01 10:20:30' IN (a,TIMESTAMP'2001-01-01 10:20:30') FROM t1;
SELECT TIMESTAMP'2001-01-01 10:20:30' IN (a,TIMESTAMP'2001-01-01 10:20:30',NULL) FROM t1;
@ -153,6 +166,7 @@ SELECT TIMESTAMP'2001-01-01 10:20:30' NOT IN (a,TIMESTAMP'2001-01-01 10:20:30')
SELECT TIMESTAMP'2001-01-01 10:20:30' NOT IN (a,TIMESTAMP'2001-01-01 10:20:30',NULL) FROM t1;
DROP TABLE t1;
--enable_view_protocol
--echo # Constant predicant, incompatible types, no bisect
SELECT 1 IN (1,2e0);
@ -175,6 +189,9 @@ SELECT 'a' IN ('a',2,NULL);
SELECT 'a' NOT IN ('a',2);
SELECT 'a' NOT IN ('a',2,NULL);
#enable after fix MDEV-27871
--disable_view_protocol
SELECT TIME'10:20:30' IN (1,TIME'10:20:30');
SELECT TIME'10:20:30' IN (1,TIME'10:20:30',NULL);
SELECT TIME'10:20:30' IN (102030, TIME'10:20:30',TIMESTAMP'2001-01-01 10:20:32');
@ -203,6 +220,8 @@ SELECT a NOT IN (CAST(1 AS SIGNED), CAST(1 AS UNSIGNED),NULL) FROM t1;
SELECT a NOT IN (CAST(1 AS DECIMAL),CAST(1 AS SIGNED), CAST(1 AS UNSIGNED)) FROM t1;
SELECT a NOT IN (CAST(1 AS DECIMAL),CAST(1 AS SIGNED), CAST(1 AS UNSIGNED),NULL) FROM t1;
--enable_view_protocol
SELECT a IN (1,1.0) FROM t1;
SELECT a IN (1,1.0,NULL) FROM t1;
SELECT a NOT IN (1,1.0) FROM t1;
@ -260,6 +279,9 @@ SELECT a NOT IN ('a',1) FROM t1;
SELECT a NOT IN ('a',TIME'10:20:30') FROM t1;
DROP TABLE t1;
#enable after fix MDEV-27871
--disable_view_protocol
CREATE TABLE t1 (a TIME);
SELECT a IN (102030, TIME'10:20:30',TIMESTAMP'2001-01-01 10:20:32') FROM t1;
SELECT a IN (102030, TIME'10:20:30',TIMESTAMP'2001-01-01 10:20:32',NULL) FROM t1;
@ -271,6 +293,8 @@ SELECT a NOT IN (102030, 102030, TIME'10:20:30',TIMESTAMP'2001-01-01 10:20:32')
SELECT a NOT IN (102030, 102030, TIME'10:20:30',TIMESTAMP'2001-01-01 10:20:32',NULL) FROM t1;
DROP TABLE t1;
--enable_view_protocol
#
# ROW tests
#
@ -413,9 +437,13 @@ DROP TABLE t1;
--echo #
--echo # MDEV-11514 IN with a mixture of TIME and DATETIME returns a wrong result
--echo #
#enable after fix MDEV-27871
--disable_view_protocol
SELECT TIME'10:20:30' IN (102030,TIME'10:20:31',TIMESTAMP'2001-01-01 10:20:32');
--enable_view_protocol
PREPARE stmt FROM "SELECT
TIME'10:20:30' IN (102030,TIME'10:20:31',TIMESTAMP'2001-01-01 10:20:32')";
EXECUTE stmt;