Bug#25946 Namespace not include for xsi usage within --xml output with null/nil values

Fix: adding namespace reference into "mysql --xml" output,
to make it work similary to "mysqldump --xml".
This commit is contained in:
bar@mysql.com 2007-03-27 13:30:43 +05:00
parent f0a95a4e20
commit 5e52cd3650
2 changed files with 8 additions and 7 deletions

View file

@ -2529,7 +2529,8 @@ print_table_data_xml(MYSQL_RES *result)
tee_fputs("<?xml version=\"1.0\"?>\n\n<resultset statement=\"", PAGER);
xmlencode_print(glob_buffer.ptr(), (int)strlen(glob_buffer.ptr()));
tee_fputs("\">", PAGER);
tee_fputs("\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">",
PAGER);
fields = mysql_fetch_fields(result);
while ((cur = mysql_fetch_row(result)))

View file

@ -7,7 +7,7 @@ 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&amp;b">1</field>
<field name="a&lt;b">2</field>
@ -34,7 +34,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
<?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>
@ -42,7 +42,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
<?xml version="1.0"?>
<resultset statement="select 1 &lt; 2 from dual
">
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<row>
<field name="1 &lt; 2">1</field>
</row>
@ -50,7 +50,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
<?xml version="1.0"?>
<resultset statement="select 1 &gt; 2 from dual
">
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<row>
<field name="1 &gt; 2">0</field>
</row>
@ -58,7 +58,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
<?xml version="1.0"?>
<resultset statement="select 1 &amp; 3 from dual
">
" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<row>
<field name="1 &amp; 3">1</field>
</row>
@ -66,7 +66,7 @@ insert into t1 values (1, 2, 'a&b a<b a>b');
<?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>