Below is the list of changes that have just been committed into a local
5.1 repository of pekka. When pekka does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-01-12 11:39:27+01:00, pekka@stripped +18 -0
ndb - wl#3600 drop index, part 1
needs: alter trigger, drop trigger, alter index
BitKeeper/deleted/.del-DropIndxImpl.cpp@stripped, 2007-01-11 18:27:35+01:00, pekka@stripped +0 -0
Delete: storage/ndb/include/kernel/signaldata/DropIndxImpl.cpp
storage/ndb/include/kernel/signaldata/DropIndxImpl.cpp@stripped, 2007-01-11 18:27:24+01:00, pekka@stripped +0 -0
BitKeeper file /export/space/pekka/ndb/version/my52-wl3600-a/storage/ndb/include/kernel/signaldata/DropIndxImpl.cpp
storage/ndb/include/kernel/signaldata/DropIndxImpl.cpp@stripped, 2007-01-11 18:27:24+01:00, pekka@stripped +0 -0
storage/ndb/include/kernel/GlobalSignalNumbers.h@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +5 -1
wl#3600 drop index, part 1
storage/ndb/include/kernel/signaldata/DropIndx.hpp@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +27 -200
wl#3600 drop index, part 1
storage/ndb/include/kernel/signaldata/DropIndxImpl.hpp@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +68 -0
wl#3600 drop index, part 1
storage/ndb/include/kernel/signaldata/DropIndxImpl.hpp@stripped, 2007-01-11 18:28:17+01:00, pekka@stripped +0 -0
BitKeeper file /export/space/pekka/ndb/version/my52-wl3600-a/storage/ndb/include/kernel/signaldata/DropIndxImpl.hpp
storage/ndb/include/kernel/signaldata/DropIndxImpl.hpp@stripped, 2007-01-11 18:28:17+01:00, pekka@stripped +0 -0
storage/ndb/include/kernel/signaldata/SignalData.hpp@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +4 -0
wl#3600 drop index, part 1
storage/ndb/src/common/debugger/signaldata/DropIndx.cpp@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +39 -12
wl#3600 drop index, part 1
storage/ndb/src/common/debugger/signaldata/DropIndxImpl.cpp@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +59 -0
wl#3600 drop index, part 1
storage/ndb/src/common/debugger/signaldata/DropIndxImpl.cpp@stripped, 2007-01-11 22:48:03+01:00, pekka@stripped +0 -0
BitKeeper file /export/space/pekka/ndb/version/my52-wl3600-a/storage/ndb/src/common/debugger/signaldata/DropIndxImpl.cpp
storage/ndb/src/common/debugger/signaldata/DropIndxImpl.cpp@stripped, 2007-01-11 22:48:03+01:00, pekka@stripped +0 -0
storage/ndb/src/common/debugger/signaldata/Makefile.am@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +2 -1
wl#3600 drop index, part 1
storage/ndb/src/common/debugger/signaldata/SchemaTransImpl.cpp@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +3 -0
wl#3600 drop index, part 1
storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +4 -0
wl#3600 drop index, part 1
storage/ndb/src/common/debugger/signaldata/SignalNames.cpp@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +4 -0
wl#3600 drop index, part 1
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +404 -49
wl#3600 drop index, part 1
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +81 -18
wl#3600 drop index, part 1
storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +1 -1
wl#3600 drop index, part 1
storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +1 -1
wl#3600 drop index, part 1
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +23 -17
wl#3600 drop index, part 1
storage/ndb/src/ndbapi/NdbDictionary.cpp@stripped, 2007-01-12 11:37:25+01:00, pekka@stripped +12 -2
wl#3600 drop index, part 1
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp@stripped, 2007-01-12 11:37:26+01:00, pekka@stripped +8 -7
wl#3600 drop index, part 1
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: pekka
# Host: clam.(none)
# Root: /export/space/pekka/ndb/version/my52-wl3600-a
--- 1.33/storage/ndb/include/kernel/GlobalSignalNumbers.h 2007-01-11 15:25:21 +01:00
+++ 1.34/storage/ndb/include/kernel/GlobalSignalNumbers.h 2007-01-12 11:37:25 +01:00
@@ -23,7 +23,7 @@
*
* When adding a new signal, remember to update MAX_GSN and SignalNames.cpp
*/
-const GlobalSignalNumber MAX_GSN = 742;
+const GlobalSignalNumber MAX_GSN = 745;
struct GsnName {
GlobalSignalNumber gsn;
@@ -998,5 +998,9 @@
#define GSN_CREATE_INDX_IMPL_REQ 740
#define GSN_CREATE_INDX_IMPL_CONF 741
#define GSN_CREATE_INDX_IMPL_REF 742
+
+#define GSN_DROP_INDX_IMPL_REQ 743
+#define GSN_DROP_INDX_IMPL_CONF 744
+#define GSN_DROP_INDX_IMPL_REF 745
#endif
--- 1.5/storage/ndb/include/kernel/signaldata/DropIndx.hpp 2006-08-21 23:40:53 +02:00
+++ 1.6/storage/ndb/include/kernel/signaldata/DropIndx.hpp 2007-01-12 11:37:25 +01:00
@@ -20,14 +20,10 @@
#include "SignalData.hpp"
#include <NodeBitmask.hpp>
-/**
- * DropIndxReq.
- */
-class DropIndxReq {
+struct DropIndxReq {
friend bool printDROP_INDX_REQ(FILE*, const Uint32*, Uint32, Uint16);
-public:
- enum RequestType {
+ enum RequestType {//wl3600_todo remove
RT_UNDEFINED = 0,
RT_USER = 1,
RT_DICT_PREPARE = 1 << 4,
@@ -35,135 +31,31 @@
RT_DICT_ABORT = 0xF << 4,
RT_TC = 5 << 8
};
- STATIC_CONST( SignalLength = 6 );
+ STATIC_CONST( SignalLength = 8 );
-private:
- Uint32 m_connectionPtr;
- Uint32 m_userRef;
- Uint32 m_requestInfo;
- Uint32 m_tableId;
- Uint32 m_indexId;
- Uint32 m_indexVersion;
- // extra
- Uint32 m_opKey;
-
-public:
- Uint32 getConnectionPtr() const {
- return m_connectionPtr;
- }
- void setConnectionPtr(Uint32 val) {
- m_connectionPtr = val;
- }
- Uint32 getUserRef() const {
- return m_userRef;
- }
- void setUserRef(Uint32 val) {
- m_userRef = val;
- }
- DropIndxReq::RequestType getRequestType() const {
- const Uint32 val = BitmaskImpl::getField(1, &m_requestInfo, 0, 16);
- return (DropIndxReq::RequestType)val;
- }
- void setRequestType(DropIndxReq::RequestType val) {
- m_requestInfo = (Uint32)val;
- }
- Uint32 getRequestFlag() const {
- return BitmaskImpl::getField(1, &m_requestInfo, 16, 16);
- };
- void addRequestFlag(Uint32 val) {
- val |= BitmaskImpl::getField(1, &m_requestInfo, 16, 16);
- BitmaskImpl::setField(1, &m_requestInfo, 16, 16, val);
- };
- Uint32 getTableId() const {
- return m_tableId;
- }
- void setTableId(Uint32 val) {
- m_tableId = val;
- }
- Uint32 getIndexId() const {
- return m_indexId;
- }
- void setIndexId(Uint32 val) {
- m_indexId = val;
- }
- Uint32 getIndexVersion() const {
- return m_indexVersion;
- }
- void setIndexVersion(Uint32 val) {
- m_indexVersion = val;
- }
- Uint32 getOpKey() const {
- return m_opKey;
- }
- void setOpKey(Uint32 val) {
- m_opKey = val;
- }
+ Uint32 clientRef;
+ Uint32 clientData;
+ Uint32 transId;
+ Uint32 transKey;
+ Uint32 indexId;
+ Uint32 indexVersion;
};
-/**
- * DropIndxConf.
- */
-class DropIndxConf {
+struct DropIndxConf {
friend bool printDROP_INDX_CONF(FILE*, const Uint32*, Uint32, Uint16);
-public:
- STATIC_CONST( InternalLength = 3 );
- STATIC_CONST( SignalLength = 6 );
-
-private:
- Uint32 m_connectionPtr;
- Uint32 m_userRef;
- Uint32 m_requestInfo;
- Uint32 m_tableId;
- Uint32 m_indexId;
- Uint32 m_indexVersion;
-
-public:
- Uint32 getConnectionPtr() const {
- return m_connectionPtr;
- }
- void setConnectionPtr(Uint32 val) {
- m_connectionPtr = val;
- }
- Uint32 getUserRef() const {
- return m_userRef;
- }
- void setUserRef(Uint32 val) {
- m_userRef = val;
- }
- DropIndxReq::RequestType getRequestType() const {
- return (DropIndxReq::RequestType)m_requestInfo;
- }
- void setRequestType(DropIndxReq::RequestType val) {
- m_requestInfo = val;
- }
- Uint32 getTableId() const {
- return m_tableId;
- }
- void setTableId(Uint32 val) {
- m_tableId = val;
- }
- Uint32 getIndexId() const {
- return m_indexId;
- }
- void setIndexId(Uint32 val) {
- m_indexId = val;
- }
- Uint32 getIndexVersion() const {
- return m_indexVersion;
- }
- void setIndexVersion(Uint32 val) {
- m_indexVersion = val;
- }
+ STATIC_CONST( SignalLength = 5 );
+
+ Uint32 senderRef;
+ Uint32 clientData;
+ Uint32 transId;
+ Uint32 indexId;
+ Uint32 indexVersion;
};
-/**
- * DropIndxRef.
- */
struct DropIndxRef {
friend bool printDROP_INDX_REF(FILE*, const Uint32*, Uint32, Uint16);
-public:
enum ErrorCode {
NoError = 0,
InvalidIndexVersion = 241,
@@ -175,82 +67,17 @@
InvalidName = 4248,
NotAnIndex = 4254
};
- STATIC_CONST( SignalLength = DropIndxConf::SignalLength + 3 );
+ STATIC_CONST( SignalLength = 9 );
- DropIndxConf m_conf;
- //Uint32 m_userRef;
- //Uint32 m_connectionPtr;
- //Uint32 m_requestInfo;
- //Uint32 m_tableId;
- //Uint32 m_indexId;
- //Uint32 m_indexVersion;
- Uint32 m_errorCode;
- Uint32 m_errorLine;
- union {
- Uint32 m_errorNode;
- Uint32 masterNodeId;
- };
-public:
- DropIndxConf* getConf() {
- return &m_conf;
- }
- const DropIndxConf* getConf() const {
- return &m_conf;
- }
- Uint32 getConnectionPtr() const {
- return m_conf.getConnectionPtr();
- }
- void setConnectionPtr(Uint32 val) {
- m_conf.setConnectionPtr(val);
- }
- Uint32 getUserRef() const {
- return m_conf.getUserRef();
- }
- void setUserRef(Uint32 val) {
- m_conf.setUserRef(val);
- }
- DropIndxReq::RequestType getRequestType() const {
- return m_conf.getRequestType();
- }
- void setRequestType(DropIndxReq::RequestType val) {
- m_conf.setRequestType(val);
- }
- Uint32 getTableId() const {
- return m_conf.getTableId();
- }
- void setTableId(Uint32 val) {
- m_conf.setTableId(val);
- }
- Uint32 getIndexId() const {
- return m_conf.getIndexId();
- }
- void setIndexId(Uint32 val) {
- m_conf.setIndexId(val);
- }
- Uint32 getIndexVersion() const {
- return m_conf.getIndexVersion();
- }
- void setIndexVersion(Uint32 val) {
- m_conf.setIndexVersion(val);
- }
- DropIndxRef::ErrorCode getErrorCode() const {
- return (DropIndxRef::ErrorCode)m_errorCode;
- }
- void setErrorCode(DropIndxRef::ErrorCode val) {
- m_errorCode = (Uint32)val;
- }
- Uint32 getErrorLine() const {
- return m_errorLine;
- }
- void setErrorLine(Uint32 val) {
- m_errorLine = val;
- }
- Uint32 getErrorNode() const {
- return m_errorNode;
- }
- void setErrorNode(Uint32 val) {
- m_errorNode = val;
- }
+ Uint32 senderRef;
+ Uint32 clientData;
+ Uint32 transId;
+ Uint32 indexId;
+ Uint32 indexVersion;
+ Uint32 errorCode;
+ Uint32 errorLine;
+ Uint32 errorNodeId;
+ Uint32 masterNodeId;
};
#endif
--- 1.17/storage/ndb/include/kernel/signaldata/SignalData.hpp 2007-01-11 15:25:21 +01:00
+++ 1.18/storage/ndb/include/kernel/signaldata/SignalData.hpp 2007-01-12 11:37:25 +01:00
@@ -253,4 +253,8 @@
GSN_PRINT_SIGNATURE(printCREATE_INDX_IMPL_CONF);
GSN_PRINT_SIGNATURE(printCREATE_INDX_IMPL_REF);
+GSN_PRINT_SIGNATURE(printDROP_INDX_IMPL_REQ);
+GSN_PRINT_SIGNATURE(printDROP_INDX_IMPL_CONF);
+GSN_PRINT_SIGNATURE(printDROP_INDX_IMPL_REF);
+
#endif
--- 1.2/storage/ndb/src/common/debugger/signaldata/DropIndx.cpp 2005-04-08 02:43:55 +02:00
+++ 1.3/storage/ndb/src/common/debugger/signaldata/DropIndx.cpp 2007-01-12 11:37:25 +01:00
@@ -16,23 +16,50 @@
#include <signaldata/DropIndx.hpp>
-bool printDROP_INDX_REQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo)
+bool
+printDROP_INDX_REQ(FILE* output, const Uint32* theData, Uint32 len, Uint16 rbn)
{
-// const DropIndxReq * const sig = (DropIndxReq *) theData;
-
- return false;
+ const DropIndxReq* sig = (const DropIndxReq*)theData;
+ fprintf(output, " clientRef: %x", sig->clientRef);
+ fprintf(output, " clientData: %x", sig->clientData);
+ fprintf(output, " transId: %x", sig->transId);
+ fprintf(output, " transKey: %x", sig->transKey);
+ fprintf(output, "\n");
+ fprintf(output, " indexId: %x", sig->indexId);
+ fprintf(output, " indexVersion: %x", sig->indexVersion);
+ fprintf(output, "\n");
+ return true;
}
-bool printDROP_INDX_CONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo)
+bool
+printDROP_INDX_CONF(FILE* output, const Uint32* theData, Uint32 len, Uint16 rbn)
{
-// const DropIndxConf * const sig = (DropIndxConf *) theData;
-
- return false;
+ const DropIndxConf* sig = (const DropIndxConf*)theData;
+ fprintf(output, " senderRef: %x", sig->senderRef);
+ fprintf(output, " clientData: %x", sig->clientData);
+ fprintf(output, " transId: %x", sig->transId);
+ fprintf(output, "\n");
+ fprintf(output, " indexId: %x", sig->indexId);
+ fprintf(output, " indexVersion: %x", sig->indexVersion);
+ fprintf(output, "\n");
+ return true;
}
-bool printDROP_INDX_REF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo)
+bool
+printDROP_INDX_REF(FILE* output, const Uint32* theData, Uint32 len, Uint16 rbn)
{
-// const DropIndxRef * const sig = (DropIndxRef *) theData;
-
- return false;
+ const DropIndxRef* sig = (const DropIndxRef*)theData;
+ fprintf(output, " senderRef: %x", sig->senderRef);
+ fprintf(output, " clientData: %x", sig->clientData);
+ fprintf(output, " transId: %x", sig->transId);
+ fprintf(output, "\n");
+ fprintf(output, " indexId: %x", sig->indexId);
+ fprintf(output, " indexVersion: %x", sig->indexVersion);
+ fprintf(output, "\n");
+ fprintf(output, " errorCode: %u", sig->errorCode);
+ fprintf(output, " errorLine: %u", sig->errorLine);
+ fprintf(output, " errorNodeId: %u", sig->errorNodeId);
+ fprintf(output, " masterNodeId: %u", sig->masterNodeId);
+ fprintf(output, "\n");
+ return true;
}
--- 1.21/storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp 2007-01-11 15:25:21 +01:00
+++ 1.22/storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp 2007-01-12 11:37:25 +01:00
@@ -229,6 +229,10 @@
,{ GSN_CREATE_INDX_IMPL_CONF, printCREATE_INDX_IMPL_CONF }
,{ GSN_CREATE_INDX_IMPL_REF, printCREATE_INDX_IMPL_REF }
+ ,{ GSN_DROP_INDX_IMPL_REQ, printDROP_INDX_IMPL_REQ }
+ ,{ GSN_DROP_INDX_IMPL_CONF, printDROP_INDX_IMPL_CONF }
+ ,{ GSN_DROP_INDX_IMPL_REF, printDROP_INDX_IMPL_REF }
+
,{ 0, 0 }
};
--- 1.18/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp 2007-01-11 15:25:21 +01:00
+++ 1.19/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp 2007-01-12 11:37:25 +01:00
@@ -651,5 +651,9 @@
,{ GSN_CREATE_INDX_IMPL_REQ, "CREATE_INDX_IMPL_REQ" }
,{ GSN_CREATE_INDX_IMPL_CONF, "CREATE_INDX_IMPL_CONF" }
,{ GSN_CREATE_INDX_IMPL_REF, "CREATE_INDX_IMPL_REF" }
+
+ ,{ GSN_DROP_INDX_IMPL_REQ, "DROP_INDX_IMPL_REQ" }
+ ,{ GSN_DROP_INDX_IMPL_CONF, "DROP_INDX_IMPL_CONF" }
+ ,{ GSN_DROP_INDX_IMPL_REF, "DROP_INDX_IMPL_REF" }
};
const unsigned short NO_OF_SIGNAL_NAMES = sizeof(SignalNames)/sizeof(GsnName);
--- 1.129/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2007-01-11 15:25:22 +01:00
+++ 1.130/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp 2007-01-12 11:37:25 +01:00
@@ -1581,7 +1581,6 @@
c_schemaOpHash(c_schemaOpPool),
c_schemaTransHash(c_schemaTransPool),
c_opAlterTable(c_opRecordPool),
- c_opDropIndex(c_opRecordPool),
c_opAlterIndex(c_opRecordPool),
c_opBuildIndex(c_opRecordPool),
c_opCreateEvent(c_opRecordPool),
@@ -2172,7 +2171,7 @@
c_opSubEvent.setSize(2);
c_opDropEvent.setSize(2);
c_opSignalUtil.setSize(8);
- c_opDropIndex.setSize(8);
+ c_dropIndexDataPool.setSize(256);
c_opAlterIndex.setSize(8);
c_opBuildIndex.setSize(8);
c_opCreateTrigger.setSize(8);
@@ -7406,6 +7405,7 @@
Dbdict::dropTable_subOps(Signal* signal, SchemaOpPtr op_ptr)
{
D("dropTable_subOps" << V(op_ptr.i) << *op_ptr.p);
+ // wl3600_todo
return false;
}
@@ -8234,28 +8234,28 @@
jamEntry();
ndbrequire(signal->getNoOfSections() == 0);
- DropTableConf * const conf = (DropTableConf *)signal->getDataPtr();
- // assume part of drop index operation
- OpDropIndexPtr opPtr;
- c_opDropIndex.find(opPtr, conf->clientData);
- ndbrequire(! opPtr.isNull());
- ndbrequire(opPtr.p->m_request.getIndexId() == conf->tableId);
- ndbrequire(opPtr.p->m_request.getIndexVersion() == conf->tableVersion);
- dropIndex_fromDropTable(signal, opPtr);
+ const DropTableConf* conf =
+ (const DropTableConf*)signal->getDataPtr();
+
+ D("execDROP_TABLE_CONF" << hex << V(conf->clientData));
+
+ // the main operation e.g. drop index
+ SchemaOpPtr op_ptr;
+ findSchemaOp(op_ptr, conf->clientData);
+ execute(signal, op_ptr.p->m_callback, 0);
}
void Dbdict::execDROP_TABLE_REF(Signal* signal)
{
jamEntry();
- DropTableRef * const ref = (DropTableRef *)signal->getDataPtr();
- // assume part of drop index operation
- OpDropIndexPtr opPtr;
- c_opDropIndex.find(opPtr, ref->clientData);
- ndbrequire(! opPtr.isNull());
- opPtr.p->setError(ref);
- opPtr.p->m_errorLine = __LINE__;
- dropIndex_fromDropTable(signal, opPtr);
+ const DropTableRef* ref =
+ (const DropTableRef*)signal->getDataPtr();
+
+ SchemaOpPtr op_ptr;
+ findSchemaOp(op_ptr, ref->clientData);
+ ndbrequire(ref->errorCode != 0);
+ execute(signal, op_ptr.p->m_callback, ref->errorCode);
}
/* **************************************************************** */
@@ -9225,7 +9225,6 @@
{
D("createIndex_subOps" << V(op_ptr.i) << *op_ptr.p);
- SchemaTransPtr trans_ptr = op_ptr.p->m_trans_ptr;
CreateIndexDataPtr createIndexPtr;
getOpData(op_ptr, createIndexPtr);
@@ -9241,7 +9240,7 @@
return true;
}
#if wl3600_todo
- // op to alter index
+ // op to alter index online
if (!createIndexPtr.p->m_sub_alter_index) {
jam();
Callback c = {
@@ -9400,14 +9399,15 @@
}
void
-Dbdict::createIndex_fromCreateTable(Signal* signal, Uint32 key, Uint32 ret)
+Dbdict::createIndex_fromCreateTable(Signal* signal, Uint32 op_key, Uint32 ret)
{
- D("createIndex_fromCreateTable" << hex << V(key) << dec << V(ret));
+ jam();
+ D("createIndex_fromCreateTable" << hex << V(op_key) << dec << V(ret));
SchemaOpPtr op_ptr;
CreateIndexDataPtr createIndexPtr;
- findSchemaOp(op_ptr, createIndexPtr, key);
+ findSchemaOp(op_ptr, createIndexPtr, op_key);
ndbrequire(!op_ptr.isNull());
SchemaTransPtr trans_ptr = op_ptr.p->m_trans_ptr;
@@ -9421,11 +9421,12 @@
createIndexPtr.p->m_request.indexId = conf->tableId;
createIndexPtr.p->m_request.indexVersion = conf->tableVersion;
- D("createIndex_fromCreateTable" << V(conf->tableId));
+ D(V(conf->tableId));
createIndexPtr.p->m_sub_create_table = true;
} else {
- ndbrequire(false);//TODO
+ ndbrequire(false);//wl3600_todo
+
jam();
const CreateTableRef* ref =
(const CreateTableRef*)signal->getDataPtr();
@@ -10081,12 +10082,95 @@
* other blocks) and then drops the index table.
*/
+// MODULE: DropIndex
+
+const Dbdict::OpInfo
+Dbdict::DropIndexData::g_opInfo = {
+ GSN_DROP_INDX_IMPL_REQ,
+ DropIndxImplReq::SignalLength,
+ //
+ &Dbdict::dropIndex_seize,
+ &Dbdict::dropIndex_release,
+ //
+ &Dbdict::dropIndex_parse,
+ &Dbdict::dropIndex_parseCommon,
+ &Dbdict::dropIndex_subOps,
+ &Dbdict::dropIndex_reply,
+ //
+ &Dbdict::dropIndex_prepare,
+ &Dbdict::dropIndex_commit
+};
+
+bool
+Dbdict::dropIndex_seize(SchemaOpPtr op_ptr)
+{
+ return seizeOpData<DropIndexData>(op_ptr);
+}
+
+void
+Dbdict::dropIndex_release(SchemaOpPtr op_ptr)
+{
+ releaseOpData<DropIndexData>(op_ptr);
+}
+
void
Dbdict::execDROP_INDX_REQ(Signal* signal)
{
jamEntry();
+ ndbrequire(signal->getNoOfSections() == 0);
+
+ const DropIndxReq reqData =
+ *(const DropIndxReq*)signal->getDataPtr();
+ const DropIndxReq* req = &reqData;
+
+ ErrorInfo error;
+ do {
+ SchemaOpPtr op_ptr;
+
+ checkClientReq<DropIndexData, DropIndxReq>(signal, op_ptr, error);
+ if (hasError(error)) {
+ jam();
+ break;
+ }
+
+ // wl3600_todo maybe use m_request directly
+ DropIndxImplReq* impl_req = (DropIndxImplReq*)signal->getDataPtrSend();
+ impl_req->senderRef = reference();
+ impl_req->senderData = op_ptr.p->op_key;
+ impl_req->tableId = 0; // wl3600_todo fill in in parseCommon
+ impl_req->tableVersion = 0;
+ impl_req->indexId = req->indexId;
+ impl_req->indexVersion = req->indexVersion;
+
+ dropIndex_parseCommon(signal, op_ptr, error);
+ if (hasError(error)) {
+ jam();
+ break;
+ }
+
+ SchemaTransPtr trans_ptr = op_ptr.p->m_trans_ptr;
+ trans_ptr.p->m_requestType = SchemaTransImplReq::RT_PARSE;
+ schemaTrans_sendReq(signal, trans_ptr, false);
+ return;
+ } while (0);
+
+ releaseSections(signal);
+
+ DropIndxRef* ref = (DropIndxRef*)signal->getDataPtrSend();
+ ref->senderRef = reference();
+ ref->clientData = req->clientData;
+ ref->transId = req->transId;
+ ref->indexId = req->indexId;
+ ref->indexVersion = req->indexVersion;
+ getError(error, ref);
+
+ sendSignal(req->clientRef, GSN_DROP_INDX_REF, signal,
+ DropIndxRef::SignalLength, JBB);
+
+#if wl3600_todo //remove
+ jamEntry();
DropIndxReq* const req = (DropIndxReq*)signal->getDataPtrSend();
- OpDropIndexPtr opPtr;
+ DropIndexDataPtr opPtr;
int err = DropIndxRef::BadRequestType;
const Uint32 senderRef = signal->senderBlockRef();
@@ -10199,28 +10283,199 @@
opPtr.p->m_errorLine = __LINE__;
opPtr.p->m_errorNode = c_masterNodeId;
dropIndex_sendReply(signal, opPtr, true);
+#endif
+}
+
+void
+Dbdict::dropIndex_parse(Signal* signal, SchemaTransPtr trans_ptr)
+{
+ ErrorInfo error;
+ parseClientReq<DropIndexData, DropIndxImplReq>(signal, trans_ptr, error);
+ if (hasError(error)) {
+ jam();
+ schemaTrans_sendRef(signal, trans_ptr, error);
+ }
+ schemaTrans_sendConf(signal, trans_ptr, 0);
+}
+
+void
+Dbdict::dropIndex_parseCommon(Signal* signal, SchemaOpPtr op_ptr,
+ ErrorInfo& error)
+{
+ D("dropIndex_parseCommon" << V(op_ptr.i) << *op_ptr.p);
+
+ const DropIndxImplReq* impl_req =
+ (const DropIndxImplReq*)signal->getDataPtr();
+
+ DropIndexDataPtr dropIndexPtr;
+ getOpData(op_ptr, dropIndexPtr);
+
+ // wl3600_todo fix interface
+ dropIndexPtr.p->m_request = *impl_req;
+ impl_req = &dropIndexPtr.p->m_request;
+
+ TableRecordPtr indexPtr;
+ if (! (impl_req->indexId < c_tableRecordPool.getSize())) {
+ jam();
+ setError(error, DropIndxRef::IndexNotFound, __LINE__);
+ return;
+ }
+ c_tableRecordPool.getPtr(indexPtr, impl_req->indexId);
+
+ // wl3600_todo make possible to drop broken
+ if (indexPtr.p->tabState == TableRecord::NOT_DEFINED) {
+ jam();
+ setError(error, DropIndxRef::IndexNotFound, __LINE__);
+ return;
+ }
+
+ if (! indexPtr.p->isIndex()) {
+ jam();
+ setError(error, DropIndxRef::NotAnIndex, __LINE__);
+ return;
+ }
+
+ if (indexPtr.p->tableVersion != impl_req->indexVersion) {
+ jam();
+ setError(error, DropIndxRef::InvalidIndexVersion, __LINE__);
+ return;
+ }
+
+ ndbrequire(indexPtr.p->primaryTableId != RNIL);
+ TableRecordPtr tablePtr;
+ c_tableRecordPool.getPtr(tablePtr, indexPtr.p->primaryTableId);
+
+ // master sets primary table, participant verifies it agrees
+ if (reference() == impl_req->senderRef) {
+ dropIndexPtr.p->m_request.tableId = tablePtr.p->tableId;
+ dropIndexPtr.p->m_request.tableVersion = tablePtr.p->tableVersion;
+ } else {
+ if (dropIndexPtr.p->m_request.tableId != tablePtr.p->tableId) {
+ jam(); // wl3600_todo better error code
+ setError(error, DropIndxRef::InvalidIndexVersion, __LINE__);
+ return;
+ }
+ if (dropIndexPtr.p->m_request.tableVersion != tablePtr.p->tableVersion) {
+ jam(); // wl3600_todo better error code
+ setError(error, DropIndxRef::InvalidIndexVersion, __LINE__);
+ return;
+ }
+ }
+}
+
+bool
+Dbdict::dropIndex_subOps(Signal* signal, SchemaOpPtr op_ptr)
+{
+ D("dropIndex_subOps" << V(op_ptr.i) << *op_ptr.p);
+
+ DropIndexDataPtr dropIndexPtr;
+ getOpData(op_ptr, dropIndexPtr);
+
+#if wl3600_todo
+ // op to alter index offline
+ if (!dropIndexPtr.p->m_sub_alter_index) {
+ jam();
+ Callback c = {
+ safe_cast(&Dbdict::dropIndex_fromAlterIndex),
+ op_ptr.p->op_key
+ };
+ op_ptr.p->m_callback = c;
+ dropIndex_toAlterIndex(signal, op_ptr);
+ return true;
+ }
+#endif
+ // op to drop index table
+ if (!dropIndexPtr.p->m_sub_drop_table) {
+ jam();
+ Callback c = {
+ safe_cast(&Dbdict::dropIndex_fromDropTable),
+ op_ptr.p->op_key
+ };
+ op_ptr.p->m_callback = c;
+ dropIndex_toDropTable(signal, op_ptr);
+ return true;
+ }
+
+ return false;
+}
+
+void
+Dbdict::dropIndex_reply(Signal* signal, SchemaOpPtr op_ptr)
+{
+ D("dropIndex_reply" << V(op_ptr.i) << *op_ptr.p);
+
+ SchemaTransPtr trans_ptr = op_ptr.p->m_trans_ptr;
+ const OpInfo& info = getOpInfo(op_ptr);
+
+ DropIndexDataPtr dropIndexPtr;
+ getOpData(op_ptr, dropIndexPtr);
+
+ DropIndxConf* conf = (DropIndxConf*)signal->getDataPtrSend();
+ conf->senderRef = reference();
+ conf->clientData = op_ptr.p->m_clientData;
+ conf->transId = trans_ptr.p->m_transId;
+ conf->indexId = dropIndexPtr.p->m_request.indexId;
+ conf->indexVersion = dropIndexPtr.p->m_request.indexVersion;
+
+ D(V(conf->indexId) << V(conf->indexVersion));
+
+ Uint32 clientRef = op_ptr.p->m_clientRef;
+ sendSignal(clientRef, GSN_DROP_INDX_CONF,
+ signal, DropIndxConf::SignalLength, JBB);
+}
+
+void
+Dbdict::dropIndex_prepare(Signal* signal, SchemaOpPtr op_ptr,
+ Uint32 repeat)
+{
+ DropIndexDataPtr dropIndexPtr;
+ getOpData(op_ptr, dropIndexPtr);
+
+ D("dropIndex_prepare" << V(repeat) << *op_ptr.p << *dropIndexPtr.p);
+
+ schemaTrans_sendConf(signal, op_ptr.p->m_trans_ptr, 0);
+}
+
+void
+Dbdict::dropIndex_commit(Signal* signal, SchemaOpPtr op_ptr,
+ Uint32 repeat)
+{
+ DropIndexDataPtr dropIndexPtr;
+ getOpData(op_ptr, dropIndexPtr);
+
+ D("dropIndex_commit" << V(repeat) << *op_ptr.p << *dropIndexPtr.p);
+
+ schemaTrans_sendConf(signal, op_ptr.p->m_trans_ptr, 0);
}
void
Dbdict::execDROP_INDX_CONF(Signal* signal)
{
+ ndbrequire(false);
+#if wl3600_todo
jamEntry();
DropIndxConf* conf = (DropIndxConf*)signal->getDataPtrSend();
dropIndex_recvReply(signal, conf, 0);
+#endif
}
void
Dbdict::execDROP_INDX_REF(Signal* signal)
{
+ ndbrequire(false);
+#if wl3600_todo
jamEntry();
DropIndxRef* ref = (DropIndxRef*)signal->getDataPtrSend();
dropIndex_recvReply(signal, ref->getConf(), ref);
+#endif
}
void
Dbdict::dropIndex_recvReply(Signal* signal, const DropIndxConf* conf,
const DropIndxRef* ref)
{
+ ndbrequire(false);
+#if wl3600_todo
jam();
const Uint32 senderRef = signal->senderBlockRef();
const DropIndxReq::RequestType requestType = conf->getRequestType();
@@ -10235,7 +10490,7 @@
alterIndex_fromDropTc(signal, opPtr);
return;
}
- OpDropIndexPtr opPtr;
+ DropIndexDataPtr opPtr;
c_opDropIndex.find(opPtr, key);
ndbrequire(! opPtr.isNull());
ndbrequire(opPtr.p->m_isMaster);
@@ -10267,11 +10522,14 @@
return;
}
ndbrequire(false);
+#endif
}
void
-Dbdict::dropIndex_slavePrepare(Signal* signal, OpDropIndexPtr opPtr)
+Dbdict::dropIndex_slavePrepare(Signal* signal, DropIndexDataPtr opPtr)
{
+ ndbrequire(false);
+#if wl3600_todo
jam();
DropIndxReq* const req = &opPtr.p->m_request;
// check index exists
@@ -10297,11 +10555,14 @@
}
// ignore incoming primary table id
req->setTableId(indexPtr.p->primaryTableId);
+#endif
}
void
-Dbdict::dropIndex_toAlterIndex(Signal* signal, OpDropIndexPtr opPtr)
+Dbdict::dropIndex_toAlterIndex(Signal* signal, SchemaOpPtr op_ptr)
{
+ ndbrequire(false);
+#if wl3600_todo
jam();
AlterIndxReq* const req = (AlterIndxReq*)signal->getDataPtrSend();
req->setUserRef(reference());
@@ -10314,11 +10575,14 @@
req->setOnline(false);
sendSignal(reference(), GSN_ALTER_INDX_REQ,
signal, AlterIndxReq::SignalLength, JBB);
+#endif
}
void
-Dbdict::dropIndex_fromAlterIndex(Signal* signal, OpDropIndexPtr opPtr)
+Dbdict::dropIndex_fromAlterIndex(Signal* signal, Uint32 op_key, Uint32 ret)
{
+ ndbrequire(false);
+#if wl3600_todo
jam();
if (opPtr.p->hasError()) {
jam();
@@ -10327,44 +10591,79 @@
return;
}
dropIndex_toDropTable(signal, opPtr);
+#endif
}
void
-Dbdict::dropIndex_toDropTable(Signal* signal, OpDropIndexPtr opPtr)
+Dbdict::dropIndex_toDropTable(Signal* signal, SchemaOpPtr op_ptr)
{
- jam();
- DropTableReq* const req = (DropTableReq*)signal->getDataPtrSend();
+ DropTableReq* req = (DropTableReq*)signal->getDataPtrSend();
+
+ SchemaTransPtr trans_ptr = op_ptr.p->m_trans_ptr;
+ DropIndexDataPtr dropIndexPtr;
+ getOpData(op_ptr, dropIndexPtr);
+
req->clientRef = reference();
- req->clientData = opPtr.p->key;
- req->tableId = opPtr.p->m_request.getIndexId();
- req->tableVersion = opPtr.p->m_request.getIndexVersion();
+ req->clientData = op_ptr.p->op_key;
+ req->transId = trans_ptr.p->m_transId;
+ req->transKey = trans_ptr.p->trans_key;
+ req->tableId = dropIndexPtr.p->m_request.indexId;
+ req->tableVersion = dropIndexPtr.p->m_request.indexVersion;
+
sendSignal(reference(), GSN_DROP_TABLE_REQ,
- signal,DropTableReq::SignalLength, JBB);
+ signal, DropTableReq::SignalLength, JBB);
}
void
-Dbdict::dropIndex_fromDropTable(Signal* signal, OpDropIndexPtr opPtr)
+Dbdict::dropIndex_fromDropTable(Signal* signal, Uint32 op_key, Uint32 ret)
{
jam();
- if (opPtr.p->hasError()) {
+ D("dropIndex_fromCreateTable" << hex << V(op_key) << dec << V(ret));
+
+ SchemaOpPtr op_ptr;
+ DropIndexDataPtr dropIndexPtr;
+
+ findSchemaOp(op_ptr, dropIndexPtr, op_key);
+ ndbrequire(!op_ptr.isNull());
+ SchemaTransPtr trans_ptr = op_ptr.p->m_trans_ptr;
+
+ Uint32 errorCode = 0;
+ if (ret == 0) {
jam();
- opPtr.p->m_requestType = DropIndxReq::RT_DICT_ABORT;
- dropIndex_sendSlaveReq(signal, opPtr);
- return;
+ const DropTableConf* conf =
+ (const DropTableConf*)signal->getDataPtr();
+
+ ndbrequire(conf->transId == trans_ptr.p->m_transId);
+ dropIndexPtr.p->m_sub_drop_table = true;
+ } else {
+ ndbrequire(false);//wl3600_todo
+
+ jam();
+ const DropTableRef* ref =
+ (const DropTableRef*)signal->getDataPtr();
+
+ ndbrequire(ref->transId == trans_ptr.p->m_transId);
+ ndbrequire(ref->errorCode != 0);
+ errorCode = ref->errorCode;
}
- opPtr.p->m_requestType = DropIndxReq::RT_DICT_COMMIT;
- dropIndex_sendSlaveReq(signal, opPtr);
+
+ createSubOps(signal, op_ptr);
}
void
-Dbdict::dropIndex_slaveCommit(Signal* signal, OpDropIndexPtr opPtr)
+Dbdict::dropIndex_slaveCommit(Signal* signal, DropIndexDataPtr opPtr)
{
+ ndbrequire(false);
+#if wl3600_todo
jam();
+#endif
}
void
-Dbdict::dropIndex_slaveAbort(Signal* signal, OpDropIndexPtr opPtr)
+Dbdict::dropIndex_slaveAbort(Signal* signal, DropIndexDataPtr opPtr)
{
+ ndbrequire(false);
+#if wl3600_todo
jam();
DropIndxReq* const req = &opPtr.p->m_request;
const Uint32 indexId = req->getIndexId();
@@ -10375,11 +10674,14 @@
TableRecordPtr indexPtr;
c_tableRecordPool.getPtr(indexPtr, indexId);
indexPtr.p->indexState = TableRecord::IS_BROKEN;
+#endif
}
void
-Dbdict::dropIndex_sendSlaveReq(Signal* signal, OpDropIndexPtr opPtr)
+Dbdict::dropIndex_sendSlaveReq(Signal* signal, DropIndexDataPtr opPtr)
{
+ ndbrequire(false);
+#if wl3600_todo
DropIndxReq* const req = (DropIndxReq*)signal->getDataPtrSend();
*req = opPtr.p->m_request;
req->setUserRef(opPtr.p->m_coordinatorRef);
@@ -10390,12 +10692,15 @@
NodeReceiverGroup rg(DBDICT, c_aliveNodes);
sendSignal(rg, GSN_DROP_INDX_REQ,
signal, DropIndxReq::SignalLength, JBB);
+#endif
}
void
-Dbdict::dropIndex_sendReply(Signal* signal, OpDropIndexPtr opPtr,
+Dbdict::dropIndex_sendReply(Signal* signal, DropIndexDataPtr opPtr,
bool toUser)
{
+ ndbrequire(false);
+#if wl3600_todo
DropIndxRef* rep = (DropIndxRef*)signal->getDataPtrSend();
Uint32 gsn = GSN_DROP_INDX_CONF;
Uint32 length = DropIndxConf::InternalLength;
@@ -10427,6 +10732,7 @@
length = DropIndxRef::SignalLength;
}
sendSignal(rep->getUserRef(), gsn, signal, length, JBB);
+#endif
}
/*****************************************************
@@ -12813,7 +13119,7 @@
if (requestType == AlterIndxReq::RT_DROP_INDEX) {
jam();
// part of drop index operation
- OpDropIndexPtr opPtr;
+ DropIndexDataPtr opPtr;
c_opDropIndex.find(opPtr, key);
ndbrequire(! opPtr.isNull());
opPtr.p->setError(ref);
@@ -13002,6 +13308,8 @@
void
Dbdict::alterIndex_toDropTc(Signal* signal, OpAlterIndexPtr opPtr)
{
+ ndbrequire(false);
+#if wl3600_todo
jam();
TableRecordPtr indexPtr;
c_tableRecordPool.getPtr(indexPtr, opPtr.p->m_request.getIndexId());
@@ -13023,11 +13331,14 @@
// send
sendSignal(calcTcBlockRef(getOwnNodeId()), GSN_DROP_INDX_REQ,
signal, DropIndxReq::SignalLength, JBB);
+#endif
}
void
Dbdict::alterIndex_fromDropTc(Signal* signal, OpAlterIndexPtr opPtr)
{
+ ndbrequire(false);
+#if wl3600_todo
jam();
ndbrequire(opPtr.p->m_requestType == AlterIndxReq::RT_DICT_TC);
// mark dropped locally
@@ -13038,6 +13349,7 @@
}
// forward CONF or REF to master
alterIndex_sendReply(signal, opPtr, false);
+#endif
}
void
@@ -18065,6 +18377,7 @@
&Dbdict::CreateTableData::g_opInfo,
&Dbdict::DropTableData::g_opInfo,
&Dbdict::CreateIndexData::g_opInfo,
+ &Dbdict::DropIndexData::g_opInfo,
0
};
@@ -19238,6 +19551,20 @@
}
NdbOut&
+operator<<(NdbOut& out, const Dbdict::CreateTableData& a)
+{
+ a.print(out);
+ return out;
+}
+
+void
+Dbdict::CreateTableData::print(NdbOut& out) const
+{
+ out << " (CreateTableData";
+ out << ")";
+}
+
+NdbOut&
operator<<(NdbOut& out, const Dbdict::DropTableData& a)
{
a.print(out);
@@ -19248,6 +19575,34 @@
Dbdict::DropTableData::print(NdbOut& out) const
{
out << " (DropTableData";
+ out << ")";
+}
+
+NdbOut&
+operator<<(NdbOut& out, const Dbdict::CreateIndexData& a)
+{
+ a.print(out);
+ return out;
+}
+
+void
+Dbdict::CreateIndexData::print(NdbOut& out) const
+{
+ out << " (CreateIndexData";
+ out << ")";
+}
+
+NdbOut&
+operator<<(NdbOut& out, const Dbdict::DropIndexData& a)
+{
+ a.print(out);
+ return out;
+}
+
+void
+Dbdict::DropIndexData::print(NdbOut& out) const
+{
+ out << " (DropIndexData";
out << ")";
}
--- 1.57/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp 2007-01-11 15:25:22 +01:00
+++ 1.58/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp 2007-01-12 11:37:25 +01:00
@@ -46,6 +46,7 @@
#include <signaldata/CreateIndx.hpp>
#include <signaldata/CreateIndxImpl.hpp>
#include <signaldata/DropIndx.hpp>
+#include <signaldata/DropIndxImpl.hpp>
#include <signaldata/AlterIndx.hpp>
#include <signaldata/BuildIndx.hpp>
#include <signaldata/UtilPrepare.hpp>
@@ -1743,6 +1744,10 @@
SafeCounterHandle m_counter;
CreateTabReq::RequestType m_requestType;
} m_coordinatorData;
+
+#ifdef VM_TRACE
+ void print(NdbOut&) const;
+#endif
};
typedef Ptr<CreateTableData> CreateTableDataPtr;
@@ -1926,6 +1931,9 @@
m_sub_create_table = false;
m_sub_alter_index = false;
}
+#ifdef VM_TRACE
+ void print(NdbOut&) const;
+#endif
// original request (index id will be added)
//CreateIndxReq m_request;
@@ -2042,12 +2050,36 @@
void createIndex_toAlterIndex(Signal*, SchemaOpPtr);
void createIndex_fromAlterIndex(Signal*, Uint32 op_key, Uint32 ret);
- /**
- * Operation record for drop index.
- */
- struct OpDropIndex : OpRecordCommon {
+ // MODULE: DropIndex
+
+ struct DropIndexData : public OpData {
+ DropIndxImplReq m_request;
+
+ // reflection
+ static const OpInfo g_opInfo;
+
+ static ArrayPool<Dbdict::DropIndexData>&
+ getPool(Dbdict* dict) {
+ return dict->c_dropIndexDataPool;
+ }
+
+ // sub-operation counters
+ bool m_sub_alter_index;
+ bool m_sub_drop_table;
+
+ DropIndexData() :
+ OpData(g_opInfo) {
+ memset(&m_request, 0, sizeof(m_request));
+ m_sub_alter_index = false;
+ m_sub_drop_table = false;
+ }
+#ifdef VM_TRACE
+ void print(NdbOut&) const;
+#endif
+
+#if wl3600_todo //out
// original request
- DropIndxReq m_request;
+ //DropIndxReq m_request;
// coordinator DICT
Uint32 m_coordinatorRef;
bool m_isMaster;
@@ -2072,18 +2104,26 @@
m_errorLine = 0;
m_errorNode = 0;
}
+#endif
void save(const DropIndxReq* req) {
+#if wl3600_todo
m_request = *req;
m_requestType = req->getRequestType();
m_requestFlag = req->getRequestFlag();
+#endif
}
bool hasLastError() {
+#if wl3600_todo
return m_lastError != DropIndxRef::NoError;
+#endif
}
bool hasError() {
+#if wl3600_todo
return m_errorCode != DropIndxRef::NoError;
+#endif
}
void setError(const DropIndxRef* ref) {
+#if wl3600_todo
m_lastError = DropIndxRef::NoError;
if (ref != 0) {
m_lastError = ref->getErrorCode();
@@ -2093,8 +2133,10 @@
m_errorNode = ref->getErrorNode();
}
}
+#endif
}
void setError(const AlterIndxRef* ref) {
+#if wl3600_todo
m_lastError = DropIndxRef::NoError;
if (ref != 0) {
m_lastError = (DropIndxRef::ErrorCode)ref->getErrorCode();
@@ -2104,8 +2146,10 @@
m_errorNode = ref->getErrorNode();
}
}
+#endif
}
void setError(const DropTableRef* ref) {
+#if wl3600_todo
m_lastError = DropIndxRef::NoError;
if (ref != 0) {
switch (ref->errorCode) {
@@ -2131,9 +2175,30 @@
m_errorNode = 0;
}
}
+#endif
}
};
- typedef Ptr<OpDropIndex> OpDropIndexPtr;
+
+ typedef Ptr<DropIndexData> DropIndexDataPtr;
+ ArrayPool<DropIndexData> c_dropIndexDataPool;
+
+ // OpInfo
+ bool dropIndex_seize(SchemaOpPtr);
+ void dropIndex_release(SchemaOpPtr);
+ //
+ void dropIndex_parse(Signal*, SchemaTransPtr);
+ void dropIndex_parseCommon(Signal*, SchemaOpPtr, ErrorInfo&);
+ bool dropIndex_subOps(Signal*, SchemaOpPtr);
+ void dropIndex_reply(Signal*, SchemaOpPtr);
+ //
+ void dropIndex_prepare(Signal*, SchemaOpPtr, Uint32 repeat);
+ void dropIndex_commit(Signal*, SchemaOpPtr, Uint32 repeat);
+
+ // sub-ops
+ void dropIndex_toDropTable(Signal*, SchemaOpPtr);
+ void dropIndex_fromDropTable(Signal*, Uint32 op_key, Uint32 ret);
+ void dropIndex_toAlterIndex(Signal*, SchemaOpPtr);
+ void dropIndex_fromAlterIndex(Signal*, Uint32 op_key, Uint32 ret);
/**
* Operation record for alter index.
@@ -2205,6 +2270,7 @@
#endif
}
void setError(const DropIndxRef* ref) {
+#if wl3600_todo
m_lastError = AlterIndxRef::NoError;
if (ref != 0) {
m_lastError = (AlterIndxRef::ErrorCode)ref->getErrorCode();
@@ -2214,6 +2280,7 @@
m_errorNode = ref->getErrorNode();
}
}
+#endif
}
void setError(const BuildIndxRef* ref) {
m_lastError = AlterIndxRef::NoError;
@@ -2726,7 +2793,6 @@
// Common operation record pool
public:
STATIC_CONST( opAlterTableSize = sizeof(AlterTableRecord) );
- STATIC_CONST( opDropIndexSize = sizeof(OpDropIndex) );
STATIC_CONST( opAlterIndexSize = sizeof(OpAlterIndex) );
STATIC_CONST( opBuildIndexSize = sizeof(OpBuildIndex) );
STATIC_CONST( opCreateEventSize = sizeof(OpCreateEvent) );
@@ -2741,7 +2807,6 @@
#define PTR_ALIGN(n) ((((n)+sizeof(void*)-1)>>2)&~((sizeof(void*)-1)>>2))
union OpRecordUnion {
Uint32 u_opAlterTable [PTR_ALIGN(opAlterTableSize)];
- Uint32 u_opDropIndex [PTR_ALIGN(opDropIndexSize)];
Uint32 u_opCreateEvent [PTR_ALIGN(opCreateEventSize)];
Uint32 u_opSubEvent [PTR_ALIGN(opSubEventSize)];
Uint32 u_opDropEvent [PTR_ALIGN(opDropEventSize)];
@@ -2758,7 +2823,6 @@
// Operation records
KeyTable2<AlterTableRecord, OpRecordUnion> c_opAlterTable;
- KeyTable2<OpDropIndex, OpRecordUnion> c_opDropIndex;
KeyTable2<OpAlterIndex, OpRecordUnion> c_opAlterIndex;
KeyTable2<OpBuildIndex, OpRecordUnion> c_opBuildIndex;
KeyTable2C<OpCreateEvent, OpRecordUnion> c_opCreateEvent;
@@ -3002,15 +3066,11 @@
// drop index
void dropIndex_recvReply(Signal* signal, const DropIndxConf* conf,
const DropIndxRef* ref);
- void dropIndex_slavePrepare(Signal* signal, OpDropIndexPtr opPtr);
- void dropIndex_toAlterIndex(Signal* signal, OpDropIndexPtr opPtr);
- void dropIndex_fromAlterIndex(Signal* signal, OpDropIndexPtr opPtr);
- void dropIndex_toDropTable(Signal* signal, OpDropIndexPtr opPtr);
- void dropIndex_fromDropTable(Signal* signal, OpDropIndexPtr opPtr);
- void dropIndex_slaveCommit(Signal* signal, OpDropIndexPtr opPtr);
- void dropIndex_slaveAbort(Signal* signal, OpDropIndexPtr opPtr);
- void dropIndex_sendSlaveReq(Signal* signal, OpDropIndexPtr opPtr);
- void dropIndex_sendReply(Signal* signal, OpDropIndexPtr opPtr, bool);
+ void dropIndex_slavePrepare(Signal* signal, DropIndexDataPtr opPtr);
+ void dropIndex_slaveCommit(Signal* signal, DropIndexDataPtr opPtr);
+ void dropIndex_slaveAbort(Signal* signal, DropIndexDataPtr opPtr);
+ void dropIndex_sendSlaveReq(Signal* signal, DropIndexDataPtr opPtr);
+ void dropIndex_sendReply(Signal* signal, DropIndexDataPtr opPtr, bool);
// alter index
void alterIndex_recvReply(Signal* signal, const AlterIndxConf* conf,
const AlterIndxRef* ref);
@@ -3368,7 +3428,10 @@
friend NdbOut& operator<<(NdbOut& out, const SchemaOp&);
friend NdbOut& operator<<(NdbOut& out, const SchemaTrans&);
friend NdbOut& operator<<(NdbOut& out, const PhaseIterator&);
+ friend NdbOut& operator<<(NdbOut& out, const CreateTableData&);
friend NdbOut& operator<<(NdbOut& out, const DropTableData&);
+ friend NdbOut& operator<<(NdbOut& out, const CreateIndexData&);
+ friend NdbOut& operator<<(NdbOut& out, const DropIndexData&);
#endif
};
--- 1.45/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp 2007-01-11 15:25:22 +01:00
+++ 1.46/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp 2007-01-12 11:37:25 +01:00
@@ -1336,7 +1336,7 @@
void execFIRE_TRIG_ORD(Signal* signal);
void execTRIG_ATTRINFO(Signal* signal);
void execCREATE_INDX_IMPL_REQ(Signal* signal);
- void execDROP_INDX_REQ(Signal* signal);
+ void execDROP_INDX_IMPL_REQ(Signal* signal);
void execTCINDXREQ(Signal* signal);
void execINDXKEYINFO(Signal* signal);
void execINDXATTRINFO(Signal* signal);
--- 1.19/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp 2007-01-11 15:25:22 +01:00
+++ 1.20/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp 2007-01-12 11:37:25 +01:00
@@ -257,7 +257,7 @@
addRecSignal(GSN_TRIG_ATTRINFO, &Dbtc::execTRIG_ATTRINFO);
addRecSignal(GSN_CREATE_INDX_IMPL_REQ, &Dbtc::execCREATE_INDX_IMPL_REQ);
- addRecSignal(GSN_DROP_INDX_REQ, &Dbtc::execDROP_INDX_REQ);
+ addRecSignal(GSN_DROP_INDX_IMPL_REQ, &Dbtc::execDROP_INDX_IMPL_REQ);
addRecSignal(GSN_TCINDXREQ, &Dbtc::execTCINDXREQ);
addRecSignal(GSN_INDXKEYINFO, &Dbtc::execINDXKEYINFO);
addRecSignal(GSN_INDXATTRINFO, &Dbtc::execINDXATTRINFO);
--- 1.130/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2007-01-11 15:25:22 +01:00
+++ 1.131/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2007-01-12 11:37:25 +01:00
@@ -49,7 +49,7 @@
#include <signaldata/FireTrigOrd.hpp>
#include <signaldata/TrigAttrInfo.hpp>
#include <signaldata/CreateIndxImpl.hpp>
-#include <signaldata/DropIndx.hpp>
+#include <signaldata/DropIndxImpl.hpp>
#include <signaldata/AlterIndx.hpp>
#include <signaldata/ScanTab.hpp>
#include <signaldata/SystemError.hpp>
@@ -11388,36 +11388,42 @@
}
}
-void Dbtc::execDROP_INDX_REQ(Signal* signal)
+void Dbtc::execDROP_INDX_IMPL_REQ(Signal* signal)
{
jamEntry();
- DropIndxReq * const dropIndxReq = (DropIndxReq *)signal->getDataPtr();
+ const DropIndxImplReq
+ reqData = *(const DropIndxImplReq*)signal->getDataPtr(),
+ *req = &reqData;
+
TcIndexData* indexData;
- BlockReference sender = signal->senderBlockRef();
if (ERROR_INSERTED(8036) ||
- (indexData = c_theIndexes.getPtr(dropIndxReq->getIndexId())) == NULL) {
+ (indexData = c_theIndexes.getPtr(req->indexId)) == NULL) {
jam();
CLEAR_ERROR_INSERT_VALUE;
// Failed to find index record
- DropIndxRef * const dropIndxRef =
- (DropIndxRef *)signal->getDataPtrSend();
+ DropIndxImplRef* ref =
+ (DropIndxImplRef*)signal->getDataPtrSend();
- dropIndxRef->setConnectionPtr(dropIndxReq->getConnectionPtr());
- dropIndxRef->setErrorCode(DropIndxRef::IndexNotFound);
- sendSignal(sender, GSN_DROP_INDX_REF,
- signal, DropIndxRef::SignalLength, JBB);
+ ref->senderRef = reference();
+ ref->senderData = req->senderData;
+ ref->errorCode = DropIndxImplRef::IndexNotFound;
+
+ sendSignal(req->senderRef, GSN_DROP_INDX_IMPL_REF,
+ signal, DropIndxImplRef::SignalLength, JBB);
return;
}
// Release index record
- c_theIndexes.release(dropIndxReq->getIndexId());
+ c_theIndexes.release(req->indexId);
+
+ DropIndxImplConf* conf =
+ (DropIndxImplConf*)signal->getDataPtrSend();
- DropIndxConf * const dropIndxConf =
- (DropIndxConf *)signal->getDataPtrSend();
+ conf->senderRef = reference();
+ conf->senderData = req->senderData;
- dropIndxConf->setConnectionPtr(dropIndxReq->getConnectionPtr());
- sendSignal(sender, GSN_DROP_INDX_CONF,
- signal, DropIndxConf::SignalLength, JBB);
+ sendSignal(req->senderRef, GSN_DROP_INDX_IMPL_CONF,
+ signal, DropIndxImplConf::SignalLength, JBB);
}
void Dbtc::execTCINDXREQ(Signal* signal)
--- 1.69/storage/ndb/src/ndbapi/NdbDictionary.cpp 2007-01-11 15:25:22 +01:00
+++ 1.70/storage/ndb/src/ndbapi/NdbDictionary.cpp 2007-01-12 11:37:25 +01:00
@@ -1609,13 +1609,23 @@
NdbDictionary::Dictionary::dropIndex(const char * indexName,
const char * tableName)
{
- return m_impl.dropIndex(indexName, tableName);
+ int ret;
+ DO_TRANS(
+ ret,
+ m_impl.dropIndex(indexName, tableName)
+ );
+ return ret;
}
int
NdbDictionary::Dictionary::dropIndexGlobal(const Index &ind)
{
- return m_impl.dropIndexGlobal(NdbIndexImpl::getImpl(ind));
+ int ret;
+ DO_TRANS(
+ ret,
+ m_impl.dropIndexGlobal(NdbIndexImpl::getImpl(ind))
+ );
+ return ret;
}
const NdbDictionary::Index *
--- 1.161/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2007-01-11 15:25:22 +01:00
+++ 1.162/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2007-01-12 11:37:26 +01:00
@@ -3361,12 +3361,13 @@
tSignal.theLength = DropIndxReq::SignalLength;
DropIndxReq * const req = CAST_PTR(DropIndxReq, tSignal.getDataPtrSend());
- req->setUserRef(m_reference);
- req->setConnectionPtr(0);
- req->setRequestType(DropIndxReq::RT_USER);
- req->setTableId(~0); // DICT overwrites
- req->setIndexId(timpl.m_id);
- req->setIndexVersion(timpl.m_version);
+ req->clientRef = m_reference;
+ req->clientData = 0;
+ req->transId = m_tx.transId();
+ req->transKey = m_tx.transKey();
+ //req->setRequestType(DropIndxReq::RT_USER);//wl3600_todo out
+ req->indexId = timpl.m_id;
+ req->indexVersion = timpl.m_version;
int errCodes[] = { DropIndxRef::Busy, DropIndxRef::NotMaster, 0 };
int r = dictSignal(&tSignal, 0, 0,
@@ -3393,7 +3394,7 @@
LinearSectionPtr ptr[3])
{
const DropIndxRef* ref = CAST_CONSTPTR(DropIndxRef, signal->getDataPtr());
- m_error.code = ref->getErrorCode();
+ m_error.code = ref->errorCode;
if(m_error.code == ref->NotMaster)
m_masterNodeId= ref->masterNodeId;
m_waiter.signal(NO_WAIT);
--- New file ---
+++ BitKeeper/deleted/.del-DropIndxImpl.cpp 07/01/11 18:27:24
--- New file ---
+++ storage/ndb/include/kernel/signaldata/DropIndxImpl.hpp 07/01/11 18:28:17
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef DROP_INDX_IMPL_HPP
#define DROP_INDX_IMPL_HPP
#include "SignalData.hpp"
struct DropIndxImplReq {
friend bool printDROP_INDX_IMPL_REQ(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 6 );
Uint32 senderRef;
Uint32 senderData;
Uint32 tableId;
Uint32 tableVersion;
Uint32 indexId;
Uint32 indexVersion;
};
struct DropIndxImplConf {
friend bool printDROP_INDX_IMPL_CONF(FILE*, const Uint32*, Uint32, Uint16);
STATIC_CONST( SignalLength = 2 );
Uint32 senderRef;
Uint32 senderData;
};
struct DropIndxImplRef {
friend bool printDROP_INDX_IMPL_REF(FILE*, const Uint32*, Uint32, Uint16);
enum ErrorCode {
NoError = 0,
InvalidIndexVersion = 241,
Busy = 701,
BusyWithNR = 711,
NotMaster = 702,
IndexNotFound = 4243,
BadRequestType = 4247,
InvalidName = 4248,
NotAnIndex = 4254
};
STATIC_CONST( SignalLength = 6 );
Uint32 senderRef;
Uint32 senderData;
Uint32 errorCode;
Uint32 errorLine;
Uint32 errorNodeId;
Uint32 masterNodeId;
};
#endif
--- New file ---
+++ storage/ndb/src/common/debugger/signaldata/DropIndxImpl.cpp 07/01/11 22:48:03
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <signaldata/DropIndxImpl.hpp>
#include <SignalLoggerManager.hpp>
bool
printDROP_INDX_IMPL_REQ(FILE* output, const Uint32* theData, Uint32 len, Uint16 rbn)
{
const DropIndxImplReq* sig = (const DropIndxImplReq*)theData;
fprintf(output, " senderRef: %x", sig->senderRef);
fprintf(output, " senderData: %x", sig->senderData);
fprintf(output, "\n");
fprintf(output, " tableId: %x", sig->tableId);
fprintf(output, " tableVersion: %x", sig->tableVersion);
fprintf(output, "\n");
fprintf(output, " indexId: %x", sig->indexId);
fprintf(output, " indexVersion: %x", sig->indexVersion);
fprintf(output, "\n");
return true;
}
bool
printDROP_INDX_IMPL_CONF(FILE* output, const Uint32* theData, Uint32 len, Uint16 rbn)
{
const DropIndxImplConf* sig = (const DropIndxImplConf*)theData;
fprintf(output, " senderRef: %x", sig->senderRef);
fprintf(output, " senderData: %x", sig->senderData);
fprintf(output, "\n");
return true;
}
bool
printDROP_INDX_IMPL_REF(FILE* output, const Uint32* theData, Uint32 len, Uint16 rbn)
{
const DropIndxImplRef* sig = (const DropIndxImplRef*)theData;
fprintf(output, " senderRef: %x", sig->senderRef);
fprintf(output, " senderData: %x", sig->senderData);
fprintf(output, "\n");
fprintf(output, " errorCode: %u", sig->errorCode);
fprintf(output, " errorLine: %u", sig->errorLine);
fprintf(output, " errorNodeId: %u", sig->errorNodeId);
fprintf(output, " masterNodeId: %u", sig->masterNodeId);
fprintf(output, "\n");
return true;
}
--- 1.7/storage/ndb/src/common/debugger/signaldata/SchemaTransImpl.cpp 2007-01-11 15:36:33 +01:00
+++ 1.8/storage/ndb/src/common/debugger/signaldata/SchemaTransImpl.cpp 2007-01-12 11:37:25 +01:00
@@ -71,6 +71,9 @@
case GSN_CREATE_INDX_IMPL_REQ:
printCREATE_INDX_IMPL_REQ(output, pb_data, pb_len, rbn);
break;
+ case GSN_DROP_INDX_IMPL_REQ:
+ printDROP_INDX_IMPL_REQ(output, pb_data, pb_len, rbn);
+ break;
default:
{
Uint32 i;
--- 1.14/storage/ndb/src/common/debugger/signaldata/Makefile.am 2007-01-11 15:25:21 +01:00
+++ 1.15/storage/ndb/src/common/debugger/signaldata/Makefile.am 2007-01-12 11:37:25 +01:00
@@ -27,7 +27,7 @@
ScanFrag.cpp \
SchemaTrans.cpp SchemaTransImpl.cpp \
GetTabInfo.cpp CreateTab.cpp DropTable.cpp \
- CreateIndxImpl.cpp
+ CreateIndxImpl.cpp DropIndxImpl.cpp
include $(top_srcdir)/storage/ndb/config/common.mk.am
include $(top_srcdir)/storage/ndb/config/type_ndbapi.mk.am
@@ -48,6 +48,7 @@
@$(top_srcdir)/storage/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/storage/ndb/config/win-sources $@ $(libsignaldataprint_la_SOURCES)
@$(top_srcdir)/storage/ndb/config/win-libraries $@ LIB $(LDADD)
+
| Thread |
|---|
| • bk commit into 5.1 tree (pekka:1.2387) | pekka | 12 Jan |