Fix for 840, invalid tuple size.

Still don't know reason, but this works
This commit is contained in:
joreland@mysql.com 2004-06-03 08:09:04 +02:00
parent 0a69e028b0
commit 8e88ed19fe

View File

@ -528,9 +528,9 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo,
tAttrId = tAttrInfo->m_attrId;
const char *aValue = aValuePassed;
Uint32 ahValue;
AttributeHeader& ah = AttributeHeader::init(&ahValue, tAttrId, 0);
if (aValue == NULL) {
if (tAttrInfo->m_nullable) {
AttributeHeader& ah = AttributeHeader::init(&ahValue, tAttrId, 0);
ah.setNULL();
insertATTRINFO(ahValue);
// Insert Attribute Id with the value
@ -564,7 +564,8 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo,
}//if
const Uint32 totalSizeInWords = (sizeInBytes + 3)/4; // Including bits in last word
const Uint32 sizeInWords = sizeInBytes / 4; // Excluding bits in last word
ah.setDataSize(totalSizeInWords);
AttributeHeader& ah = AttributeHeader::init(&ahValue, tAttrId,
totalSizeInWords);
insertATTRINFO( ahValue );
/***********************************************************************