mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user