summaryrefslogtreecommitdiff
path: root/mysql-test/r/xml.result
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2009-04-01 13:40:33 +0500
committerSergey Glukhov <Sergey.Glukhov@sun.com>2009-04-01 13:40:33 +0500
commitb46dc9ca4d7335192125ccc347a4a70c71b4b012 (patch)
tree5736d1d98769abef33df0d20df1bccf1a0d6811f /mysql-test/r/xml.result
parent968069d845dc09c32458ebe593bfadfb8b1ea035 (diff)
downloadmariadb-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/r/xml.result')
-rw-r--r--mysql-test/r/xml.result29
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result
index 404b0dc3789..fad2cab0e57 100644
--- a/mysql-test/r/xml.result
+++ b/mysql-test/r/xml.result
@@ -1064,4 +1064,33 @@ select extractvalue('<a></a>','"b"/a');
ERROR HY000: XPATH syntax error: '/a'
select extractvalue('<a></a>','(1)/a');
ERROR HY000: XPATH syntax error: '/a'
+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;
+extractvalue( xml, '/bla/@name' ) extractvalue( xml, '/bla/@name' )
+NULL NULL
+blubb blubb
+Warnings:
+Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-OF-INPUT'
+Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-OF-INPUT'
+SELECT
+UpdateXML(xml, '/bla/@name', 'test'),
+UpdateXML(xml, '/bla/@name', 'test')
+FROM t1 ORDER BY t1.id;
+UpdateXML(xml, '/bla/@name', 'test') UpdateXML(xml, '/bla/@name', 'test')
+NULL NULL
+<?xml version="1.0"?><bla test></bla> <?xml version="1.0"?><bla test></bla>
+Warnings:
+Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-OF-INPUT'
+Warning 1525 Incorrect XML value: 'parse error at line 1 pos 23: unexpected END-OF-INPUT'
+DROP TABLE t1;
End of 5.1 tests