Commit 0ec5020e authored by jonas@perch.ndb.mysql.com's avatar jonas@perch.ndb.mysql.com

Merge perch.ndb.mysql.com:/home/jonas/src/51-work

into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
parents e9c81789 f05e5e8c
......@@ -212,7 +212,8 @@ public:
NullablePrimaryKey = 740,
UnsupportedChange = 741,
BackupInProgress = 762,
IncompatibleVersions = 763
IncompatibleVersions = 763,
SingleUser = 299
};
private:
......
......@@ -208,6 +208,7 @@ public:
AllocationError = 4252,
CreateIndexTableFailed = 4253,
DuplicateAttributes = 4258,
SingleUser = 299,
TableIsTemporary = 776,
TableIsNotTemporary = 777,
NoLoggingTemporaryIndex = 778
......
......@@ -92,6 +92,7 @@ public:
InvalidPrimaryKeySize = 739,
NullablePrimaryKey = 740,
InvalidCharset = 743,
SingleUser = 299,
InvalidTablespace = 755,
VarsizeBitfieldNotSupported = 757,
NotATablespace = 758,
......
......@@ -172,7 +172,8 @@ public:
IndexNotFound = 4243,
BadRequestType = 4247,
InvalidName = 4248,
NotAnIndex = 4254
NotAnIndex = 4254,
SingleUser = 299
};
STATIC_CONST( SignalLength = DropIndxConf::SignalLength + 3 );
......
......@@ -58,7 +58,8 @@ public:
InvalidTableVersion = 241,
DropInProgress = 283,
NoDropTableRecordAvailable = 1229,
BackupInProgress = 761
BackupInProgress = 761,
SingleUser = 299
};
};
......
......@@ -96,6 +96,8 @@ printPACKED_SIGNAL(FILE * output, const Uint32 * theData, Uint32 len, Uint16 rec
}
default:
fprintf(output, "Unknown signal type\n");
i = len; // terminate printing
break;
}
}//for
fprintf(output, "--------- End Packed Signals ----------\n");
......
......@@ -3759,6 +3759,15 @@ Dbdict::execCREATE_TABLE_REQ(Signal* signal){
break;
}
if(getNodeState().getSingleUserMode() &&
(refToNode(signal->getSendersBlockRef()) !=
getNodeState().getSingleUserApi()))
{
jam();
parseRecord.errorCode = CreateTableRef::SingleUser;
break;
}
CreateTableRecordPtr createTabPtr;
c_opCreateTable.seize(createTabPtr);
......@@ -3951,6 +3960,15 @@ Dbdict::execALTER_TABLE_REQ(Signal* signal)
return;
}
if(getNodeState().getSingleUserMode() &&
(refToNode(signal->getSendersBlockRef()) !=
getNodeState().getSingleUserApi()))
{
jam();
alterTableRef(signal, req, AlterTableRef::SingleUser);
return;
}
const TableRecord::TabState tabState = tablePtr.p->tabState;
bool ok = false;
switch(tabState){
......@@ -6545,6 +6563,15 @@ Dbdict::execDROP_TABLE_REQ(Signal* signal){
return;
}
if(getNodeState().getSingleUserMode() &&
(refToNode(signal->getSendersBlockRef()) !=
getNodeState().getSingleUserApi()))
{
jam();
dropTableRef(signal, req, DropTableRef::SingleUser);
return;
}
const TableRecord::TabState tabState = tablePtr.p->tabState;
bool ok = false;
switch(tabState){
......@@ -7753,6 +7780,13 @@ Dbdict::execCREATE_INDX_REQ(Signal* signal)
jam();
tmperr = CreateIndxRef::Busy;
}
else if(getNodeState().getSingleUserMode() &&
(refToNode(senderRef) !=
getNodeState().getSingleUserApi()))
{
jam();
tmperr = CreateIndxRef::SingleUser;
}
if (tmperr != CreateIndxRef::NoError) {
releaseSections(signal);
OpCreateIndex opBusy;
......@@ -8396,6 +8430,13 @@ Dbdict::execDROP_INDX_REQ(Signal* signal)
jam();
tmperr = DropIndxRef::Busy;
}
else if(getNodeState().getSingleUserMode() &&
(refToNode(senderRef) !=
getNodeState().getSingleUserApi()))
{
jam();
tmperr = DropIndxRef::SingleUser;
}
if (tmperr != DropIndxRef::NoError) {
err = tmperr;
goto error;
......
......@@ -14233,7 +14233,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
}
if(arg == DumpStateOrd::EnableUndoDelayDataWrite){
g_eventLogger.info("Dbdih:: delay write of datapages for table = %s",
g_eventLogger.info("Dbdih:: delay write of datapages for table = %d",
dumpState->args[1]);
// Send this dump to ACC and TUP
EXECUTE_DIRECT(DBACC, GSN_DUMP_STATE_ORD, signal, 2);
......
......@@ -283,6 +283,7 @@ ErrorBundle ErrorCodes[] = {
/**
* Application error
*/
{ 299, DMEC, AE, "Operation not allowed or aborted due to single user mode" },
{ 763, DMEC, AE, "Alter table requires cluster nodes to have exact same version" },
{ 823, DMEC, AE, "Too much attrinfo from application in tuple manager" },
{ 831, DMEC, AE, "Too many nullable/bitfields in table definition" },
......
......@@ -667,6 +667,8 @@ BackupRestore::update_apply_status(const RestoreMetaData &metaData)
bool
BackupRestore::createSystable(const TableS & tables){
if (!m_restore && !m_restore_meta && !m_restore_epoch)
return true;
const char *tablename = tables.getTableName();
if( strcmp(tablename, NDB_REP_DB "/def/" NDB_APPLY_TABLE) != 0 &&
......
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