List:Commits« Previous MessageNext Message »
From:bar Date:June 27 2007 11:16am
Subject:bk commit into 5.2 tree (bar:1.2528)
View as plain text  
Below is the list of changes that have just been committed into a local
5.2 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@stripped, 2007-06-27 14:15:57+05:00, bar@stripped +5 -0
  Additional minor change for WL#1397 "convert XML -> SQL"	
  Adding '<row>' as default row tag.

  mysql-test/r/loadxml.result@stripped, 2007-06-27 14:15:55+05:00, bar@stripped +8 -0
    Adding test case

  mysql-test/t/loadxml.test@stripped, 2007-06-27 14:15:55+05:00, bar@stripped +5 -0
    Adding test case

  sql/sql_class.cc@stripped, 2007-06-27 14:15:55+05:00, bar@stripped +6 -2
    Adding '<row>' as default row tag.

  sql/sql_class.h@stripped, 2007-06-27 14:15:55+05:00, bar@stripped +2 -1
    Adding '<row>' as default row tag.

  sql/sql_yacc.yy@stripped, 2007-06-27 14:15:55+05:00, bar@stripped +1 -2
    Adding '<row>' as default row tag.

# 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-work/mysql-5.2.wl1397

--- 1.337/sql/sql_class.cc	2007-06-01 12:43:53 +05:00
+++ 1.338/sql/sql_class.cc	2007-06-27 14:15:55 +05:00
@@ -1176,13 +1176,17 @@ bool select_result::check_simple_select(
 static String default_line_term("\n",default_charset_info);
 static String default_escaped("\\",default_charset_info);
 static String default_field_term("\t",default_charset_info);
+static String default_xml_row_term("<row>", default_charset_info);
 
-sql_exchange::sql_exchange(char *name,bool flag)
+sql_exchange::sql_exchange(char *name, bool flag,
+                           enum enum_filetype filetype_arg)
   :file_name(name), opt_enclosed(0), dumpfile(flag), skip_lines(0)
 {
+  filetype= filetype_arg;
   field_term= &default_field_term;
   enclosed=   line_start= &my_empty_string;
-  line_term=  &default_line_term;
+  line_term=  filetype == FILETYPE_CSV ?
+              &default_line_term : &default_xml_row_term;
   escaped=    &default_escaped;
   cs= NULL;
 }

--- 1.369/sql/sql_class.h	2007-06-27 12:04:15 +05:00
+++ 1.370/sql/sql_class.h	2007-06-27 14:15:55 +05:00
@@ -1829,7 +1829,8 @@ public:
   bool dumpfile;
   ulong skip_lines;
   CHARSET_INFO *cs;
-  sql_exchange(char *name,bool dumpfile_flag);
+  sql_exchange(char *name, bool dumpfile_flag,
+               enum_filetype filetype_arg= FILETYPE_CSV);
 };
 
 #include "log_event.h"

--- 1.581/sql/sql_yacc.yy	2007-06-27 12:04:16 +05:00
+++ 1.582/sql/sql_yacc.yy	2007-06-27 14:15:55 +05:00
@@ -9150,9 +9150,8 @@ load:   LOAD data_or_xml
 	  lex->local_file=  $5;
 	  lex->duplicates= DUP_ERROR;
 	  lex->ignore= 0;
-	  if (!(lex->exchange= new sql_exchange($7.str, 0)))
+	  if (!(lex->exchange= new sql_exchange($7.str, 0, $2)))
 	    MYSQL_YYABORT;
-          lex->exchange->filetype= $2;
         }
         opt_duplicate INTO
         {

--- 1.1/mysql-test/r/loadxml.result	2007-06-27 12:04:16 +05:00
+++ 1.2/mysql-test/r/loadxml.result	2007-06-27 14:15:55 +05:00
@@ -29,6 +29,14 @@ a	b
 111	b111
 112	b112 & < > " ' &unknown; -- check entities
 212	b212
+--Check that default row tag is '<row>
+delete from t1;
+load xml infile
'/home/bar/mysql-work/mysql-5.2.wl1397/mysql-test/var/tmp/loadxml-dump.xml' into table
t1;;
+select * from t1 order by a;
+a	b
+111	b111
+112	b112 & < > " ' &unknown; -- check entities
+212	b212
 -- Check that 'xml' is not a keyword
 select 1 as xml;
 xml

--- 1.1/mysql-test/t/loadxml.test	2007-06-27 12:04:16 +05:00
+++ 1.2/mysql-test/t/loadxml.test	2007-06-27 14:15:55 +05:00
@@ -29,6 +29,11 @@ delete from t1;
 --eval load xml infile '$MYSQL_TMP_DIR/loadxml-dump.xml' into table t1 rows identified by
'<row>';
 select * from t1 order by a;
 
+--echo --Check that default row tag is '<row>
+delete from t1;
+--eval load xml infile '$MYSQL_TMP_DIR/loadxml-dump.xml' into table t1;
+select * from t1 order by a;
+
 --echo -- Check that 'xml' is not a keyword
 select 1 as xml;
 
Thread
bk commit into 5.2 tree (bar:1.2528)bar27 Jun