Commit 65a0ee5f authored by tomas@poseidon.mysql.com's avatar tomas@poseidon.mysql.com

Merge poseidon.mysql.com:/home/tomas/mysql-5.0

into  poseidon.mysql.com:/home/tomas/mysql-5.0-ndb
parents 2f5a2b24 4fed7eb8
...@@ -130,7 +130,8 @@ public: ...@@ -130,7 +130,8 @@ public:
NullablePrimaryKey = 740, NullablePrimaryKey = 740,
UnsupportedChange = 741, UnsupportedChange = 741,
BackupInProgress = 762, BackupInProgress = 762,
IncompatibleVersions = 763 IncompatibleVersions = 763,
SingleUser = 299
}; };
private: private:
......
...@@ -206,7 +206,8 @@ public: ...@@ -206,7 +206,8 @@ public:
NotUnique = 4251, NotUnique = 4251,
AllocationError = 4252, AllocationError = 4252,
CreateIndexTableFailed = 4253, CreateIndexTableFailed = 4253,
DuplicateAttributes = 4258 DuplicateAttributes = 4258,
SingleUser = 299
}; };
CreateIndxConf m_conf; CreateIndxConf m_conf;
......
...@@ -91,7 +91,8 @@ public: ...@@ -91,7 +91,8 @@ public:
RecordTooBig = 738, RecordTooBig = 738,
InvalidPrimaryKeySize = 739, InvalidPrimaryKeySize = 739,
NullablePrimaryKey = 740, NullablePrimaryKey = 740,
InvalidCharset = 743 InvalidCharset = 743,
SingleUser = 299
}; };
private: private:
......
...@@ -172,7 +172,8 @@ public: ...@@ -172,7 +172,8 @@ public:
IndexNotFound = 4243, IndexNotFound = 4243,
BadRequestType = 4247, BadRequestType = 4247,
InvalidName = 4248, InvalidName = 4248,
NotAnIndex = 4254 NotAnIndex = 4254,
SingleUser = 299
}; };
STATIC_CONST( SignalLength = DropIndxConf::SignalLength + 3 ); STATIC_CONST( SignalLength = DropIndxConf::SignalLength + 3 );
......
...@@ -58,7 +58,8 @@ public: ...@@ -58,7 +58,8 @@ public:
InvalidTableVersion = 241, InvalidTableVersion = 241,
DropInProgress = 283, DropInProgress = 283,
NoDropTableRecordAvailable = 1229, NoDropTableRecordAvailable = 1229,
BackupInProgress = 761 BackupInProgress = 761,
SingleUser = 299
}; };
}; };
......
...@@ -926,7 +926,7 @@ const EventLoggerBase::EventRepLogLevelMatrix EventLoggerBase::matrix[] = { ...@@ -926,7 +926,7 @@ const EventLoggerBase::EventRepLogLevelMatrix EventLoggerBase::matrix[] = {
ROW(NDBStopCompleted, LogLevel::llStartUp, 1, Logger::LL_INFO ), ROW(NDBStopCompleted, LogLevel::llStartUp, 1, Logger::LL_INFO ),
ROW(NDBStopForced, LogLevel::llStartUp, 1, Logger::LL_ALERT ), ROW(NDBStopForced, LogLevel::llStartUp, 1, Logger::LL_ALERT ),
ROW(NDBStopAborted, LogLevel::llStartUp, 1, Logger::LL_INFO ), ROW(NDBStopAborted, LogLevel::llStartUp, 1, Logger::LL_INFO ),
ROW(StartREDOLog, LogLevel::llStartUp, 10, Logger::LL_INFO ), ROW(StartREDOLog, LogLevel::llStartUp, 4, Logger::LL_INFO ),
ROW(StartLog, LogLevel::llStartUp, 10, Logger::LL_INFO ), ROW(StartLog, LogLevel::llStartUp, 10, Logger::LL_INFO ),
ROW(UNDORecordsExecuted, LogLevel::llStartUp, 15, Logger::LL_INFO ), ROW(UNDORecordsExecuted, LogLevel::llStartUp, 15, Logger::LL_INFO ),
ROW(StartReport, LogLevel::llStartUp, 4, Logger::LL_INFO ), ROW(StartReport, LogLevel::llStartUp, 4, Logger::LL_INFO ),
......
...@@ -96,6 +96,8 @@ printPACKED_SIGNAL(FILE * output, const Uint32 * theData, Uint32 len, Uint16 rec ...@@ -96,6 +96,8 @@ printPACKED_SIGNAL(FILE * output, const Uint32 * theData, Uint32 len, Uint16 rec
} }
default: default:
fprintf(output, "Unknown signal type\n"); fprintf(output, "Unknown signal type\n");
i = len; // terminate printing
break;
} }
}//for }//for
fprintf(output, "--------- End Packed Signals ----------\n"); fprintf(output, "--------- End Packed Signals ----------\n");
......
...@@ -2910,6 +2910,15 @@ Dbdict::execCREATE_TABLE_REQ(Signal* signal){ ...@@ -2910,6 +2910,15 @@ Dbdict::execCREATE_TABLE_REQ(Signal* signal){
break; break;
} }
if(getNodeState().getSingleUserMode() &&
(refToNode(signal->getSendersBlockRef()) !=
getNodeState().getSingleUserApi()))
{
jam();
parseRecord.errorCode = CreateTableRef::SingleUser;
break;
}
CreateTableRecordPtr createTabPtr; CreateTableRecordPtr createTabPtr;
c_opCreateTable.seize(createTabPtr); c_opCreateTable.seize(createTabPtr);
...@@ -3072,6 +3081,15 @@ Dbdict::execALTER_TABLE_REQ(Signal* signal) ...@@ -3072,6 +3081,15 @@ Dbdict::execALTER_TABLE_REQ(Signal* signal)
return; return;
} }
if(getNodeState().getSingleUserMode() &&
(refToNode(signal->getSendersBlockRef()) !=
getNodeState().getSingleUserApi()))
{
jam();
alterTableRef(signal, req, AlterTableRef::SingleUser);
return;
}
const TableRecord::TabState tabState = tablePtr.p->tabState; const TableRecord::TabState tabState = tablePtr.p->tabState;
bool ok = false; bool ok = false;
switch(tabState){ switch(tabState){
...@@ -5396,6 +5414,15 @@ Dbdict::execDROP_TABLE_REQ(Signal* signal){ ...@@ -5396,6 +5414,15 @@ Dbdict::execDROP_TABLE_REQ(Signal* signal){
return; return;
} }
if(getNodeState().getSingleUserMode() &&
(refToNode(signal->getSendersBlockRef()) !=
getNodeState().getSingleUserApi()))
{
jam();
dropTableRef(signal, req, DropTableRef::SingleUser);
return;
}
const TableRecord::TabState tabState = tablePtr.p->tabState; const TableRecord::TabState tabState = tablePtr.p->tabState;
bool ok = false; bool ok = false;
switch(tabState){ switch(tabState){
...@@ -6526,6 +6553,13 @@ Dbdict::execCREATE_INDX_REQ(Signal* signal) ...@@ -6526,6 +6553,13 @@ Dbdict::execCREATE_INDX_REQ(Signal* signal)
jam(); jam();
tmperr = CreateIndxRef::Busy; tmperr = CreateIndxRef::Busy;
} }
else if(getNodeState().getSingleUserMode() &&
(refToNode(senderRef) !=
getNodeState().getSingleUserApi()))
{
jam();
tmperr = CreateIndxRef::SingleUser;
}
if (tmperr != CreateIndxRef::NoError) { if (tmperr != CreateIndxRef::NoError) {
releaseSections(signal); releaseSections(signal);
OpCreateIndex opBusy; OpCreateIndex opBusy;
...@@ -7096,6 +7130,13 @@ Dbdict::execDROP_INDX_REQ(Signal* signal) ...@@ -7096,6 +7130,13 @@ Dbdict::execDROP_INDX_REQ(Signal* signal)
jam(); jam();
tmperr = DropIndxRef::Busy; tmperr = DropIndxRef::Busy;
} }
else if(getNodeState().getSingleUserMode() &&
(refToNode(senderRef) !=
getNodeState().getSingleUserApi()))
{
jam();
tmperr = DropIndxRef::SingleUser;
}
if (tmperr != DropIndxRef::NoError) { if (tmperr != DropIndxRef::NoError) {
err = tmperr; err = tmperr;
goto error; goto error;
......
...@@ -456,6 +456,7 @@ void Dblqh::execCONTINUEB(Signal* signal) ...@@ -456,6 +456,7 @@ void Dblqh::execCONTINUEB(Signal* signal)
else else
{ {
jam(); jam();
cstartRecReq = 2;
StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend(); StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend();
conf->startingNodeId = getOwnNodeId(); conf->startingNodeId = getOwnNodeId();
sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal, sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal,
...@@ -11665,7 +11666,7 @@ void Dblqh::execGCP_SAVEREQ(Signal* signal) ...@@ -11665,7 +11666,7 @@ void Dblqh::execGCP_SAVEREQ(Signal* signal)
return; return;
} }
if(getNodeState().getNodeRestartInProgress() && cstartRecReq == ZFALSE) if(getNodeState().getNodeRestartInProgress() && cstartRecReq < 2)
{ {
GCPSaveRef * const saveRef = (GCPSaveRef*)&signal->theData[0]; GCPSaveRef * const saveRef = (GCPSaveRef*)&signal->theData[0];
saveRef->dihPtr = dihPtr; saveRef->dihPtr = dihPtr;
...@@ -11942,6 +11943,10 @@ void Dblqh::execFSCLOSECONF(Signal* signal) ...@@ -11942,6 +11943,10 @@ void Dblqh::execFSCLOSECONF(Signal* signal)
// Set the prev file to check if we shall close it. // Set the prev file to check if we shall close it.
logFilePtr.i = logFilePtr.p->prevLogFile; logFilePtr.i = logFilePtr.p->prevLogFile;
ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord); ptrCheckGuard(logFilePtr, clogFileFileSize, logFileRecord);
logPartPtr.i = logFilePtr.p->logPartRec;
ptrCheckGuard(logPartPtr, clogPartFileSize, logPartRecord);
exitFromInvalidate(signal); exitFromInvalidate(signal);
return; return;
case LogFileRecord::CLOSING_INIT: case LogFileRecord::CLOSING_INIT:
...@@ -13810,7 +13815,7 @@ void Dblqh::srCompletedLab(Signal* signal) ...@@ -13810,7 +13815,7 @@ void Dblqh::srCompletedLab(Signal* signal)
* NO MORE FRAGMENTS ARE WAITING FOR SYSTEM RESTART. * NO MORE FRAGMENTS ARE WAITING FOR SYSTEM RESTART.
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
lcpPtr.p->lcpState = LcpRecord::LCP_IDLE; lcpPtr.p->lcpState = LcpRecord::LCP_IDLE;
if (cstartRecReq == ZTRUE) { if (cstartRecReq == 1) {
jam(); jam();
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* WE HAVE ALSO RECEIVED AN INDICATION THAT NO MORE FRAGMENTS * WE HAVE ALSO RECEIVED AN INDICATION THAT NO MORE FRAGMENTS
...@@ -13880,7 +13885,7 @@ void Dblqh::execSTART_RECREQ(Signal* signal) ...@@ -13880,7 +13885,7 @@ void Dblqh::execSTART_RECREQ(Signal* signal)
ndbrequire(req->receivingNodeId == cownNodeid); ndbrequire(req->receivingNodeId == cownNodeid);
cnewestCompletedGci = cnewestGci; cnewestCompletedGci = cnewestGci;
cstartRecReq = ZTRUE; cstartRecReq = 1;
for (logPartPtr.i = 0; logPartPtr.i < 4; logPartPtr.i++) { for (logPartPtr.i = 0; logPartPtr.i < 4; logPartPtr.i++) {
ptrAss(logPartPtr, logPartRecord); ptrAss(logPartPtr, logPartRecord);
logPartPtr.p->logPartNewestCompletedGCI = cnewestCompletedGci; logPartPtr.p->logPartNewestCompletedGCI = cnewestCompletedGci;
...@@ -13901,6 +13906,7 @@ void Dblqh::execSTART_RECREQ(Signal* signal) ...@@ -13901,6 +13906,7 @@ void Dblqh::execSTART_RECREQ(Signal* signal)
}//if }//if
if(cstartType == NodeState::ST_INITIAL_NODE_RESTART){ if(cstartType == NodeState::ST_INITIAL_NODE_RESTART){
jam(); jam();
cstartRecReq = 2;
StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend(); StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend();
conf->startingNodeId = getOwnNodeId(); conf->startingNodeId = getOwnNodeId();
sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal, sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal,
...@@ -15719,6 +15725,7 @@ void Dblqh::srFourthComp(Signal* signal) ...@@ -15719,6 +15725,7 @@ void Dblqh::srFourthComp(Signal* signal)
else else
{ {
jam(); jam();
cstartRecReq = 2;
StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend(); StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend();
conf->startingNodeId = getOwnNodeId(); conf->startingNodeId = getOwnNodeId();
sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal, sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal,
...@@ -16685,7 +16692,7 @@ void Dblqh::initialiseRecordsLab(Signal* signal, Uint32 data, ...@@ -16685,7 +16692,7 @@ void Dblqh::initialiseRecordsLab(Signal* signal, Uint32 data,
cCommitBlocked = false; cCommitBlocked = false;
ccurrentGcprec = RNIL; ccurrentGcprec = RNIL;
caddNodeState = ZFALSE; caddNodeState = ZFALSE;
cstartRecReq = ZFALSE; cstartRecReq = 0;
cnewestGci = (UintR)-1; cnewestGci = (UintR)-1;
cnewestCompletedGci = (UintR)-1; cnewestCompletedGci = (UintR)-1;
crestartOldestGci = 0; crestartOldestGci = 0;
......
...@@ -346,24 +346,24 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) ...@@ -346,24 +346,24 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r)
} }
break; break;
case NdbDictionary::Column::Blob: case NdbDictionary::Column::Blob:
{
const NdbBlob::Head* h = (const NdbBlob::Head*)r.aRef();
out << h->length << ":";
const unsigned char* p = (const unsigned char*)(h + 1);
unsigned n = r.arraySize() - sizeof(*h);
for (unsigned k = 0; k < n && k < h->length; k++)
out.print("%02X", (int)p[k]);
j = length;
}
break;
case NdbDictionary::Column::Text: case NdbDictionary::Column::Text:
{ {
const NdbBlob::Head* h = (const NdbBlob::Head*)r.aRef(); // user defined aRef() may not be aligned to Uint64
out << h->length << ":"; NdbBlob::Head head;
const unsigned char* p = (const unsigned char*)(h + 1); memcpy(&head, r.aRef(), sizeof(head));
unsigned n = r.arraySize() - sizeof(*h); out << head.length << ":";
for (unsigned k = 0; k < n && k < h->length; k++) const unsigned char* p = (const unsigned char*)r.aRef() + sizeof(head);
if (r.arraySize() < sizeof(head))
out << "***error***"; // really cannot happen
else {
unsigned n = r.arraySize() - sizeof(head);
for (unsigned k = 0; k < n && k < head.length; k++) {
if (r.getType() == NdbDictionary::Column::Blob)
out.print("%02X", (int)p[k]);
else
out.print("%c", (int)p[k]); out.print("%c", (int)p[k]);
}
}
j = length; j = length;
} }
break; break;
......
...@@ -264,6 +264,7 @@ ErrorBundle ErrorCodes[] = { ...@@ -264,6 +264,7 @@ ErrorBundle ErrorCodes[] = {
/** /**
* Application error * Application error
*/ */
{ 299, AE, "Operation not allowed or aborted due to single user mode" },
{ 763, AE, "Alter table requires cluster nodes to have exact same version" }, { 763, AE, "Alter table requires cluster nodes to have exact same version" },
{ 823, AE, "Too much attrinfo from application in tuple manager" }, { 823, AE, "Too much attrinfo from application in tuple manager" },
{ 831, AE, "Too many nullable/bitfields in table definition" }, { 831, AE, "Too many nullable/bitfields in table definition" },
......
...@@ -54,7 +54,12 @@ BackupFile::Twiddle(const AttributeDesc* attr_desc, AttributeData* attr_data, Ui ...@@ -54,7 +54,12 @@ BackupFile::Twiddle(const AttributeDesc* attr_desc, AttributeData* attr_data, Ui
return true; return true;
case 64: case 64:
for(i = 0; i<arraySize; i++){ for(i = 0; i<arraySize; i++){
attr_data->u_int64_value[i] = Twiddle64(attr_data->u_int64_value[i]); // allow unaligned
char* p = (char*)&attr_data->u_int64_value[i];
Uint64 x;
memcpy(&x, p, sizeof(Uint64));
x = Twiddle64(x);
memcpy(p, &x, sizeof(Uint64));
} }
return true; return true;
default: default:
......
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