List:Commits« Previous MessageNext Message »
From:Alexander Barkov Date:May 5 2010 11:15am
Subject:bzr push into mysql-6.0-codebase-bugfixing branch (bar:3867 to 3868)
Bug#51571
View as plain text  
 3868 Alexander Barkov	2010-05-05 [merge]
      Merging Bug#51571 from mysql-next-bugfixing

    modified:
      mysql-test/r/loadxml.result
      mysql-test/t/loadxml.test
      sql/item_func.h
      sql/sql_load.cc
 3867 Alexander Barkov	2010-05-05 [merge]
      Merging bug#52849 from mysql-next-mr-bugfixing

    modified:
      mysql-test/r/type_datetime.result
      mysql-test/t/type_datetime.test
      sql/item.cc
=== modified file 'mysql-test/r/loadxml.result'
--- a/mysql-test/r/loadxml.result	2009-11-11 17:33:59 +0000
+++ b/mysql-test/r/loadxml.result	2010-05-05 11:13:06 +0000
@@ -73,3 +73,23 @@ id	text
 line2
 line3
 drop table t1;
+#
+# Bug#51571 load xml infile causes server crash
+#
+CREATE TABLE t1 (a text, b text);
+LOAD XML INFILE '../../std_data/loadxml.dat' INTO TABLE t1
+ROWS IDENTIFIED BY '<row>' (a,@b) SET b=concat('!',@b);
+SELECT * FROM t1 ORDER BY a;
+a	b
+1	!b1
+11	!b11
+111	!b111
+112	!b112 & < > " ' &unknown; -- check entities
+2	!b2
+212	!b212
+213	!b213
+214	!b214
+215	!b215
+216	!&bb b;
+3	!b3
+DROP TABLE t1;

=== modified file 'mysql-test/t/loadxml.test'
--- a/mysql-test/t/loadxml.test	2010-01-28 00:38:13 +0000
+++ b/mysql-test/t/loadxml.test	2010-05-05 11:13:06 +0000
@@ -108,3 +108,11 @@ load xml infile '../../std_data/loadxml2
 select * from t1;
 drop table t1;
 
+--echo #
+--echo # Bug#51571 load xml infile causes server crash
+--echo #
+CREATE TABLE t1 (a text, b text);
+LOAD XML INFILE '../../std_data/loadxml.dat' INTO TABLE t1
+ROWS IDENTIFIED BY '<row>' (a,@b) SET b=concat('!',@b);
+SELECT * FROM t1 ORDER BY a;
+DROP TABLE t1;

=== modified file 'sql/item_func.h'
--- a/sql/item_func.h	2010-04-08 10:50:40 +0000
+++ b/sql/item_func.h	2010-05-05 11:13:06 +0000
@@ -1497,7 +1497,8 @@ class Item_user_var_as_out_param :public
   LEX_STRING name;
   user_var_entry *entry;
 public:
-  Item_user_var_as_out_param(LEX_STRING a) : name(a) {}
+  Item_user_var_as_out_param(LEX_STRING a) : name(a)
+  { set_name(a.str, 0, system_charset_info); }
   /* We should return something different from FIELD_ITEM here */
   enum Type type() const { return STRING_ITEM;}
   double val_real();

=== modified file 'sql/sql_load.cc'
--- a/sql/sql_load.cc	2010-04-09 08:22:10 +0000
+++ b/sql/sql_load.cc	2010-05-05 11:13:06 +0000
@@ -695,7 +695,7 @@ static bool write_execute_load_query_log
     {
       if (n++)
         pfields.append(", ");
-      if (item->name)
+      if (item->type() == Item::FIELD_ITEM)
       {
         pfields.append("`");
         pfields.append(item->name);


Attachment: [text/bzr-bundle] bzr/bar@mysql.com-20100505111306-wzywdss9x5zctny3.bundle
Thread
bzr push into mysql-6.0-codebase-bugfixing branch (bar:3867 to 3868)Bug#51571Alexander Barkov5 May