Skip to content
Permalink
Browse files
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
  • Loading branch information
vuvova committed Mar 23, 2018
1 parent e147a4a commit f249d84
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
@@ -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;

0 comments on commit f249d84

Please sign in to comment.