1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-10 23:02:54 +03:00

MDEV-18145 Assertion `0' failed in Item::val_native upon SELECT subquery with timestamp

This commit is contained in:
Alexander Barkov
2019-01-14 15:23:10 +04:00
parent ac9b818c24
commit d97a26a67d
3 changed files with 25 additions and 2 deletions

View File

@@ -1152,5 +1152,17 @@ f
NULL
DROP TABLE t1;
#
# MDEV-18145 Assertion `0' failed in Item::val_native upon SELECT subquery with timestamp
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
CREATE TABLE t2 (pk INT PRIMARY KEY) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1),(2);
CREATE TABLE t3 (pk INT PRIMARY KEY, b TIMESTAMP) ENGINE=MyISAM;
SELECT ( SELECT b FROM t1 LIMIT 1 ) AS sq FROM t2 LEFT JOIN t3 USING (pk);
sq
NULL
NULL
DROP TABLE t1, t2, t3;
#
# End of 10.4 tests
#

View File

@@ -749,6 +749,17 @@ INSERT INTO t1 () VALUES (),();
SELECT IF(0,t,NULL) AS f FROM t1 GROUP BY 'foo';
DROP TABLE t1;
--echo #
--echo # MDEV-18145 Assertion `0' failed in Item::val_native upon SELECT subquery with timestamp
--echo #
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
CREATE TABLE t2 (pk INT PRIMARY KEY) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1),(2);
CREATE TABLE t3 (pk INT PRIMARY KEY, b TIMESTAMP) ENGINE=MyISAM;
SELECT ( SELECT b FROM t1 LIMIT 1 ) AS sq FROM t2 LEFT JOIN t3 USING (pk);
DROP TABLE t1, t2, t3;
--echo #
--echo # End of 10.4 tests

View File

@@ -1084,7 +1084,7 @@ void Item_maxmin_subselect::no_rows_in_result()
*/
if (parsing_place != SELECT_LIST || const_item())
return;
value= (new (thd->mem_root) Item_null(thd))->get_cache(thd);
value= get_cache(thd);
null_value= 0;
was_values= 0;
make_const();
@@ -1102,7 +1102,7 @@ void Item_singlerow_subselect::no_rows_in_result()
*/
if (parsing_place != SELECT_LIST || const_item())
return;
value= (new (thd->mem_root) Item_null(thd))->get_cache(thd);
value= get_cache(thd);
reset();
make_const();
}