Commit d831ff26 authored by unknown's avatar unknown

corrected some erroneous size calculations in tup

    fixed erroneous error message - set auto increment was done even if create table failed so real error message got lost behind "table not found"
    and simplified code a bit


ndb/src/kernel/vm/Configuration.cpp:
  corrected some erroneous size calculations
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  fixed erroneous error message - set auto increment was done even if create table failed so real error message got lost behind "table not found"
  and simplified code a bit
parent 77c163c3
...@@ -750,8 +750,8 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ ...@@ -750,8 +750,8 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){
noOfMetaTables); noOfMetaTables);
cfg.put(CFG_TUP_TABLE_DESC, cfg.put(CFG_TUP_TABLE_DESC,
4 * NO_OF_FRAG_PER_NODE * noOfAttributes* noOfReplicas + 2 * 6 * NO_OF_FRAG_PER_NODE * noOfAttributes * noOfReplicas +
12 * NO_OF_FRAG_PER_NODE * noOfMetaTables* noOfReplicas ); 2 * 10 * NO_OF_FRAG_PER_NODE * noOfMetaTables * noOfReplicas );
cfg.put(CFG_TUP_STORED_PROC, cfg.put(CFG_TUP_STORED_PROC,
noOfLocalScanRecords); noOfLocalScanRecords);
......
...@@ -1571,7 +1571,13 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, ...@@ -1571,7 +1571,13 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
NdbApiSignal tSignal(m_reference); NdbApiSignal tSignal(m_reference);
tSignal.theReceiversBlockNumber = DBDICT; tSignal.theReceiversBlockNumber = DBDICT;
if (alter) {
LinearSectionPtr ptr[3];
ptr[0].p = (Uint32*)m_buffer.get_data();
ptr[0].sz = m_buffer.length() / 4;
int ret;
if (alter)
{
AlterTableReq * const req = AlterTableReq * const req =
CAST_PTR(AlterTableReq, tSignal.getDataPtrSend()); CAST_PTR(AlterTableReq, tSignal.getDataPtrSend());
...@@ -1582,8 +1588,10 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, ...@@ -1582,8 +1588,10 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
req->tableVersion = impl.m_version;; req->tableVersion = impl.m_version;;
tSignal.theVerId_signalNumber = GSN_ALTER_TABLE_REQ; tSignal.theVerId_signalNumber = GSN_ALTER_TABLE_REQ;
tSignal.theLength = AlterTableReq::SignalLength; tSignal.theLength = AlterTableReq::SignalLength;
ret= alterTable(&tSignal, ptr);
} }
else { else
{
CreateTableReq * const req = CreateTableReq * const req =
CAST_PTR(CreateTableReq, tSignal.getDataPtrSend()); CAST_PTR(CreateTableReq, tSignal.getDataPtrSend());
...@@ -1591,17 +1599,12 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, ...@@ -1591,17 +1599,12 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
req->senderData = 0; req->senderData = 0;
tSignal.theVerId_signalNumber = GSN_CREATE_TABLE_REQ; tSignal.theVerId_signalNumber = GSN_CREATE_TABLE_REQ;
tSignal.theLength = CreateTableReq::SignalLength; tSignal.theLength = CreateTableReq::SignalLength;
} ret= createTable(&tSignal, ptr);
LinearSectionPtr ptr[3];
ptr[0].p = (Uint32*)m_buffer.get_data();
ptr[0].sz = m_buffer.length() / 4;
int ret = (alter) ? if (ret)
alterTable(&tSignal, ptr) return ret;
: createTable(&tSignal, ptr);
if (!alter && haveAutoIncrement) { if (haveAutoIncrement) {
if (!ndb.setAutoIncrementValue(impl.m_externalName.c_str(), if (!ndb.setAutoIncrementValue(impl.m_externalName.c_str(),
autoIncrementValue)) { autoIncrementValue)) {
if (ndb.theError.code == 0) { if (ndb.theError.code == 0) {
...@@ -1612,6 +1615,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, ...@@ -1612,6 +1615,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
ret = -1; // errorcode set in initialize_autoincrement ret = -1; // errorcode set in initialize_autoincrement
} }
} }
}
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment