List:Commits« Previous MessageNext Message »
From:ramil Date:May 5 2008 5:31am
Subject:bk commit into 5.0 tree (ramil:1.2613) BUG#34779
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of ramil.  When ramil 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, 2008-05-05 08:31:15+05:00, ramil@stripped +3 -0
  Fix for bug #34779: crash in checksum table on federated tables 
  with blobs containing nulls
  
  Problem: FEDERATED SE improperly stores NULL fields in the record buffer.
  
  Fix: store them properly.

  mysql-test/r/federated.result@stripped, 2008-05-05 08:31:13+05:00, ramil@stripped +11 -0
    Fix for bug #34779: crash in checksum table on federated tables 
    with blobs containing nulls
      - test result.

  mysql-test/t/federated.test@stripped, 2008-05-05 08:31:13+05:00, ramil@stripped +22 -0
    Fix for bug #34779: crash in checksum table on federated tables 
    with blobs containing nulls
      - test case.

  sql/ha_federated.cc@stripped, 2008-05-05 08:31:13+05:00, ramil@stripped +3 -0
    Fix for bug #34779: crash in checksum table on federated tables 
    with blobs containing nulls
      - storing a NULL field in the record buffer
        we must initialize its data as other code
        may rely on it.

diff -Nrup a/mysql-test/r/federated.result b/mysql-test/r/federated.result
--- a/mysql-test/r/federated.result	2008-03-20 19:07:16 +04:00
+++ b/mysql-test/r/federated.result	2008-05-05 08:31:13 +05:00
@@ -2071,7 +2071,18 @@ DROP TABLE t1;
 DROP TABLE t1;
 CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://';
 DROP TABLE t1;
+CREATE TABLE t1 (a LONGBLOB, b LONGBLOB);
+INSERT INTO t1 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaa', NULL);
+CREATE TABLE t1
+(a LONGBLOB, b LONGBLOB) ENGINE=FEDERATED
+CONNECTION='mysql://root@stripped:SLAVE_PORT/test/t1';
+CHECKSUM TABLE t1;
+Table	Checksum
+test.t1	2465757603
+DROP TABLE t1;
+DROP TABLE t1;
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
+End of 5.0 tests
diff -Nrup a/mysql-test/t/federated.test b/mysql-test/t/federated.test
--- a/mysql-test/t/federated.test	2008-03-25 12:47:55 +04:00
+++ b/mysql-test/t/federated.test	2008-05-05 08:31:13 +05:00
@@ -1750,4 +1750,26 @@ DROP TABLE t1;
 CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://';
 DROP TABLE t1;
 
+
+#
+# Bug #34779: crash in checksum table on federated tables with blobs 
+# containing nulls
+#
+connection slave;
+CREATE TABLE t1 (a LONGBLOB, b LONGBLOB);
+INSERT INTO t1 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaa', NULL);
+connection master;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CREATE TABLE t1
+  (a LONGBLOB, b LONGBLOB) ENGINE=FEDERATED
+  CONNECTION='mysql://root@stripped:$SLAVE_MYPORT/test/t1';
+CHECKSUM TABLE t1;
+connection slave;
+DROP TABLE t1;
+connection master;
+DROP TABLE t1;
+
+
 source include/federated_cleanup.inc;
+
+--echo End of 5.0 tests
diff -Nrup a/sql/ha_federated.cc b/sql/ha_federated.cc
--- a/sql/ha_federated.cc	2008-03-29 11:52:03 +04:00
+++ b/sql/ha_federated.cc	2008-05-05 08:31:13 +05:00
@@ -728,7 +728,10 @@ uint ha_federated::convert_row_to_intern
     old_ptr= (my_ptrdiff_t) (record - table->record[0]);
     (*field)->move_field(old_ptr);
     if (!row[x])
+    {
       (*field)->set_null();
+      (*field)->reset();
+    }
     else
     {
       (*field)->set_notnull();
Thread
bk commit into 5.0 tree (ramil:1.2613) BUG#34779ramil5 May 2008