2662 Ramil Kalimullin 2008-08-15
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.
modified:
mysql-test/r/federated.result
mysql-test/t/federated.test
sql/ha_federated.cc
2661 Evgeny Potemkin 2008-08-14
Fixed failing test case for the bug#38195.
modified:
mysql-test/r/group_min_max.result
mysql-test/t/group_min_max.test
=== modified file 'mysql-test/r/federated.result'
--- a/mysql-test/r/federated.result 2008-03-20 15:07:17 +0000
+++ b/mysql-test/r/federated.result 2008-08-15 06:40:05 +0000
@@ -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
=== modified file 'mysql-test/t/federated.test'
--- a/mysql-test/t/federated.test 2008-03-25 08:47:57 +0000
+++ b/mysql-test/t/federated.test 2008-08-15 06:40:05 +0000
@@ -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
=== modified file 'sql/ha_federated.cc'
--- a/sql/ha_federated.cc 2008-07-17 14:33:41 +0000
+++ b/sql/ha_federated.cc 2008-08-15 06:40:05 +0000
@@ -731,7 +731,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 |
|---|
| • bzr push into mysql-5.0-bugteam branch (ramil:2661 to 2662) Bug#34779,Bug#38195 | Ramil Kalimullin | 15 Aug |