ndb - backup/restore, fix count of dist keys
better fix for bug#10190 ndb/src/ndbapi/NdbDictionaryImpl.cpp: better fix for bug#10190
This commit is contained in:
parent
e37db41fed
commit
202c149a46
@ -1605,6 +1605,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
|
|||||||
|
|
||||||
bool haveAutoIncrement = false;
|
bool haveAutoIncrement = false;
|
||||||
Uint64 autoIncrementValue = 0;
|
Uint64 autoIncrementValue = 0;
|
||||||
|
Uint32 distKeys= 0;
|
||||||
for(i = 0; i<sz; i++){
|
for(i = 0; i<sz; i++){
|
||||||
const NdbColumnImpl * col = impl.m_columns[i];
|
const NdbColumnImpl * col = impl.m_columns[i];
|
||||||
if(col == 0)
|
if(col == 0)
|
||||||
@ -1616,7 +1617,9 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
|
|||||||
}
|
}
|
||||||
haveAutoIncrement = true;
|
haveAutoIncrement = true;
|
||||||
autoIncrementValue = col->m_autoIncrementInitialValue;
|
autoIncrementValue = col->m_autoIncrementInitialValue;
|
||||||
}
|
}
|
||||||
|
if (col->m_distributionKey)
|
||||||
|
distKeys++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check max length of frm data
|
// Check max length of frm data
|
||||||
@ -1649,10 +1652,9 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
int distKeys= impl.m_noOfDistributionKeys &&
|
if (distKeys == impl.m_noOfKeys)
|
||||||
impl.m_noOfDistributionKeys < impl.m_noOfKeys;
|
distKeys= 0;
|
||||||
|
impl.m_noOfDistributionKeys= distKeys;
|
||||||
assert(distKeys == 0 || distKeys == 1);
|
|
||||||
|
|
||||||
for(i = 0; i<sz; i++){
|
for(i = 0; i<sz; i++){
|
||||||
const NdbColumnImpl * col = impl.m_columns[i];
|
const NdbColumnImpl * col = impl.m_columns[i];
|
||||||
@ -1665,7 +1667,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
|
|||||||
tmpAttr.AttributeId = i;
|
tmpAttr.AttributeId = i;
|
||||||
tmpAttr.AttributeKeyFlag = col->m_pk;
|
tmpAttr.AttributeKeyFlag = col->m_pk;
|
||||||
tmpAttr.AttributeNullableFlag = col->m_nullable;
|
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.AttributeExtType = (Uint32)col->m_type;
|
||||||
tmpAttr.AttributeExtPrecision = ((unsigned)col->m_precision & 0xFFFF);
|
tmpAttr.AttributeExtPrecision = ((unsigned)col->m_precision & 0xFFFF);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user