Bug #23542 crash on DELETE from ndb dd table
Submitted: 23 Oct 2006 7:36 Modified: 7 Dec 2006 4:38
Reporter: Stewart Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Disk Data Severity:S1 (Critical)
Version:5.1.13bk OS:amd64 ubuntu linux
Assigned to: Martin Skold CPU Architecture:Any

[23 Oct 2006 7:36] Stewart Smith
Description:
DELETE FROM g2_PluginParameterMap WHERE g_pluginType='module' AND g_pluginId='useralbum' AND g_parameterName='albumId' AND g_parameterValue='372';

crashes mysql server with this backtrace:
0x5dddea handle_segfault + 554
0x899740 _ZNK13NdbDictionary6Column11getColumnNoEv + 0
0x6d1fb1 _ZN13ha_ndbcluster21read_multi_range_nextEPP18st_key_multi_range + 15850x6d0c32 _ZN13ha_ndbcluster22read_multi_range_firstEPP18st_key_multi_rangeS1_jbP17st_handler_buffer + 1250
0x695dc4 _ZN18QUICK_RANGE_SELECT8get_nextEv + 308
0x6aa9bd _Z8rr_quickP14st_read_record + 29
0x6639c2 _Z12mysql_deleteP3THDP13st_table_listP4ItemP11st_sql_listmmb + 1474
0x5faf0f _Z21mysql_execute_commandP3THD + 9855
0x5ffec9 _Z11mysql_parseP3THDPcj + 761
0x60043d _Z16dispatch_command19enum_server_commandP3THDPcj + 1181
0x60172d _Z10do_commandP3THD + 157
0x6020d1 handle_one_connection + 2177

show create table g2_PluginParameterMap
 CREATE TABLE `g2_PluginParameterMap` (
  `g_pluginType` varchar(32) NOT NULL,
  `g_pluginId` varchar(32) NOT NULL,
  `g_itemId` int(11) NOT NULL,
  `g_parameterName` varchar(128) NOT NULL,
  `g_parameterValue` text NOT NULL,
  UNIQUE KEY `g_pluginType` (`g_pluginType`,`g_pluginId`,`g_itemId`,`g_parameterName`),
  KEY `g2_PluginParameterMap_80596` (`g_pluginType`),
  KEY `g2_PluginParameterMap_12808` (`g_pluginType`,`g_pluginId`,`g_itemId`)
) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=utf8

How to repeat:
run:

DELETE FROM g2_PluginParameterMap WHERE g_pluginType='module' AND g_pluginId='useralbum' AND g_parameterName='albumId' AND g_parameterValue='372';

Suggested fix:
don't crash! :)
[25 Oct 2006 14:35] Stewart Smith
better looking backtrace:

#1  0x00000000005de61d in handle_segfault (sig=11) at mysqld.cc:2156
#2  <signal handler called>
#3  NdbDictionary::Column::getColumnNo (this=0x0) at NdbDictionary.cpp:251
#4  0x00000000006becc0 in ndb_unpack_record (table=<value optimized out>,
    value=0x14c1e38, defined=0x0, buf=<value optimized out>)
    at ha_ndbcluster.cc:3083
#5  0x00000000006d3011 in ha_ndbcluster::read_multi_range_next (
    this=0x14c0c70, multi_range_found_p=<value optimized out>)
    at ha_ndbcluster.cc:3116
#6  0x00000000006d1c92 in ha_ndbcluster::read_multi_range_first (
    this=0x14c0c70, found_range_p=0x4415e0b8, ranges=0x14f0240,
    range_count=<value optimized out>, sorted=false, buffer=0x17051f0)
    at ha_ndbcluster.cc:7908
#7  0x0000000000696c64 in QUICK_RANGE_SELECT::get_next (this=0x17048e0)
    at opt_range.cc:8131
#8  0x00000000006ab8ad in rr_quick (info=0x4415e440) at records.cc:291
#9  0x00000000006647b2 in mysql_delete (thd=0x15c8fc0, table_list=0x14a9fe0,
    conds=0x14aae28, order=0x15c9660, limit=18446744073709551615,
    options=<value optimized out>, reset_auto_increment=false)
    at sql_delete.cc:225
#10 0x00000000005fb70f in mysql_execute_command (thd=0x15c8fc0)
    at sql_parse.cc:3504

section of code:
 NdbBlob *ndb_blob= (*value).blob;
        uint col_no = ndb_blob->getColumn()->getColumnNo();
        int isNull;
        ndb_blob->getDefined(isNull);

in ha_ndbcluster.cc  void ndb_unpack_record(TABLE *table, NdbValue *value,
                       MY_BITMAP *defined, byte *buf)
[25 Oct 2006 14:48] Stewart Smith
trace of failure during SR

Attachment: ndb_2_trace.log.4.bz2 (application/x-bzip, text), 19.18 KiB.

[8 Nov 2006 14:10] 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/15020

ChangeSet@1.2318, 2006-11-08 15:09:35+01:00, mskold@mysql.com +1 -0
  bug#23542  crash on DELETE from ndb dd table: uses_blob_value always reads write_set, should check read_set if read operation
[4 Dec 2006 4:20] Kevin Burton
I ran into a similar problem with the server crashing on a DELETE.  I'm going to try to apply this patch in the next few days and see if corrects my problem as well.

Thx
[7 Dec 2006 4:38] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix in 5.1.14 changelog.