From b46dc9ca4d7335192125ccc347a4a70c71b4b012 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Wed, 1 Apr 2009 13:40:33 +0500 Subject: Bug#43183 ExctractValue() brings result list in missorder The problem is that XML functions(items) do not reset null_value before their execution and further item excution may use null_value value of the previous result. The fix is to reset null_value. mysql-test/r/xml.result: test result mysql-test/t/xml.test: test case sql/item_xmlfunc.cc: The problem is that XML functions(items) do not reset null_value before their execution and further item excution may use null_value value of the previous result. The fix is to reset null_value. --- mysql-test/t/xml.test | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'mysql-test/t/xml.test') diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test index 74bce8dc962..6e7d38cdfca 100644 --- a/mysql-test/t/xml.test +++ b/mysql-test/t/xml.test @@ -590,4 +590,31 @@ select extractvalue('','"b"/a'); --error ER_UNKNOWN_ERROR select extractvalue('','(1)/a'); +# +# Bug#43183 ExctractValue() brings result list in missorder +# +CREATE TABLE IF NOT EXISTS t1 ( + id int(10) unsigned NOT NULL AUTO_INCREMENT, + xml text, + PRIMARY KEY (id) +) ENGINE=MyISAM; + +INSERT INTO t1 (id, xml) VALUES +(15, ''), +(14, ''); + + +SELECT +extractvalue( xml, '/bla/@name' ), +extractvalue( xml, '/bla/@name' ) +FROM t1 ORDER BY t1.id; + + +SELECT +UpdateXML(xml, '/bla/@name', 'test'), +UpdateXML(xml, '/bla/@name', 'test') +FROM t1 ORDER BY t1.id; + +DROP TABLE t1; + --echo End of 5.1 tests -- cgit v1.2.1