mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
ab2d29ec6b
When mysqldump tries to dump information in xml format, the result does not contain field level comments. In order to retrieve various informations for a field/column, mysqldump currently uses 'show fields from <tab>' statement. The attributes returned by the statement lacks the information regarding field comments. Fixed by changing the query to one that probes I_S to retrieve required field informations, including the field comment. client/mysqldump.c: Bug#13618 : mysqldump --xml omits comment on table field. Replaced the 'show fields' command by a statement that queries I_S, in order to retrieve information on all the attributes that 'show fields' returns along-with an additional column_comment information. mysql-test/r/client_xml.result: Result modifications for bug#13618. mysql-test/r/mysqldump.result: Result modifications for bug#13618. mysql-test/t/mysqldump.test: Added a testcase for bug#13618.
92 lines
2.4 KiB
Text
92 lines
2.4 KiB
Text
set @old_concurrent_insert= @@global.concurrent_insert;
|
|
set @@global.concurrent_insert= 0;
|
|
drop table if exists t1;
|
|
create table t1 (
|
|
`a&b` int,
|
|
`a<b` int,
|
|
`a>b` text
|
|
);
|
|
insert into t1 values (1, 2, 'a&b a<b a>b');
|
|
<?xml version="1.0"?>
|
|
|
|
<resultset statement="select * from t1
|
|
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
<row>
|
|
<field name="a&b">1</field>
|
|
<field name="a<b">2</field>
|
|
<field name="a>b">a&b a<b a>b</field>
|
|
</row>
|
|
</resultset>
|
|
<?xml version="1.0"?>
|
|
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
<database name="test">
|
|
<table_structure name="t1">
|
|
<field Field="a&b" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
|
|
<field Field="a<b" Type="int(11)" Null="YES" Key="" Extra="" Comment="" />
|
|
<field Field="a>b" Type="text" Null="YES" Key="" Extra="" Comment="" />
|
|
</table_structure>
|
|
<table_data name="t1">
|
|
<row>
|
|
<field name="a&b">1</field>
|
|
<field name="a<b">2</field>
|
|
<field name="a>b">a&b a<b a>b</field>
|
|
</row>
|
|
</table_data>
|
|
</database>
|
|
</mysqldump>
|
|
<?xml version="1.0"?>
|
|
|
|
<resultset statement="select count(*) from t1
|
|
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
<row>
|
|
<field name="count(*)">1</field>
|
|
</row>
|
|
</resultset>
|
|
<?xml version="1.0"?>
|
|
|
|
<resultset statement="select 1 < 2 from dual
|
|
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
<row>
|
|
<field name="1 < 2">1</field>
|
|
</row>
|
|
</resultset>
|
|
<?xml version="1.0"?>
|
|
|
|
<resultset statement="select 1 > 2 from dual
|
|
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
<row>
|
|
<field name="1 > 2">0</field>
|
|
</row>
|
|
</resultset>
|
|
<?xml version="1.0"?>
|
|
|
|
<resultset statement="select 1 & 3 from dual
|
|
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
<row>
|
|
<field name="1 & 3">1</field>
|
|
</row>
|
|
</resultset>
|
|
<?xml version="1.0"?>
|
|
|
|
<resultset statement="select null from dual
|
|
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
<row>
|
|
<field name="NULL" xsi:nil="true" />
|
|
</row>
|
|
</resultset>
|
|
<?xml version="1.0"?>
|
|
|
|
<resultset statement="select 1 limit 0
|
|
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></resultset>
|
|
--------------
|
|
select 1 limit 0
|
|
--------------
|
|
|
|
<?xml version="1.0"?>
|
|
|
|
<resultset statement="select 1 limit 0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></resultset>
|
|
Empty set
|
|
|
|
Bye
|
|
drop table t1;
|
|
set @@global.concurrent_insert= @old_concurrent_insert;
|