mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Change 'mysql' client to output XML like the 'mysqldump'
tool does, with the column names as attributes on <field> elements, instead of trying to use the column name as the element name. Also fix some encoding issues. (Bug #7811) client/mysql.cc: Quote > and " in XML output, and use <field name="XXX"></field> instead of <XXX></XXX>, to make the output more like mysqldump --xml and avoid having to turn XXX into a sensible element name.
This commit is contained in:
18
mysql-test/t/client_xml.test
Normal file
18
mysql-test/t/client_xml.test
Normal file
@ -0,0 +1,18 @@
|
||||
# Test of the xml output of the 'mysql' and 'mysqldump' clients -- makes
|
||||
# sure that basic encoding issues are handled properly
|
||||
create table t1 (
|
||||
`a&b` int,
|
||||
`a<b` int,
|
||||
`a>b` text
|
||||
);
|
||||
insert into t1 values (1, 2, 'a&b a<b a>b');
|
||||
--exec $MYSQL --xml test -e 'select * from t1'
|
||||
--exec $MYSQL_DUMP --xml test
|
||||
|
||||
--exec $MYSQL --xml test -e 'select count(*) from t1'
|
||||
--exec $MYSQL --xml test -e 'select 1 < 2 from dual'
|
||||
--exec $MYSQL --xml test -e 'select 1 > 2 from dual'
|
||||
--exec $MYSQL --xml test -e 'select 1 & 3 from dual'
|
||||
--exec $MYSQL --xml test -e 'select null from dual'
|
||||
|
||||
drop table t1;
|
Reference in New Issue
Block a user