mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
MDEV-15112 Inconsistent evaluation of spvariable=0 in strict mode
The patch for MDEV-15107 fixed this problem. Adding tests only.
This commit is contained in:
parent
b12430adc7
commit
8317ce73d4
2 changed files with 86 additions and 0 deletions
|
@ -8376,3 +8376,42 @@ DECLARE v ROW(a INT);
|
|||
SELECT 'a' IN ('b',v);
|
||||
END $$
|
||||
ERROR HY000: Illegal parameter data types varchar and row for operation 'in'
|
||||
#
|
||||
# MDEV-15112 Inconsistent evaluation of spvariable=0 in strict mode
|
||||
#
|
||||
SET sql_mode=STRICT_ALL_TABLES;
|
||||
CREATE OR REPLACE TABLE t1 (e TIMESTAMP(6));
|
||||
INSERT INTO t1 VALUES ('2001-01-01 10:20:30');
|
||||
CREATE FUNCTION f1(a VARBINARY(255))
|
||||
RETURNS INT
|
||||
DETERMINISTIC
|
||||
BEGIN
|
||||
RETURN a = timestamp'2038-01-19 03:14:07.999999'
|
||||
OR a = 0;
|
||||
END
|
||||
$$
|
||||
CREATE FUNCTION f2(a VARBINARY(255))
|
||||
RETURNS INT
|
||||
DETERMINISTIC
|
||||
BEGIN
|
||||
RETURN a = 0;
|
||||
END
|
||||
$$
|
||||
CREATE OR REPLACE FUNCTION f3(a VARBINARY(255))
|
||||
RETURNS INT
|
||||
DETERMINISTIC
|
||||
BEGIN
|
||||
RETURN a = timestamp'2038-01-19 03:14:07.999999'
|
||||
OR a = sleep(0);
|
||||
END
|
||||
$$
|
||||
SELECT f1(e) FROM t1;
|
||||
ERROR 22007: Truncated incorrect DOUBLE value: '2001-01-01 10:20:30'
|
||||
SELECT f2(e) FROM t1;
|
||||
ERROR 22007: Truncated incorrect DOUBLE value: '2001-01-01 10:20:30'
|
||||
SELECT f3(e) FROM t1;
|
||||
ERROR 22007: Truncated incorrect DOUBLE value: '2001-01-01 10:20:30'
|
||||
DROP FUNCTION f1;
|
||||
DROP FUNCTION f2;
|
||||
DROP FUNCTION f3;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -9885,3 +9885,50 @@ BEGIN NOT ATOMIC
|
|||
SELECT 'a' IN ('b',v);
|
||||
END $$
|
||||
DELIMITER ;$$
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-15112 Inconsistent evaluation of spvariable=0 in strict mode
|
||||
--echo #
|
||||
|
||||
SET sql_mode=STRICT_ALL_TABLES;
|
||||
CREATE OR REPLACE TABLE t1 (e TIMESTAMP(6));
|
||||
INSERT INTO t1 VALUES ('2001-01-01 10:20:30');
|
||||
|
||||
DELIMITER $$;
|
||||
CREATE FUNCTION f1(a VARBINARY(255))
|
||||
RETURNS INT
|
||||
DETERMINISTIC
|
||||
BEGIN
|
||||
RETURN a = timestamp'2038-01-19 03:14:07.999999'
|
||||
OR a = 0;
|
||||
END
|
||||
$$
|
||||
CREATE FUNCTION f2(a VARBINARY(255))
|
||||
RETURNS INT
|
||||
DETERMINISTIC
|
||||
BEGIN
|
||||
RETURN a = 0;
|
||||
END
|
||||
$$
|
||||
CREATE OR REPLACE FUNCTION f3(a VARBINARY(255))
|
||||
RETURNS INT
|
||||
DETERMINISTIC
|
||||
BEGIN
|
||||
RETURN a = timestamp'2038-01-19 03:14:07.999999'
|
||||
OR a = sleep(0);
|
||||
END
|
||||
$$
|
||||
DELIMITER ;$$
|
||||
|
||||
--error ER_TRUNCATED_WRONG_VALUE
|
||||
SELECT f1(e) FROM t1;
|
||||
--error ER_TRUNCATED_WRONG_VALUE
|
||||
SELECT f2(e) FROM t1;
|
||||
--error ER_TRUNCATED_WRONG_VALUE
|
||||
SELECT f3(e) FROM t1;
|
||||
|
||||
DROP FUNCTION f1;
|
||||
DROP FUNCTION f2;
|
||||
DROP FUNCTION f3;
|
||||
DROP TABLE t1;
|
||||
|
|
Loading…
Reference in a new issue