diff options
author | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2009-04-01 13:40:33 +0500 |
---|---|---|
committer | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2009-04-01 13:40:33 +0500 |
commit | b46dc9ca4d7335192125ccc347a4a70c71b4b012 (patch) | |
tree | 5736d1d98769abef33df0d20df1bccf1a0d6811f /mysql-test/t/xml.test | |
parent | 968069d845dc09c32458ebe593bfadfb8b1ea035 (diff) | |
download | mariadb-git-b46dc9ca4d7335192125ccc347a4a70c71b4b012.tar.gz |
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.
Diffstat (limited to 'mysql-test/t/xml.test')
-rw-r--r-- | mysql-test/t/xml.test | 27 |
1 files changed, 27 insertions, 0 deletions
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('<a></a>','"b"/a'); --error ER_UNKNOWN_ERROR select extractvalue('<a></a>','(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, '<?xml version="1.0"?><bla name="blubb"></bla>'), +(14, '<xml version="kaputt">'); + + +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 |