Bug #48973 Assertion failed at NdbOperationSearch.cpp line 509
Submitted: 22 Nov 2009 20:04 Modified: 4 Dec 2009 16:00
Reporter: John David Duncan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: NDB API Severity:S3 (Non-critical)
Version:mysql-5.1-telco-6.2 OS:Any
Assigned to: Frazer Clement CPU Architecture:Any

[22 Nov 2009 20:04] John David Duncan
Description:
Under MySQL Cluster 6.3 the attached program correctly raises an NDB Error 4116 "Operation was not defined correctly, probably missing a key."

But in 7.0 we see a failed assertion in getBlobHandle():  

Assertion failed: (size >= theTupKeyLen && theTupKeyLen > 0), function getKeyFromTCREQ, file NdbOperationSearch.cpp, line 509.

How to repeat:
   USE test; 
   CREATE TABLE typ8 (
     id int not null primary key ,
     doc text 
   ) engine = ndbcluster;   

Then compile and run the attached program blob-bug.cc:

  MYSQL_HOME=/whereever
  
  g++ -I $MYSQL_HOME/include/mysql -I $MYSQL_HOME/include/mysql/storage/ndb \
   -I$MYSQL_HOME/include/mysql/storage/ndb/ndbapi \
   -L$MYSQL_HOME/lib/mysql -lndbclient \
   -o blob-bug blob-bug.cc
[22 Nov 2009 20:05] John David Duncan
Source file

Attachment: blob-bug.cc (application/octet-stream, text), 2.47 KiB.

[24 Nov 2009 17:57] Frazer Clement
Proposed patch

Attachment: bug48973.patch (text/x-patch), 2.48 KiB.

[24 Nov 2009 18:11] Frazer Clement
Proposed patch changes main-table-op key size assertion into check allowing Blob code to set an error.

Note that the version has been changed to mysql-5.1-telco-6.2 as this bug appears to be in 6.2, 6.3, 7.0, 7.1 etc.

Can you recheck that you get the error as described in 6.3? 

Also note that this bug appears to be similar to bug#28116
[27 Nov 2009 13:14] 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/91912

3044 Frazer Clement	2009-11-27
      Bug#48973 Assertion failed at NdbOperationSearch.cpp line 509
      modified:
        storage/ndb/src/ndbapi/NdbOperationSearch.cpp
        storage/ndb/test/ndbapi/testBlobs.cpp
        storage/ndb/test/run-test/daily-basic-tests.txt
[27 Nov 2009 15:04] Frazer Clement
Pushed to 6.2.19, 6.3.27, 7.0.10, 7.1.0
[1 Dec 2009 13:02] 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/92273

3167 Martin Skold	2009-12-01 [merge]
      Merge
      modified:
        storage/ndb/src/common/debugger/EventLogger.cpp
        storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
        storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp
        storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
        storage/ndb/src/kernel/blocks/pgman.cpp
        storage/ndb/src/kernel/blocks/pgman.hpp
        storage/ndb/src/mgmsrv/MgmtSrvr.cpp
        storage/ndb/src/ndbapi/NdbOperationDefine.cpp
        storage/ndb/src/ndbapi/NdbOperationSearch.cpp
        storage/ndb/test/ndbapi/testBlobs.cpp
        storage/ndb/test/run-test/daily-basic-tests.txt
        storage/ndb/test/run-test/daily-devel-tests.txt
[1 Dec 2009 13:33] 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/92279

3244 Martin Skold	2009-12-01 [merge]
      Merge
      modified:
        storage/ndb/src/common/debugger/EventLogger.cpp
        storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
        storage/ndb/src/kernel/blocks/ndbfs/AsyncIoThread.hpp
        storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
        storage/ndb/src/kernel/blocks/pgman.cpp
        storage/ndb/src/kernel/blocks/pgman.hpp
        storage/ndb/src/mgmsrv/MgmtSrvr.cpp
        storage/ndb/src/ndbapi/NdbOperationDefine.cpp
        storage/ndb/src/ndbapi/NdbOperationSearch.cpp
        storage/ndb/test/ndbapi/testBlobs.cpp
        storage/ndb/test/run-test/daily-basic-tests.txt
        storage/ndb/test/run-test/daily-devel-tests.txt
[1 Dec 2009 14:02] 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/92287

3170 Martin Skold	2009-12-01 [merge]
      Merge
      modified:
        storage/ndb/src/common/debugger/EventLogger.cpp
        storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
        storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp
        storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
        storage/ndb/src/kernel/blocks/pgman.cpp
        storage/ndb/src/kernel/blocks/pgman.hpp
        storage/ndb/src/mgmsrv/MgmtSrvr.cpp
        storage/ndb/src/ndbapi/NdbOperationDefine.cpp
        storage/ndb/src/ndbapi/NdbOperationSearch.cpp
        storage/ndb/test/ndbapi/testBlobs.cpp
        storage/ndb/test/run-test/daily-basic-tests.txt
        storage/ndb/test/run-test/daily-devel-tests.txt
[1 Dec 2009 14:22] 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/92291

3040 Martin Skold	2009-12-01 [merge]
      Merge
      modified:
        storage/ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp
        storage/ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
        storage/ndb/src/kernel/blocks/pgman.cpp
        storage/ndb/src/kernel/blocks/pgman.hpp
        storage/ndb/src/ndbapi/NdbOperationDefine.cpp
        storage/ndb/src/ndbapi/NdbOperationSearch.cpp
        storage/ndb/test/ndbapi/testBlobs.cpp
        storage/ndb/test/run-test/daily-basic-tests.txt
[4 Dec 2009 16:00] Jon Stephens
Documented bugfix in the NDB-6.2.19, 6.3.29, and 7.0.10 changelogs.

See BUG#28116 for changelog entry.