1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug#21263 mysql client XML output does not distinguish between NULL and string 'NULL'

Fix: "mysql --xml" now print NULL values the same way that "mysqldump --xml" does:
  
    <field name="name" xsi:nil="true" />
  
  to distinguish from empty strings:
  
    <field name="name"></field>
  
  and from string "NULL":
  
    <field name="name">NULL</field>
This commit is contained in:
bar@mysql.com/bar.intranet.mysql.r18.ru
2006-09-29 16:29:39 +05:00
parent 53dea28352
commit 8b0f82b9b8
2 changed files with 9 additions and 4 deletions

View File

@ -2509,9 +2509,14 @@ print_table_data_xml(MYSQL_RES *result)
{
tee_fprintf(PAGER, "\t<field name=\"");
xmlencode_print(fields[i].name, (uint) strlen(fields[i].name));
tee_fprintf(PAGER, "\">");
xmlencode_print(cur[i], lengths[i]);
tee_fprintf(PAGER, "</field>\n");
if (cur[i])
{
tee_fprintf(PAGER, "\">");
xmlencode_print(cur[i], lengths[i]);
tee_fprintf(PAGER, "</field>\n");
}
else
tee_fprintf(PAGER, "\" xsi:nil=\"true\" />\n");
}
(void) tee_fputs(" </row>\n", PAGER);
}