Commit f249d846 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-15570 Assertion `Item_cache_temporal::field_type() != MYSQL_TYPE_TIME'...

MDEV-15570 Assertion `Item_cache_temporal::field_type() != MYSQL_TYPE_TIME' failed in Item_cache_temporal::val_datetime_packed

remove an assert. TIME value can be used (and cached) in a datetime context
parent e147a4a0
......@@ -154,3 +154,9 @@ SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
Warnings:
Warning 1292 Incorrect datetime value: ''
DROP TABLE t1;
CREATE TABLE t1 (d DATE) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('2012-12-21');
SELECT * FROM t1 WHERE LEAST( UTC_TIME(), d );
d
2012-12-21
DROP TABLE t1;
......@@ -58,3 +58,11 @@ SELECT * FROM t1 IGNORE KEY (b) WHERE b='';
SELECT * FROM t1 WHERE a=b;
SELECT 1 FROM t1 WHERE (SELECT a FROM t1 group by c) = b;
DROP TABLE t1;
#
# MDEV-15570 Assertion `Item_cache_temporal::field_type() != MYSQL_TYPE_TIME' failed in Item_cache_temporal::val_datetime_packed
#
CREATE TABLE t1 (d DATE) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('2012-12-21');
SELECT * FROM t1 WHERE LEAST( UTC_TIME(), d );
DROP TABLE t1;
......@@ -9707,7 +9707,6 @@ Item_cache_temporal::Item_cache_temporal(THD *thd,
longlong Item_cache_temporal::val_datetime_packed()
{
DBUG_ASSERT(fixed == 1);
DBUG_ASSERT(Item_cache_temporal::field_type() != MYSQL_TYPE_TIME);
if ((!value_cached && !cache_value()) || null_value)
{
null_value= TRUE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment