From 202c149a46f6b59f68cfb7d1707f7e641be9cc0d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Jun 2005 12:50:42 +0200 Subject: [PATCH] ndb - backup/restore, fix count of dist keys better fix for bug#10190 ndb/src/ndbapi/NdbDictionaryImpl.cpp: better fix for bug#10190 --- ndb/src/ndbapi/NdbDictionaryImpl.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 28e585b65b8..6ecaf54b888 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -1605,6 +1605,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, bool haveAutoIncrement = false; Uint64 autoIncrementValue = 0; + Uint32 distKeys= 0; for(i = 0; im_autoIncrementInitialValue; - } + } + if (col->m_distributionKey) + distKeys++; } // Check max length of frm data @@ -1649,11 +1652,10 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, abort(); } - int distKeys= impl.m_noOfDistributionKeys && - impl.m_noOfDistributionKeys < impl.m_noOfKeys; + if (distKeys == impl.m_noOfKeys) + distKeys= 0; + impl.m_noOfDistributionKeys= distKeys; - assert(distKeys == 0 || distKeys == 1); - for(i = 0; im_pk; tmpAttr.AttributeNullableFlag = col->m_nullable; - tmpAttr.AttributeDKey = distKeys * col->m_distributionKey; + tmpAttr.AttributeDKey = distKeys ? col->m_distributionKey : 0; tmpAttr.AttributeExtType = (Uint32)col->m_type; tmpAttr.AttributeExtPrecision = ((unsigned)col->m_precision & 0xFFFF);