Commit 87c5e84f authored by unknown's avatar unknown

Bug #25275 SINGLE USER MODE prevents ALTER on non-ndb tables for other mysqld nodes

(part 1)
- add signal data
- add ref in dict on create/drop table/index

parent 1301de42
...@@ -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
}; };
}; };
......
...@@ -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){
...@@ -5401,6 +5419,15 @@ Dbdict::execDROP_TABLE_REQ(Signal* signal){ ...@@ -5401,6 +5419,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){
...@@ -6531,6 +6558,13 @@ Dbdict::execCREATE_INDX_REQ(Signal* signal) ...@@ -6531,6 +6558,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;
...@@ -7101,6 +7135,13 @@ Dbdict::execDROP_INDX_REQ(Signal* signal) ...@@ -7101,6 +7135,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;
......
...@@ -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" },
......
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