From 9c2923fef4bbf671123f75236a2411cdfb66e2e4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 May 2007 13:18:07 +0500 Subject: Bug#27898 UPDATEXML Crashes the Server! Problem: when replacing the root element, UpdateXML erroneously tried to mix old XML content with the replacement string, which led to crash. Fix: don't use the old XML content in these cases, just return the replacement string. mysql-test/r/xml.result: Adding test case mysql-test/t/xml.test: Adding test case sql/item_xmlfunc.cc: Adding special code to handle replacements of the root element - the replacing content is just copied to the result, the previous content of the XML value is removed. --- mysql-test/t/xml.test | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test/t/xml.test') diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test index 8517dce111f..88ea519e610 100644 --- a/mysql-test/t/xml.test +++ b/mysql-test/t/xml.test @@ -231,6 +231,13 @@ select UpdateXML(@xml, '/a/b/@bb1', 'bb3="bb3"'); select UpdateXML(@xml, '/a/b/@bb2', ''); select UpdateXML(@xml, '/a/b/@bb2', 'bb3="bb3"'); +# +# Bug#27898 UPDATEXML Crashes the Server! +# +select updatexml('
12
', + '/','12') as upd1; +select updatexml('', '/', '') as upd2; + # # Bug#16234 XML: Crash if ExtractValue() # -- cgit v1.2.1