Bug #21036 myOperation->getBlobHandle(..) on non-existing column cause segmentation fault
Submitted: 13 Jul 2006 16:03 Modified: 2 Nov 2006 15:09
Reporter: Johan Andersson
Status: Closed
Category:Server: NDBAPI Severity:S3 (Non-critical)
Version:5.x OS:Any (*)
Assigned to: Bugs System Target Version:

[13 Jul 2006 16:03] Johan Andersson
Description:
Calling:
  NdbBlob * bh = myOperation->getBlobHandle("c");
on a column, "c", that does not exist cause segmentation fault!!

How to repeat:
create table t1 ( a integer primary key, b blob) engine=ndb;
insert into t1 values(1,'xyz');

..

  NdbTransaction *myTransaction= myNdb.startTransaction();
  if (myTransaction == NULL) APIERROR(myNdb.getNdbError());
  
  NdbOperation *myOperation= myTransaction->getNdbOperation("t1");
  

  if (myOperation == NULL) APIERROR(myTransaction->getNdbError());
  
  myOperation->readTuple(NdbOperation::LM_Read);
  myOperation->equal("a", 1);

  NdbBlob * bh = myOperation->getBlobHandle("c");  //seg faults!!

...

Suggested fix:
Let myOperation->getBlobHandle("c"); return NULL
[11 Sep 2006 11:15] 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/11678

ChangeSet@1.2255, 2006-09-11 17:11:47+08:00, Justin.He@qa3-104.qa.cn.tlan +3 -0
  BUG #21036, myOperation->getBlobHandle(..) on non-existing column cause segmentation
fault
  
  add some arguments judgement to avoid NULL pointer's operation(segmentaion fault)
[20 Sep 2006 20:09] 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/12269

ChangeSet@1.2255, 2006-09-20 18:51:32+08:00, Justin.He@qa3-104.qa.cn.tlan +2 -0
  BUG #21036, myOperation->getBlobHandle(..) on non-existing column cause segmentation
fault
  
  add judgement to avoid NULL pointer's operation(segmentaion fault)
[20 Sep 2006 20:11] 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/12267

ChangeSet@1.2255, 2006-09-20 18:17:29+08:00, Justin.He@qa3-104.qa.cn.tlan +2 -0
  BUG #21036, myOperation->getBlobHandle(..) on non-existing column cause segmentation
fault
  
  add judgement to avoid NULL pointer's operation(segmentaion fault)
[10 Oct 2006 20:36] Jonas Oreland
pushed into 5.1.12
[1 Nov 2006 15:40] Jonas Oreland
pushed into 5.0.29
[2 Nov 2006 15:09] 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 for 5.0.29 & 5.1.12.