Fix for bug #32557: order by updatexml causes assertion in filesort
Problem: even if an Item_xml_str_func successor returns NULL, it doesn't have a corresponding property (maybe_null) set, that leads to a failed assertion. Fix: set nullability property of Item_xml_str_func. mysql-test/r/xml.result: Fix for bug #32557: order by updatexml causes assertion in filesort - test result. mysql-test/t/xml.test: Fix for bug #32557: order by updatexml causes assertion in filesort - test case. sql/item_xmlfunc.h: Fix for bug #32557: order by updatexml causes assertion in filesort - set Item_xml_str_func::maybe_null.
This commit is contained in:
parent
f2a631f0dc
commit
961cc887bf
@ -1022,4 +1022,11 @@ NULL NULL NULL
|
|||||||
select updatexml(NULL, NULL, NULL);
|
select updatexml(NULL, NULL, NULL);
|
||||||
updatexml(NULL, NULL, NULL)
|
updatexml(NULL, NULL, NULL)
|
||||||
NULL
|
NULL
|
||||||
|
CREATE TABLE t1(a INT NOT NULL);
|
||||||
|
INSERT INTO t1 VALUES (0), (0);
|
||||||
|
SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1'));
|
||||||
|
1
|
||||||
|
1
|
||||||
|
1
|
||||||
|
DROP TABLE t1;
|
||||||
End of 5.1 tests
|
End of 5.1 tests
|
||||||
|
@ -543,4 +543,12 @@ select updatexml(NULL, NULL, 1), updatexml(1, NULL, NULL),
|
|||||||
updatexml(NULL, 1, NULL);
|
updatexml(NULL, 1, NULL);
|
||||||
select updatexml(NULL, NULL, NULL);
|
select updatexml(NULL, NULL, NULL);
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #32557: order by updatexml causes assertion in filesort
|
||||||
|
#
|
||||||
|
CREATE TABLE t1(a INT NOT NULL);
|
||||||
|
INSERT INTO t1 VALUES (0), (0);
|
||||||
|
SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1'));
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
--echo End of 5.1 tests
|
--echo End of 5.1 tests
|
||||||
|
@ -28,8 +28,16 @@ protected:
|
|||||||
String tmp_value, pxml;
|
String tmp_value, pxml;
|
||||||
Item *nodeset_func;
|
Item *nodeset_func;
|
||||||
public:
|
public:
|
||||||
Item_xml_str_func(Item *a, Item *b): Item_str_func(a,b) {}
|
Item_xml_str_func(Item *a, Item *b):
|
||||||
Item_xml_str_func(Item *a, Item *b, Item *c): Item_str_func(a,b,c) {}
|
Item_str_func(a,b)
|
||||||
|
{
|
||||||
|
maybe_null= TRUE;
|
||||||
|
}
|
||||||
|
Item_xml_str_func(Item *a, Item *b, Item *c):
|
||||||
|
Item_str_func(a,b,c)
|
||||||
|
{
|
||||||
|
maybe_null= TRUE;
|
||||||
|
}
|
||||||
void fix_length_and_dec();
|
void fix_length_and_dec();
|
||||||
String *parse_xml(String *raw_xml, String *parsed_xml_buf);
|
String *parse_xml(String *raw_xml, String *parsed_xml_buf);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user