#At file:///home/frazer/bzr/mysql-5.1-telco-6.3/
2915 Frazer Clement 2009-03-23
Fix testBlobs unique index write with correction to fix for bug#42238 (NdbRecord Pk ambiguity)
modified:
storage/ndb/src/ndbapi/NdbOperationExec.cpp
=== modified file 'storage/ndb/src/ndbapi/NdbOperationExec.cpp'
--- a/storage/ndb/src/ndbapi/NdbOperationExec.cpp 2009-03-17 00:58:30 +0000
+++ b/storage/ndb/src/ndbapi/NdbOperationExec.cpp 2009-03-23 18:06:33 +0000
@@ -923,8 +923,17 @@ NdbOperation::buildSignalsNdbRecord(Uint
if (likely(!(col->flags & (NdbRecord::IsBlob|NdbRecord::IsMysqldBitfield))))
{
- if (( ! (col->flags & NdbRecord::IsKey)) ||
- ( isScanTakeover ) )
+ int idxColNum= -1;
+ const NdbRecord::Attr* idxCol= NULL;
+
+ /* Take data from the key row for key columns, attr row otherwise
+ * Always attr row for scan takeover
+ */
+ if (( isScanTakeover ) ||
+ ( ( key_rec->m_attrId_indexes_length <= attrId) ||
+ ( (idxColNum= key_rec->m_attrId_indexes[attrId]) == -1 ) ||
+ ( ! (idxCol= &key_rec->columns[idxColNum] )) ||
+ ( ! (idxCol->flags & NdbRecord::IsKey)) ) )
{
/* Normal path where we get data from the attr row
* Always get ATTRINFO data from the attr row for ScanTakeover
@@ -944,17 +953,18 @@ NdbOperation::buildSignalsNdbRecord(Uint
}
else
{
- /* For Insert/Write where user provides PK columns,
+ /* For Insert/Write where user provides key columns,
* take them from the key record row to avoid sending different
* values in KeyInfo and AttrInfo
* Need the correct Attr struct from the key
* record
+ * Note that the key record could be for a unique index.
*/
assert(key_rec != 0); /* Not scan takeover */
assert(key_rec->m_attrId_indexes_length > attrId);
- int keyColIdx= key_rec->m_attrId_indexes[attrId];
- assert(keyColIdx != -1);
- col= &key_rec->columns[keyColIdx];
+ assert(key_rec->m_attrId_indexes[attrId] != -1);
+ assert(idxCol != NULL);
+ col= idxCol;
assert(col->attrId == attrId);
assert(col->flags & NdbRecord::IsKey);
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-6.3 branch (frazer:2915) Bug#42238 | Frazer Clement | 23 Mar |