List:Commits« Previous MessageNext Message »
From:bar Date:April 9 2007 12:53pm
Subject:bk commit into 5.0 tree (bar:1.2428) BUG#27608
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of bar. When bar does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2428 07/04/09 17:53:10 bar@stripped +3 -0
  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.

  mysql-test/t/client_xml.test
    1.5 07/04/09 17:53:08 bar@stripped +2 -0
    Adding test case

  mysql-test/r/client_xml.result
    1.6 07/04/09 17:53:08 bar@stripped +14 -0
    Adding test case

  client/mysql.cc
    1.236 07/04/09 17:53:07 bar@stripped +11 -0
    Print header and footer even on empty set, when --xml

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	bar
# Host:	bar.myoffice.izhnet.ru
# Root:	/home/bar/mysql-5.0.b27608

--- 1.235/client/mysql.cc	2007-03-27 13:30:40 +05:00
+++ 1.236/client/mysql.cc	2007-04-09 17:53:07 +05:00
@@ -2117,6 +2117,17 @@ com_go(String *buffer,char *line __attri
       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
       {

--- 1.5/mysql-test/r/client_xml.result	2007-03-27 13:30:41 +05:00
+++ 1.6/mysql-test/r/client_xml.result	2007-04-09 17:53:08 +05:00
@@ -71,4 +71,18 @@ insert into t1 values (1, 2, 'a&b a<b a>
 	<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;

--- 1.4/mysql-test/t/client_xml.test	2006-02-17 15:07:41 +04:00
+++ 1.5/mysql-test/t/client_xml.test	2007-04-09 17:53:08 +05:00
@@ -17,5 +17,7 @@ insert into t1 values (1, 2, 'a&b a<b a>
 --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"
+--exec $MYSQL --xml test -e "select 1 limit 0"
+--exec $MYSQL --xml test -vv -e "select 1 limit 0"
 
 drop table t1;
Thread
bk commit into 5.0 tree (bar:1.2428) BUG#27608bar9 Apr