mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-16722: Assertion `type() != NULL_ITEM' failed
We hit this assert during the create of a temporary table field because the current code does not handle the case when the value of the NAME_CONST function is NULL. Fixed this by allowing creation of temporary table fields even for the case when NAME_CONST returns NULL value. Introduced tmp_table_field_from_field_type_maybe_null() function in Item class so both Item_basic_value and Item_name_const can use it. Introduced a virtual method get_func_item() in the Item class.
This commit is contained in:
@@ -2100,3 +2100,12 @@ CREATE TABLE t1 (d time);
|
||||
INSERT INTO t1 VALUES ('00:00:01'),('00:00:02');
|
||||
SELECT *, LEAD(d) OVER (ORDER BY d) AS x FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-16722: Assertion `type() != NULL_ITEM' failed
|
||||
--echo #
|
||||
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2),(3);
|
||||
SELECT row_number() OVER (order by a) FROM t1 order by NAME_CONST('myname',NULL);
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user