Commit eb140423 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-14613: Assertion `fixed == 0' failed in Item_func::fix_fields

fix_fields calls fixed.
parent 8d70097c
......@@ -1523,5 +1523,20 @@ str str1 b c
::10.0.5.9 ::10.0.5.9 1 0
DROP TABLE t1;
#
# MDEV-14613: Assertion `fixed == 0' failed in Item_func::fix_fields
#
CREATE TABLE `t1` (
`numgtfmt` char(10) COLLATE utf8_bin NOT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
create view v1(numgtfmt)
as
select 'x' from t1
union
select 'x' from t1 ;
SELECT * FROM v1 WHERE numgtfmt = NAME_CONST('wnumgtfmt',_utf8'QEDITIONS' COLLATE 'utf8_bin');
numgtfmt
DROP VIEW v1;
DROP TABLE t1;
#
# End of 10.2 tests
#
......@@ -1152,6 +1152,27 @@ INSERT INTO t1 (str) VALUES ('::FFFF:192.168.0.1'),('::10.0.5.9');
SELECT str, str1, b,c FROM t1;
DROP TABLE t1;
--echo #
--echo # MDEV-14613: Assertion `fixed == 0' failed in Item_func::fix_fields
--echo #
CREATE TABLE `t1` (
`numgtfmt` char(10) COLLATE utf8_bin NOT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
create view v1(numgtfmt)
as
select 'x' from t1
union
select 'x' from t1 ;
SELECT * FROM v1 WHERE numgtfmt = NAME_CONST('wnumgtfmt',_utf8'QEDITIONS' COLLATE 'utf8_bin');
# Cleanup
DROP VIEW v1;
DROP TABLE t1;
--echo #
--echo # End of 10.2 tests
--echo #
......@@ -1814,8 +1814,10 @@ bool Item_name_const::fix_fields(THD *thd, Item **ref)
String s(buf, sizeof(buf), &my_charset_bin);
s.length(0);
if (value_item->fix_fields(thd, &value_item) ||
name_item->fix_fields(thd, &name_item) ||
if ((!value_item->fixed &&
value_item->fix_fields(thd, &value_item)) ||
(!name_item->fixed &&
name_item->fix_fields(thd, &name_item)) ||
!value_item->const_item() ||
!name_item->const_item() ||
!(item_name= name_item->val_str(&s))) // Can't have a NULL name
......
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