summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2004-09-23 09:25:05 +0200
committerunknown <joreland@mysql.com>2004-09-23 09:25:05 +0200
commit8090516c5250f1d1873adf5f312fc16e70e3f6be (patch)
treeff2e96a36e1b8b1d845e49035143bbdd0c606f5c /ndb
parent99e809cbd944a58417a851b37db4848d6661bbb0 (diff)
downloadmariadb-git-8090516c5250f1d1873adf5f312fc16e70e3f6be.tar.gz
bug#5702
Check index version already in master to prevent "non-atmoic" failing drop index ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Check index version already in master to prevent "non-atmoic" failing drop index
Diffstat (limited to 'ndb')
-rw-r--r--ndb/src/kernel/blocks/dbdict/Dbdict.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
index 4757f1d2bf3..b214538bce0 100644
--- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
@@ -6545,6 +6545,8 @@ Dbdict::execDROP_INDX_REQ(Signal* signal)
jamEntry();
DropIndxReq* const req = (DropIndxReq*)signal->getDataPtrSend();
OpDropIndexPtr opPtr;
+
+ int err = DropIndxRef::BadRequestType;
const Uint32 senderRef = signal->senderBlockRef();
const DropIndxReq::RequestType requestType = req->getRequestType();
if (requestType == DropIndxReq::RT_USER) {
@@ -6559,6 +6561,20 @@ Dbdict::execDROP_INDX_REQ(Signal* signal)
return;
}
// forward initial request plus operation key to all
+ Uint32 indexId= req->getIndexId();
+ Uint32 indexVersion= req->getIndexVersion();
+ TableRecordPtr tmp;
+ int res = getMetaTablePtr(tmp, indexId, indexVersion);
+ switch(res){
+ case MetaData::InvalidArgument:
+ case MetaData::TableNotFound:
+ err = DropTableRef::NoSuchTable;
+ goto error;
+ case MetaData::InvalidTableVersion:
+ err = DropIndxRef::InvalidIndexVersion;
+ goto error;
+ }
+
req->setOpKey(++c_opRecordSequence);
NodeReceiverGroup rg(DBDICT, c_aliveNodes);
sendSignal(rg, GSN_DROP_INDX_REQ,
@@ -6608,12 +6624,13 @@ Dbdict::execDROP_INDX_REQ(Signal* signal)
return;
}
}
+error:
jam();
// return to sender
OpDropIndex opBad;
opPtr.p = &opBad;
opPtr.p->save(req);
- opPtr.p->m_errorCode = DropIndxRef::BadRequestType;
+ opPtr.p->m_errorCode = (DropIndxRef::ErrorCode)err;
opPtr.p->m_errorLine = __LINE__;
dropIndex_sendReply(signal, opPtr, true);
}