diff options
author | unknown <pekka@mysql.com> | 2004-11-01 16:04:36 +0100 |
---|---|---|
committer | unknown <pekka@mysql.com> | 2004-11-01 16:04:36 +0100 |
commit | 04ff58d5e4837c28afca0eec91f9fb1b31b9cb02 (patch) | |
tree | b01fda23e290bc57c168be3592bd3cc1f6b39b8a /ndb | |
parent | 62f23cadd89a95a2f9893dced57bac550db161cf (diff) | |
download | mariadb-git-04ff58d5e4837c28afca0eec91f9fb1b31b9cb02.tar.gz |
NDB blobs restore backwards compatibility
ndb/src/ndbapi/NdbBlob.cpp:
restore backwards compatibility
Diffstat (limited to 'ndb')
-rw-r--r-- | ndb/src/ndbapi/NdbBlob.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index 13532a413bb..731f32ba916 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -97,22 +97,21 @@ NdbBlob::getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnIm bt.setName(btname); bt.setLogging(t->getLogging()); bt.setFragmentType(t->getFragmentType()); - { NdbDictionary::Column bc("PK"); + { NdbDictionary::Column bc("DIST"); bc.setType(NdbDictionary::Column::Unsigned); - assert(t->m_sizeOfKeysInWords != 0); - bc.setLength(t->m_sizeOfKeysInWords); bc.setPrimaryKey(true); bc.setDistributionKey(true); bt.addColumn(bc); } - { NdbDictionary::Column bc("DIST"); + { NdbDictionary::Column bc("PART"); bc.setType(NdbDictionary::Column::Unsigned); bc.setPrimaryKey(true); - bc.setDistributionKey(true); bt.addColumn(bc); } - { NdbDictionary::Column bc("PART"); + { NdbDictionary::Column bc("PK"); bc.setType(NdbDictionary::Column::Unsigned); + assert(t->m_sizeOfKeysInWords != 0); + bc.setLength(t->m_sizeOfKeysInWords); bc.setPrimaryKey(true); bt.addColumn(bc); } @@ -309,7 +308,7 @@ inline Uint32 NdbBlob::getDistKey(Uint32 part) { assert(theStripeSize != 0); - return part / theStripeSize; + return (part / theStripeSize) % theStripeSize; } // getters and setters @@ -393,9 +392,9 @@ NdbBlob::setPartKeyValue(NdbOperation* anOp, Uint32 part) Uint32* data = (Uint32*)theKeyBuf.data; unsigned size = theTable->m_sizeOfKeysInWords; DBG("setPartKeyValue dist=" << getDistKey(part) << " part=" << part << " key=" << ndb_blob_debug(data, size)); - if (anOp->equal((Uint32)0, theKeyBuf.data) == -1 || - anOp->equal((Uint32)1, getDistKey(part)) == -1 || - anOp->equal((Uint32)2, part) == -1) { + if (anOp->equal((Uint32)0, getDistKey(part)) == -1 || + anOp->equal((Uint32)1, part) == -1 || + anOp->equal((Uint32)2, theKeyBuf.data) == -1) { setErrorCode(anOp); return -1; } |