MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Frazer Clement Date:March 25 2009 6:54pm
Subject:bzr commit into mysql-5.1-telco-6.2 branch (frazer:2890) Bug#42238
View as plain text  
#At file:///home/frazer/bzr/mysql-5.1-telco-6.2/

 2890 Frazer Clement	2009-03-25
      Fix testBlobs unique index write with correction to fix for bug#42238 (NdbRecord Pk Ambiguity) - apply to 6.2
      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:51:41 +0000
+++ b/storage/ndb/src/ndbapi/NdbOperationExec.cpp	2009-03-25 18:54:39 +0000
@@ -870,8 +870,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
@@ -891,17 +900,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.2 branch (frazer:2890) Bug#42238Frazer Clement25 Mar