MDEV-35596 Assertion `type_handler()->result_type() ==

value.type_handler()->result_type()' failed in
virtual bool Item_param::get_date(THD*, MYSQL_TIME*, date_mode_t)

Adding mtr tests forgotten in the previous commit.
This commit is contained in:
Alexander Barkov 2025-01-13 17:51:51 +04:00
parent 14f42e12a4
commit 1327f40f96
2 changed files with 69 additions and 0 deletions

View file

@ -245,4 +245,39 @@ NULL
DEALLOCATE PREPARE stmt;
SET timestamp=DEFAULT;
SET time_zone=DEFAULT;
#
# MDEV-35596 Assertion `type_handler()->result_type() == value.type_handler()->result_type()' failed in virtual bool Item_param::get_date(THD*, MYSQL_TIME*, date_mode_t)
#
CREATE TABLE t (c TIMESTAMP);
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
INSERT INTO t (c) VALUES (now());
EXECUTE s USING NULL;
DROP TABLE t;
CREATE TABLE t (c TIMESTAMP);
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
Warnings:
Warning 1292 Truncated incorrect datetime value: '1'
EXECUTE s USING NULL;
DROP TABLE t;
CREATE TABLE t (c TIMESTAMP);
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
Warnings:
Warning 1292 Truncated incorrect datetime value: '1'
EXECUTE s USING DEFAULT;
ERROR HY000: Default/ignore value is not supported for such parameter usage
DROP TABLE t;
CREATE TABLE t (c TIMESTAMP);
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
Warnings:
Warning 1292 Truncated incorrect datetime value: '1'
EXECUTE s USING IGNORE;
ERROR HY000: Default/ignore value is not supported for such parameter usage
DROP TABLE t;
# End of 10.5 tests

View file

@ -254,4 +254,38 @@ DEALLOCATE PREPARE stmt;
SET timestamp=DEFAULT;
SET time_zone=DEFAULT;
--echo #
--echo # MDEV-35596 Assertion `type_handler()->result_type() == value.type_handler()->result_type()' failed in virtual bool Item_param::get_date(THD*, MYSQL_TIME*, date_mode_t)
--echo #
CREATE TABLE t (c TIMESTAMP);
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
INSERT INTO t (c) VALUES (now());
EXECUTE s USING NULL;
DROP TABLE t;
CREATE TABLE t (c TIMESTAMP);
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
EXECUTE s USING NULL;
DROP TABLE t;
CREATE TABLE t (c TIMESTAMP);
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
--error ER_INVALID_DEFAULT_PARAM
EXECUTE s USING DEFAULT;
DROP TABLE t;
CREATE TABLE t (c TIMESTAMP);
INSERT INTO t (c) VALUES ('2001-01-01 10:20:30');
PREPARE s FROM 'DELETE FROM t WHERE c=?';
EXECUTE s USING 1;
--error ER_INVALID_DEFAULT_PARAM
EXECUTE s USING IGNORE;
DROP TABLE t;
--echo # End of 10.5 tests