summaryrefslogtreecommitdiff
path: root/client/mysql.cc
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2007-04-09 17:53:10 +0500
committerunknown <bar@mysql.com>2007-04-09 17:53:10 +0500
commit33ac50f0769a01028bdb57a741eb449140ca5504 (patch)
tree8c65ae4e849cc30cb02aeb1d9c439bd31470df97 /client/mysql.cc
parent0c6731fdfa2438d20a027099b1038d0bea12a010 (diff)
downloadmariadb-git-33ac50f0769a01028bdb57a741eb449140ca5504.tar.gz
bug#27608 XML output is not well-formed
Problem: output was empty if the result is empty. Fix: print XML header and footer, even if the result is empty, to produce well-formed XML output. client/mysql.cc: Print header and footer even on empty set, when --xml mysql-test/r/client_xml.result: Adding test case mysql-test/t/client_xml.test: Adding test case
Diffstat (limited to 'client/mysql.cc')
-rw-r--r--client/mysql.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 510420fdf3d..6b37bb7b6f5 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -2117,6 +2117,17 @@ com_go(String *buffer,char *line __attribute__((unused)))
if (!mysql_num_rows(result) && ! quick && !info_flag)
{
strmov(buff, "Empty set");
+ if (opt_xml)
+ {
+ /*
+ We must print XML header and footer
+ to produce a well-formed XML even if
+ the result set is empty (Bug#27608).
+ */
+ init_pager();
+ print_table_data_xml(result);
+ end_pager();
+ }
}
else
{