File mysql-5.0.67-bug52512.patch of Package mysql

Index: sql/net_serv.cc
===================================================================
--- sql/net_serv.cc.orig
+++ sql/net_serv.cc
@@ -928,7 +928,14 @@ my_real_read(NET *net, ulong *complen)
 		       ("Packets out of order (Found: %d, expected %u)",
 			(int) net->buff[net->where_b + 3],
 			net->pkt_nr));
-#ifdef EXTRA_DEBUG
+            /*
+              We don't make noise server side, since the client is expected
+              to break the protocol for e.g. --send LOAD DATA .. LOCAL where
+              the server expects the client to send a file, but the client
+              may reply with a new command instead.
+            */
+#if defined (EXTRA_DEBUG) && !defined (MYSQL_SERVER)
+            fflush(stdout);
 	    fprintf(stderr,"Packets out of order (Found: %d, expected %d)\n",
 		    (int) net->buff[net->where_b + 3],
 		    (uint) (uchar) net->pkt_nr);
Index: sql/sql_load.cc
===================================================================
--- sql/sql_load.cc.orig
+++ sql/sql_load.cc
@@ -780,6 +780,10 @@ read_sep_field(THD *thd, COPY_INFO &info
         DBUG_RETURN(1);
       }
     }
+
+    if (thd->is_fatal_error)
+      read_info.error= 1;
+
     if (read_info.error)
       break;
     if (skip_lines)
Index: mysql-test/r/loaddata.result
===================================================================
--- mysql-test/r/loaddata.result.orig
+++ mysql-test/r/loaddata.result
@@ -328,3 +328,11 @@ DROP VIEW v2;
 DROP VIEW v3;
 
 # -- End of Bug#35469.
+#
+# Bug #52512 : Assertion `! is_set()' in
+#  Diagnostics_area::set_ok_status on LOAD DATA
+#
+CREATE TABLE t1 (id INT NOT NULL);
+LOAD DATA LOCAL INFILE 'tb.txt' INTO TABLE t1;
+DROP TABLE t1;
+End of 5.1 tests
Index: mysql-test/t/loaddata.test
===================================================================
--- mysql-test/t/loaddata.test.orig
+++ mysql-test/t/loaddata.test
@@ -319,3 +319,25 @@ DROP VIEW v3;
 ###########################################################################
 
 # End of 5.0 tests
+
+--echo #
+--echo # Bug #52512 : Assertion `! is_set()' in
+--echo #  Diagnostics_area::set_ok_status on LOAD DATA
+--echo #
+
+connect (con1,localhost,root,,test);
+
+CREATE TABLE t1 (id INT NOT NULL);
+--send LOAD DATA LOCAL INFILE 'tb.txt' INTO TABLE t1
+# please keep this is a spearate test file : it's important to have no
+# commands after this one
+
+connection default;
+dirty_close con1;
+
+connect (con1,localhost,root,,test);
+DROP TABLE t1;
+connection default;
+disconnect con1;
+
+--echo End of 5.1 tests
openSUSE Build Service is sponsored by