Bug #37212 Restore crashes if table has longblob of size 1MB
Submitted: 5 Jun 2008 3:52 Modified: 29 Sep 2008 23:13
Reporter: Hema Sridharan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:mysql-6.0-backup-myisam OS:Linux
Assigned to: Jørgen Løland CPU Architecture:Any

[5 Jun 2008 3:52] Hema Sridharan
Description:
1)I create database and table with CS drivers(Innodb or Falcon storage engine in it) that has longblob  column in it .
2)I insert the values in longblob of 1MB size.
3)Perform Backup database operation,drop database and the perform Restore.
4)Mysql server crashes during Restore if the size of Longblob is 1MB

How to repeat:
create database x;
use x;
create table t1(detail longblob)engine=innodb;
insert into t1 values(repeat('z',1048576));
checksum table t1;
backup database x to 'k';
drop database x;
restore from 'k';
ERROR 2013 (HY000): Lost connection to MySQL server during query

The crash happens only if the size is 1MB.This problem is not seen for Native drivers.
[5 Jun 2008 19:08] Sveta Smirnova
Thank you for the report.

Verified as described.
[5 Aug 2008 8:32] Jørgen Løland
In progress -> verified since I will not work on this bug for a few weeks.
[8 Sep 2008 11:27] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/53514

2696 Jorgen Loland	2008-09-08
      Bug#37212 - Restore crashes if table has longblob of size 1MB
      
      Backup/restore assumed that rpl_record.cc (un)pack_row did not 
      (un)pack blob fields. Instead, b/r handles blob fields by using
      the field.h get/set_ptr() methods. However, (un)pack_row *did* 
      not ignore blob fields, resulting in crash because backup/restore
      buffer was not big enough to handle 1MB blobs.
      
      rpl_record.cc (un)pack_row now takes an option whether to 
      operate on blobs or not.
[8 Sep 2008 23:41] Chuck Bell
Approved. Excellent work!
[9 Sep 2008 6:58] Rafal Somla
Good to push.
[9 Sep 2008 8:18] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/53572

2696 Jorgen Loland	2008-09-09
      Bug#37212 - Restore crashes if table has longblob of size 1MB
            
      Backup/restore assumed that rpl_record.cc (un)pack_row did not 
      (un)pack blob fields. Instead, b/r handles blob fields by using
      the field.h get/set_ptr() methods. However, (un)pack_row did 
      not ignore blob fields, resulting in crash because backup/restore
      buffer was not big enough to handle 1MB blobs.
            
      rpl_record.cc (un)pack_row now takes an option whether to 
      operate on blobs or not.
[9 Sep 2008 8:19] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/53573

2696 Jorgen Loland	2008-09-09
      Bug#37212 - Restore crashes if table has longblob of size 1MB
            
      Backup/restore assumed that rpl_record.cc (un)pack_row did not 
      (un)pack blob fields. Instead, b/r handles blob fields by using
      the field.h get/set_ptr() methods. However, (un)pack_row did 
      not ignore blob fields, resulting in crash because backup/restore
      buffer was not big enough to handle 1MB blobs.
            
      rpl_record.cc (un)pack_row now takes an option whether to 
      operate on blobs or not.
[28 Sep 2008 19:21] Øystein Grøvlen
Pushed to 6.0 main for 6.0.8
[29 Sep 2008 23:13] Paul DuBois
Noted in 6.0.8 changelog.

Incorrect BLOB handling by RESTORE could result in a server crash.
[8 Jan 2010 17:04] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/96418

3045 Chuck Bell	2010-01-08
      Bug#37212 - Restore crashes if table has longblob of size 1MB
            
      Backup/restore assumed that rpl_record.cc (un)pack_row did not 
      (un)pack blob fields. Instead, b/r handles blob fields by using
      the field.h get/set_ptr() methods. However, (un)pack_row did 
      not ignore blob fields, resulting in crash because backup/restore
      buffer was not big enough to handle 1MB blobs.
            
      rpl_record.cc (un)pack_row now takes an option whether to 
      operate on blobs or not.
      
      WL#5101 : Back port MySQL Backup
      
      original changeset: 2690.1.6 (mysql-6.0-backup)
     @ sql/backup/be_default.cc
        Modified calls to rpl_record pack_row to handle new method signature.
     @ sql/field.h
        Added documentation for set_ptr
     @ sql/log_event.h
        Modified call to unpack_row to handle new method signature.
     @ sql/log_event_old.h
        Modified call to unpack_row to handle new method signature.
     @ sql/rpl_record.cc
        Added option to (un)pack_row: whether or not to ignore blob fields 
        during pack and unpack.
     @ sql/rpl_record.h
        Added option to (un)pack_row: whether or not to ignore blob fields 
        during pack and unpack.
     @ sql/sql_class.cc
        Modified calls to rpl_record pack_row to handle new method signature.