MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:pekka Date:January 16 2007 11:44am
Subject:bk commit into 5.1 tree (pekka:1.2390)
View as plain text  
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-16 12:44:11+01:00, pekka@stripped +31 -0
  ndb - wl#3600 create trigger, part 1
  create trigger within DICT ( ops in other blocks done later ).
  BACKUP and SUMA use internal signal CREATE_TRIG_IMPL to TUP.

  storage/ndb/include/kernel/GlobalSignalNumbers.h@stripped, 2007-01-16 12:39:53+01:00, pekka@stripped +5 -1
    wl#3600 create trigger, part 1

  storage/ndb/include/kernel/signaldata/AlterIndx.hpp@stripped, 2007-01-16 12:39:53+01:00, pekka@stripped +2 -2
    wl#3600 create trigger, part 1

  storage/ndb/include/kernel/signaldata/AlterIndxImpl.hpp@stripped, 2007-01-16 12:39:53+01:00, pekka@stripped +2 -2
    wl#3600 create trigger, part 1

  storage/ndb/include/kernel/signaldata/CreateTrig.hpp@stripped, 2007-01-16 12:39:53+01:00, pekka@stripped +44 -356
    wl#3600 create trigger, part 1

  storage/ndb/include/kernel/signaldata/CreateTrigImpl.hpp@stripped, 2007-01-16 12:39:53+01:00, pekka@stripped +95 -0
    wl#3600 create trigger, part 1

  storage/ndb/include/kernel/signaldata/CreateTrigImpl.hpp@stripped, 2007-01-14 13:53:13+01:00, pekka@stripped +0 -0
    BitKeeper file /export/space/pekka/ndb/version/my52-wl3600-a/storage/ndb/include/kernel/signaldata/CreateTrigImpl.hpp

  storage/ndb/include/kernel/signaldata/CreateTrigImpl.hpp@stripped, 2007-01-14 13:53:13+01:00, pekka@stripped +0 -0

  storage/ndb/include/kernel/signaldata/SignalData.hpp@stripped, 2007-01-16 12:39:53+01:00, pekka@stripped +4 -0
    wl#3600 create trigger, part 1

  storage/ndb/include/kernel/trigger_definitions.h@stripped, 2007-01-16 12:39:53+01:00, pekka@stripped +135 -0
    wl#3600 create trigger, part 1

  storage/ndb/src/common/debugger/signaldata/CreateTrig.cpp@stripped, 2007-01-16 12:39:53+01:00, pekka@stripped +84 -90
    wl#3600 create trigger, part 1

  storage/ndb/src/common/debugger/signaldata/CreateTrigImpl.cpp@stripped, 2007-01-16 12:39:53+01:00, pekka@stripped +74 -0
    wl#3600 create trigger, part 1

  storage/ndb/src/common/debugger/signaldata/CreateTrigImpl.cpp@stripped, 2007-01-14 17:32:50+01:00, pekka@stripped +0 -0
    BitKeeper file /export/space/pekka/ndb/version/my52-wl3600-a/storage/ndb/src/common/debugger/signaldata/CreateTrigImpl.cpp

  storage/ndb/src/common/debugger/signaldata/CreateTrigImpl.cpp@stripped, 2007-01-14 17:32:50+01:00, pekka@stripped +0 -0

  storage/ndb/src/common/debugger/signaldata/Makefile.am@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +3 -1
    wl#3600 create trigger, part 1

  storage/ndb/src/common/debugger/signaldata/SchemaTransImpl.cpp@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +3 -0
    wl#3600 create trigger, part 1

  storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +4 -0
    wl#3600 create trigger, part 1

  storage/ndb/src/common/debugger/signaldata/SignalNames.cpp@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +4 -0
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/backup/Backup.cpp@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +46 -35
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/backup/Backup.hpp@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +2 -2
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/backup/BackupInit.cpp@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +2 -2
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +690 -45
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +98 -31
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +3 -3
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +3 -3
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +10 -10
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +1 -1
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +1 -1
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +39 -27
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp@stripped, 2007-01-16 12:39:55+01:00, pekka@stripped +3 -3
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp@stripped, 2007-01-16 12:39:55+01:00, pekka@stripped +1 -1
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp@stripped, 2007-01-16 12:39:55+01:00, pekka@stripped +50 -43
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/suma/Suma.cpp@stripped, 2007-01-16 12:39:55+01:00, pekka@stripped +42 -31
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/suma/Suma.hpp@stripped, 2007-01-16 12:39:55+01:00, pekka@stripped +2 -2
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/blocks/suma/SumaInit.cpp@stripped, 2007-01-16 12:39:55+01:00, pekka@stripped +2 -2
    wl#3600 create trigger, part 1

  storage/ndb/src/kernel/main.cpp@stripped, 2007-01-16 12:39:54+01:00, pekka@stripped +1 -1
    wl#3600 create trigger, 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.35/storage/ndb/include/kernel/GlobalSignalNumbers.h	2007-01-14 12:39:53 +01:00
+++ 1.36/storage/ndb/include/kernel/GlobalSignalNumbers.h	2007-01-16 12:39:53 +01:00
@@ -23,7 +23,7 @@
  *
  * When adding a new signal, remember to update MAX_GSN and SignalNames.cpp
  */
-const GlobalSignalNumber MAX_GSN = 748;
+const GlobalSignalNumber MAX_GSN = 751;
 
 struct GsnName {
   GlobalSignalNumber gsn;
@@ -1006,5 +1006,9 @@
 #define GSN_ALTER_INDX_IMPL_REQ         746
 #define GSN_ALTER_INDX_IMPL_CONF        747
 #define GSN_ALTER_INDX_IMPL_REF         748
+
+#define GSN_CREATE_TRIG_IMPL_REQ        749
+#define GSN_CREATE_TRIG_IMPL_CONF       750
+#define GSN_CREATE_TRIG_IMPL_REF        751
 
 #endif

--- 1.5/storage/ndb/include/kernel/signaldata/AlterIndx.hpp	2007-01-14 12:39:54 +01:00
+++ 1.6/storage/ndb/include/kernel/signaldata/AlterIndx.hpp	2007-01-16 12:39:53 +01:00
@@ -39,8 +39,8 @@
     RT_TUX = 8 << 8
   };
   enum RequestType {
-    AlterIndexOffline = 0,
-    AlterIndexOnline = 1
+    AlterIndexOnline = 1,
+    AlterIndexOffline = 2
   };
   STATIC_CONST( SignalLength = 7 );
 

--- 1.5/storage/ndb/include/kernel/signaldata/CreateTrig.hpp	2006-01-12 19:50:32 +01:00
+++ 1.6/storage/ndb/include/kernel/signaldata/CreateTrig.hpp	2007-01-16 12:39:53 +01:00
@@ -19,17 +19,12 @@
 
 #include "SignalData.hpp"
 #include <Bitmask.hpp>
-#include <trigger_definitions.h>
 #include <AttributeList.hpp>
 
-/**
- * CreateTrigReq.
- */
-class CreateTrigReq {
+struct CreateTrigReq {
   friend bool printCREATE_TRIG_REQ(FILE*, const Uint32*, Uint32, Uint16);
 
-public:
-  enum RequestType {
+  enum xxxRequestType {//wl3600_todo remove
     RT_UNDEFINED = 0,
     RT_USER = 1,
     RT_ALTER_INDEX = 2,
@@ -41,256 +36,50 @@
     RT_TC = 5 << 8,
     RT_LQH = 6 << 8
   };
-  STATIC_CONST( SignalLength = 9 + MAXNROFATTRIBUTESINWORDS);
+  enum RequestType {
+    CreateTriggerOnline = 1,
+    CreateTriggerOffline = 2
+  };
+
+  STATIC_CONST( SignalLength = 11 + MAXNROFATTRIBUTESINWORDS);
   SECTION( TRIGGER_NAME_SECTION = 0 );
   SECTION( ATTRIBUTE_MASK_SECTION = 1 );        // not yet in use
-  enum KeyValues {
+  enum xxxKeyValues {//wl3600_todo use DictTabInfo
     TriggerNameKey = 0xa1
   };
 
-private:
-  Uint32 m_userRef;
-  Uint32 m_connectionPtr;
-  Uint32 m_requestInfo;
-  Uint32 m_tableId;
-  Uint32 m_indexId;             // only for index trigger
-  Uint32 m_triggerId;           // only set by DICT
-  Uint32 m_triggerInfo;         // flags | event | timing | type
-  Uint32 m_online;              // alter online (not normally for subscription)
-  Uint32 m_receiverRef;         // receiver for subscription trigger
-  AttributeMask m_attributeMask;
-  // extra
-  Uint32 m_opKey;
-
-public:
-  Uint32 getUserRef() const {
-    return m_userRef;
-  }
-  void setUserRef(Uint32 val) {
-    m_userRef = val;
-  }
-  Uint32 getConnectionPtr() const {
-    return m_connectionPtr;
-  }
-  void setConnectionPtr(Uint32 val) {
-    m_connectionPtr = val;
-  }
-  CreateTrigReq::RequestType getRequestType() const {
-    const Uint32 val = BitmaskImpl::getField(1, &m_requestInfo, 0, 16);
-    return (CreateTrigReq::RequestType)val;
-  }
-  void setRequestType(CreateTrigReq::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 getTriggerId() const {
-    return m_triggerId;
-  }
-  void setTriggerId(Uint32 val) {
-    m_triggerId = val;
-  }
-  Uint32 getTriggerInfo() const {
-    return m_triggerInfo;
-  }
-  void setTriggerInfo(Uint32 val) {
-    m_triggerInfo = val;
-  }
-  TriggerType::Value getTriggerType() const {
-    const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 0, 8);
-    return (TriggerType::Value)val;
-  }
-  void setTriggerType(TriggerType::Value val) {
-    BitmaskImpl::setField(1, &m_triggerInfo, 0, 8, (Uint32)val);
-  }
-  TriggerActionTime::Value getTriggerActionTime() const {
-    const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 8, 8);
-    return (TriggerActionTime::Value)val;
-  }
-  void setTriggerActionTime(TriggerActionTime::Value val) {
-    BitmaskImpl::setField(1, &m_triggerInfo, 8, 8, (Uint32)val);
-  }
-  TriggerEvent::Value getTriggerEvent() const {
-    const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 16, 8);
-    return (TriggerEvent::Value)val;
-  }
-  void setTriggerEvent(TriggerEvent::Value val) {
-    BitmaskImpl::setField(1, &m_triggerInfo, 16, 8, (Uint32)val);
-  }
-  bool getMonitorReplicas() const {
-    return BitmaskImpl::getField(1, &m_triggerInfo, 24, 1);
-  }
-  void setMonitorReplicas(bool val) {
-    BitmaskImpl::setField(1, &m_triggerInfo, 24, 1, val);
-  }
-  bool getMonitorAllAttributes() const {
-    return BitmaskImpl::getField(1, &m_triggerInfo, 25, 1);
-  }
-  void setMonitorAllAttributes(bool val) {
-    BitmaskImpl::setField(1, &m_triggerInfo, 25, 1, val);
-  }
-  bool getReportAllMonitoredAttributes() const {
-    return BitmaskImpl::getField(1, &m_triggerInfo, 26, 1);
-  }
-  void setReportAllMonitoredAttributes(bool val) {
-    BitmaskImpl::setField(1, &m_triggerInfo, 26, 1, val);
-  }
-  Uint32 getOnline() const {
-    return m_online;
-  }
-  void setOnline(Uint32 val) {
-    m_online = val;
-  }
-  Uint32 getReceiverRef() const {
-    return m_receiverRef;
-  }
-  void setReceiverRef(Uint32 val) {
-    m_receiverRef = val;
-  }
-  AttributeMask& getAttributeMask() {
-    return m_attributeMask;
-  }
-  const AttributeMask& getAttributeMask() const {
-    return m_attributeMask;
-  }
-  void clearAttributeMask() {
-    m_attributeMask.clear();
-  }
-  void setAttributeMask(const AttributeMask& val) {
-    m_attributeMask = val;
-  }
-  void setAttributeMask(Uint16 val) {
-    m_attributeMask.set(val);
-  }
-  Uint32 getOpKey() const {
-    return m_opKey;
-  }
-  void setOpKey(Uint32 val) {
-    m_opKey = val;
-  }
+  Uint32 clientRef;
+  Uint32 clientData;
+  Uint32 transId;
+  Uint32 transKey;
+  Uint32 requestType;
+  Uint32 tableId;
+  Uint32 tableVersion;
+  Uint32 indexId;       // only for index trigger
+  Uint32 indexVersion;
+  Uint32 triggerInfo;   // type | timing | event | flags
+  Uint32 receiverRef;   // receiver for subscription trigger
+  AttributeMask attributeMask;
 };
 
-/**
- * CreateTrigConf.
- */
-class CreateTrigConf {
+struct CreateTrigConf {
   friend bool printCREATE_TRIG_CONF(FILE*, const Uint32*, Uint32, Uint16);
 
-public:
-  STATIC_CONST( InternalLength = 3 );
-  STATIC_CONST( SignalLength = 7 );
+  STATIC_CONST( SignalLength = 8 );
 
-private:
-  Uint32 m_userRef;
-  Uint32 m_connectionPtr;
-  Uint32 m_requestInfo;
-  Uint32 m_tableId;
-  Uint32 m_indexId;
-  Uint32 m_triggerId;
-  Uint32 m_triggerInfo;         // BACKUP wants this
-
-public:
-  Uint32 getUserRef() const {
-    return m_userRef;
-  }
-  void setUserRef(Uint32 val) {
-    m_userRef = val;
-  }
-  Uint32 getConnectionPtr() const {
-    return m_connectionPtr;
-  }
-  void setConnectionPtr(Uint32 val) {
-    m_connectionPtr = val;
-  }
-  CreateTrigReq::RequestType getRequestType() const {
-    return (CreateTrigReq::RequestType)m_requestInfo;
-  }
-  void setRequestType(CreateTrigReq::RequestType val) {
-    m_requestInfo = (Uint32)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 getTriggerId() const {
-    return m_triggerId;
-  }
-  void setTriggerId(Uint32 val) {
-    m_triggerId = val;
-  }
-  Uint32 getTriggerInfo() const {
-    return m_triggerInfo;
-  }
-  void setTriggerInfo(Uint32 val) {
-    m_triggerInfo = val;
-  }
-  TriggerType::Value getTriggerType() const {
-    const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 0, 8);
-    return (TriggerType::Value)val;
-  }
-  void setTriggerType(TriggerType::Value val) {
-    BitmaskImpl::setField(1, &m_triggerInfo, 0, 8, (Uint32)val);
-  }
-  TriggerActionTime::Value getTriggerActionTime() const {
-    const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 8, 8);
-    return (TriggerActionTime::Value)val;
-  }
-  void setTriggerActionTime(TriggerActionTime::Value val) {
-    BitmaskImpl::setField(1, &m_triggerInfo, 8, 8, (Uint32)val);
-  }
-  TriggerEvent::Value getTriggerEvent() const {
-    const Uint32 val = BitmaskImpl::getField(1, &m_triggerInfo, 16, 8);
-    return (TriggerEvent::Value)val;
-  }
-  void setTriggerEvent(TriggerEvent::Value val) {
-    BitmaskImpl::setField(1, &m_triggerInfo, 16, 8, (Uint32)val);
-  }
-  bool getMonitorReplicas() const {
-    return BitmaskImpl::getField(1, &m_triggerInfo, 24, 1);
-  }
-  void setMonitorReplicas(bool val) {
-    BitmaskImpl::setField(1, &m_triggerInfo, 24, 1, val);
-  }
-  bool getMonitorAllAttributes() const {
-    return BitmaskImpl::getField(1, &m_triggerInfo, 25, 1);
-  }
-  void setMonitorAllAttributes(bool val) {
-    BitmaskImpl::setField(1, &m_triggerInfo, 25, 1, val);
-  }
+  Uint32 senderRef;
+  Uint32 clientData;
+  Uint32 transId;
+  Uint32 requestType;
+  Uint32 tableId;
+  Uint32 indexId;
+  Uint32 triggerId;
+  Uint32 triggerInfo;
 };
 
-/**
- * CreateTrigRef.
- */
-class CreateTrigRef {
+struct CreateTrigRef {
   friend bool printCREATE_TRIG_REF(FILE*, const Uint32*, Uint32, Uint16);
 
-public:
   enum ErrorCode {
     NoError = 0,
     Busy = 701,
@@ -304,120 +93,19 @@
     InvalidName = 4248,
     InvalidTable = 4249
   };
-  STATIC_CONST( SignalLength = CreateTrigConf::SignalLength + 3 );
+  STATIC_CONST( SignalLength = 11 );
 
-private:
-  CreateTrigConf m_conf;
-  //Uint32 m_userRef;
-  //Uint32 m_connectionPtr;
-  //Uint32 m_requestInfo;
-  //Uint32 m_tableId;
-  //Uint32 m_indexId;
-  //Uint32 m_triggerId;
-  //Uint32 m_triggerInfo;
-  Uint32 m_errorCode;
-  Uint32 m_errorLine;
-  union {
-    Uint32 m_errorNode;
-    Uint32 masterNodeId; // When NotMaster
-  };
-public:
-  CreateTrigConf* getConf() {
-    return &m_conf;
-  }
-  const CreateTrigConf* getConf() const {
-    return &m_conf;
-  }
-  Uint32 getUserRef() const {
-    return m_conf.getUserRef();
-  }
-  void setUserRef(Uint32 val) {
-    m_conf.setUserRef(val);
-  }
-  Uint32 getConnectionPtr() const {
-    return m_conf.getConnectionPtr();
-  }
-  void setConnectionPtr(Uint32 val) {
-    m_conf.setConnectionPtr(val);
-  }
-  CreateTrigReq::RequestType getRequestType() const {
-    return m_conf.getRequestType();
-  }
-  void setRequestType(CreateTrigReq::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 getTriggerId() const {
-    return m_conf.getTriggerId();
-  }
-  void setTriggerId(Uint32 val) {
-    m_conf.setTriggerId(val);
-  }
-  Uint32 getTriggerInfo() const {
-    return m_conf.getTriggerInfo();
-  }
-  void setTriggerInfo(Uint32 val) {
-    m_conf.setTriggerInfo(val);
-  }
-  TriggerType::Value getTriggerType() const {
-    return m_conf.getTriggerType();
-  }
-  void setTriggerType(TriggerType::Value val) {
-    m_conf.setTriggerType(val);
-  }
-  TriggerActionTime::Value getTriggerActionTime() const {
-    return m_conf.getTriggerActionTime();
-  }
-  void setTriggerActionTime(TriggerActionTime::Value val) {
-    m_conf.setTriggerActionTime(val);
-  }
-  TriggerEvent::Value getTriggerEvent() const {
-    return m_conf.getTriggerEvent();
-  }
-  void setTriggerEvent(TriggerEvent::Value val) {
-    m_conf.setTriggerEvent(val);
-  }
-  bool getMonitorReplicas() const {
-    return m_conf.getMonitorReplicas();
-  }
-  void setMonitorReplicas(bool val) {
-    m_conf.setMonitorReplicas(val);
-  }
-  bool getMonitorAllAttributes() const {
-    return m_conf.getMonitorAllAttributes();
-  }
-  void setMonitorAllAttributes(bool val) {
-    m_conf.setMonitorAllAttributes(val);
-  }
-  CreateTrigRef::ErrorCode getErrorCode() const {
-    return (CreateTrigRef::ErrorCode)m_errorCode;
-  }
-  void setErrorCode(CreateTrigRef::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 requestType;
+  Uint32 tableId;
+  Uint32 indexId;
+  Uint32 triggerInfo;
+  Uint32 errorCode;
+  Uint32 errorLine;
+  Uint32 errorNodeId;
+  Uint32 masterNodeId;
 };
 
 #endif

--- 1.19/storage/ndb/include/kernel/signaldata/SignalData.hpp	2007-01-14 12:39:54 +01:00
+++ 1.20/storage/ndb/include/kernel/signaldata/SignalData.hpp	2007-01-16 12:39:53 +01:00
@@ -261,4 +261,8 @@
 GSN_PRINT_SIGNATURE(printALTER_INDX_IMPL_CONF);
 GSN_PRINT_SIGNATURE(printALTER_INDX_IMPL_REF);
 
+GSN_PRINT_SIGNATURE(printCREATE_TRIG_IMPL_REQ);
+GSN_PRINT_SIGNATURE(printCREATE_TRIG_IMPL_CONF);
+GSN_PRINT_SIGNATURE(printCREATE_TRIG_IMPL_REF);
+
 #endif

--- 1.7/storage/ndb/include/kernel/trigger_definitions.h	2005-11-08 06:46:19 +01:00
+++ 1.8/storage/ndb/include/kernel/trigger_definitions.h	2007-01-16 12:39:53 +01:00
@@ -19,6 +19,8 @@
 
 #include <ndb_global.h>
 #include "ndb_limits.h"
+#include <kernel_types.h>
+#include <Bitmask.hpp>
 #include <signaldata/DictTabInfo.hpp>
 
 #define ILLEGAL_TRIGGER_ID ((Uint32)(~0))
@@ -57,6 +59,139 @@
     TE_UPDATE = 2,
     TE_CUSTOM = 3    /* Hardcoded per TriggerType */
   };
+};
+
+// trigger info as struct
+struct TriggerStruct {
+  TriggerType::Value triggerType;
+  TriggerActionTime::Value triggerActionTime;
+  TriggerEvent::Value triggerEvent;
+  bool monitorReplicas;
+  bool monitorAllAttributes;
+  bool reportAllMonitoredAttributes;
+};
+
+// static methods
+struct TriggerInfo {
+  // get/set bits in Uint32
+  static TriggerType::Value
+  getTriggerType(const Uint32& info) {
+    const Uint32 val = BitmaskImpl::getField(1, &info, 0, 8);
+    return (TriggerType::Value)val;
+  }
+  static void
+  setTriggerType(Uint32& info, TriggerType::Value val) {
+    BitmaskImpl::setField(1, &info, 0, 8, (Uint32)val);
+  }
+  static TriggerActionTime::Value
+  getTriggerActionTime(const Uint32& info) {
+    const Uint32 val = BitmaskImpl::getField(1, &info, 8, 8);
+    return (TriggerActionTime::Value)val;
+  }
+  static void
+  setTriggerActionTime(Uint32& info, TriggerActionTime::Value val) {
+    BitmaskImpl::setField(1, &info, 8, 8, (Uint32)val);
+  }
+  static TriggerEvent::Value
+  getTriggerEvent(const Uint32& info) {
+    const Uint32 val = BitmaskImpl::getField(1, &info, 16, 8);
+    return (TriggerEvent::Value)val;
+  }
+  static void
+  setTriggerEvent(Uint32& info, TriggerEvent::Value val) {
+    BitmaskImpl::setField(1, &info, 16, 8, (Uint32)val);
+  }
+  static bool
+  getMonitorReplicas(const Uint32& info) {
+    return BitmaskImpl::getField(1, &info, 24, 1);
+  }
+  static void
+  setMonitorReplicas(Uint32& info, bool val) {
+    BitmaskImpl::setField(1, &info, 24, 1, val);
+  }
+  static bool
+  getMonitorAllAttributes(const Uint32& info) {
+    return BitmaskImpl::getField(1, &info, 25, 1);
+  }
+  static void
+  setMonitorAllAttributes(Uint32& info, bool val) {
+    BitmaskImpl::setField(1, &info, 25, 1, val);
+  }
+  static bool
+  getReportAllMonitoredAttributes(const Uint32& info) {
+    return BitmaskImpl::getField(1, &info, 26, 1);
+  }
+  static void
+  setReportAllMonitoredAttributes(Uint32& info, bool val) {
+    BitmaskImpl::setField(1, &info, 26, 1, val);
+  }
+  // convert from/to struct
+  static void
+  getTriggerInfo(const Uint32& info, TriggerStruct& str) {
+    str.triggerType = getTriggerType(info);
+    str.triggerActionTime = getTriggerActionTime(info);
+    str.triggerEvent = getTriggerEvent(info);
+    str.monitorReplicas = getMonitorReplicas(info);
+    str.monitorAllAttributes = getMonitorAllAttributes(info);
+    str.reportAllMonitoredAttributes = getReportAllMonitoredAttributes(info);
+  }
+  static void
+  setTriggerInfo(Uint32& info, const TriggerStruct& str) {
+    info = 0;
+    setTriggerType(info, str.triggerType);
+    setTriggerActionTime(info, str.triggerActionTime);
+    setTriggerEvent(info, str.triggerEvent);
+    setMonitorReplicas(info, str.monitorReplicas);
+    setMonitorAllAttributes(info, str.monitorAllAttributes);
+    setReportAllMonitoredAttributes(info, str.reportAllMonitoredAttributes);
+  }
+  // for debug print
+  static const char*
+  triggerTypeName(Uint32 val) {
+    switch (val) {
+    case TriggerType::SECONDARY_INDEX:
+      return "SECONDARY_INDEX";
+    case TriggerType::SUBSCRIPTION:
+      return "SUBSCRIPTION";
+    case TriggerType::READ_ONLY_CONSTRAINT:
+      return "READ_ONLY_CONSTRAINT";
+    case TriggerType::ORDERED_INDEX:
+      return "ORDERED_INDEX";
+    case TriggerType::SUBSCRIPTION_BEFORE:
+      return "SUBSCRIPTION_BEFORE";
+    }
+    return "UNKNOWN";
+  }
+  static const char*
+  triggerActionTimeName(Uint32 val) {
+    switch (val) {
+    case TriggerActionTime::TA_BEFORE:
+      return "TA_BEFORE";
+    case TriggerActionTime::TA_AFTER:
+      return "TA_AFTER";
+    case TriggerActionTime::TA_DEFERRED:
+      return "TA_DEFERRED";
+    case TriggerActionTime::TA_DETACHED:
+      return "TA_DETACHED";
+    case TriggerActionTime::TA_CUSTOM:
+      return "TA_CUSTOM";
+    }
+    return "UNKNOWN";
+  }
+  static const char*
+  triggerEventName(Uint32 val) {
+    switch (val) {
+    case TriggerEvent::TE_INSERT:
+      return "TE_INSERT";
+    case TriggerEvent::TE_DELETE:
+      return "TE_DELETE";
+    case TriggerEvent::TE_UPDATE:
+      return "TE_UPDATE";
+    case TriggerEvent::TE_CUSTOM:
+      return "TE_CUSTOM";
+    }
+    return "UNKNOWN";
+  }
 };
 
 #endif

--- 1.4/storage/ndb/src/common/debugger/signaldata/CreateTrig.cpp	2005-04-08 02:43:55 +02:00
+++ 1.5/storage/ndb/src/common/debugger/signaldata/CreateTrig.cpp	2007-01-16 12:39:53 +01:00
@@ -15,106 +15,100 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 #include <signaldata/CreateTrig.hpp>
+#include <trigger_definitions.h>
 
-bool printCREATE_TRIG_REQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo)
+bool
+printCREATE_TRIG_REQ(FILE* output, const Uint32* theData, Uint32 len, Uint16)
 {
-  const CreateTrigReq * const sig = (CreateTrigReq *) theData;
-
-  //char triggerName[MAX_TAB_NAME_SIZE];
-  char triggerType[32];
-  char triggerActionTime[32];
-  char triggerEvent[32];
-
-  //sig->getTriggerName((char *) &triggerName);
-  switch (sig->getTriggerType()) {
-  case(TriggerType::SECONDARY_INDEX): 
-    BaseString::snprintf(triggerType, sizeof(triggerType), "SECONDARY_INDEX");
-    break;
-  case(TriggerType::SUBSCRIPTION):
-    BaseString::snprintf(triggerType, sizeof(triggerType), "SUBSCRIPTION");
-    break;
-  case(TriggerType::ORDERED_INDEX): 
-    BaseString::snprintf(triggerType, sizeof(triggerType), "ORDERED_INDEX");
-    break;
-  default:
-    BaseString::snprintf(triggerType, sizeof(triggerType), "UNKNOWN [%d]", (int)sig->getTriggerType());
-    break;
-  }
-  switch (sig->getTriggerActionTime()) {
-  case (TriggerActionTime::TA_BEFORE):
-    BaseString::snprintf(triggerActionTime, sizeof(triggerActionTime), "BEFORE");
-    break;
-  case(TriggerActionTime::TA_AFTER):
-    BaseString::snprintf(triggerActionTime, sizeof(triggerActionTime), "AFTER");
-    break;
-  case (TriggerActionTime::TA_DEFERRED):
-    BaseString::snprintf(triggerActionTime, sizeof(triggerActionTime), "DEFERRED");
-    break;
-  case (TriggerActionTime::TA_DETACHED):
-    BaseString::snprintf(triggerActionTime, sizeof(triggerActionTime), "DETACHED");
-    break;
-  default:
-    BaseString::snprintf(triggerActionTime, sizeof(triggerActionTime),
-	     "UNKNOWN [%d]", (int)sig->getTriggerActionTime());
-    break;
-  }
-  switch (sig->getTriggerEvent()) {
-  case (TriggerEvent::TE_INSERT):
-    BaseString::snprintf(triggerEvent, sizeof(triggerEvent), "INSERT");
-    break;
-  case(TriggerEvent::TE_DELETE):
-    BaseString::snprintf(triggerEvent, sizeof(triggerEvent), "DELETE");
-    break;
-  case(TriggerEvent::TE_UPDATE):
-    BaseString::snprintf(triggerEvent, sizeof(triggerEvent), "UPDATE");
-    break;
-  case(TriggerEvent::TE_CUSTOM):
-    BaseString::snprintf(triggerEvent, sizeof(triggerEvent), "CUSTOM");
-    break;
-  default:
-    BaseString::snprintf(triggerEvent, sizeof(triggerEvent), "UNKNOWN [%d]", (int)sig->getTriggerEvent());
-    break;
-  }
-  
-  fprintf(output, "User: %u, ", sig->getUserRef());
-  //fprintf(output, "Trigger name: \"%s\"\n", triggerName);
-  fprintf(output, "Type: %s, ", triggerType);
-  fprintf(output, "Action: %s, ", triggerActionTime);
-  fprintf(output, "Event: %s, ", triggerEvent);
-  fprintf(output, "Trigger id: %u, ", sig->getTriggerId());
-  fprintf(output, "Table id: %u, ", sig->getTableId());
-  fprintf(output, "Monitor replicas: %s ", (sig->getMonitorReplicas())?"true":"false");
-  fprintf(output, "Monitor all attributes: %s ", (sig->getMonitorAllAttributes())?"true":"false");
-  const AttributeMask& attributeMask = sig->getAttributeMask();
-
+  const CreateTrigReq* sig = (const CreateTrigReq*)theData;
+  const Uint32 triggerType =
+    TriggerInfo::getTriggerType(sig->triggerInfo);
+  const Uint32 triggerActionTime =
+    TriggerInfo::getTriggerActionTime(sig->triggerInfo);
+  const Uint32 triggerEvent =
+    TriggerInfo::getTriggerEvent(sig->triggerInfo);
+  const Uint32 monitorReplicas =
+    TriggerInfo::getMonitorReplicas(sig->triggerInfo);
+  const Uint32 monitorAllAttributes =
+    TriggerInfo::getMonitorAllAttributes(sig->triggerInfo);
+  const Uint32 reportAllMonitoredAttributes =
+    TriggerInfo::getReportAllMonitoredAttributes(sig->triggerInfo);
+  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, " requestType: %u", sig->requestType);
+  fprintf(output, "\n");
+  fprintf(output, " tableId: %x", sig->tableId);
+  fprintf(output, " tableVersion: %x", sig->tableVersion);
+  fprintf(output, " indexId: %x", sig->indexId);
+  fprintf(output, " indexVersion: %x", sig->indexVersion);
+  fprintf(output, "\n");
+  fprintf(output, " triggerInfo: %x", sig->triggerInfo);
+  fprintf(output, "\n");
+  fprintf(output, "   triggerType: %u %s",
+                  triggerType,
+                  TriggerInfo::triggerTypeName(triggerType));
+  fprintf(output, "\n");
+  fprintf(output, "   triggerActionTime: %u %s",
+                  triggerActionTime,
+                  TriggerInfo::triggerActionTimeName(triggerActionTime));
+  fprintf(output, "\n");
+  fprintf(output, "   triggerEvent: %u %s",
+                  triggerEvent,
+                  TriggerInfo::triggerEventName(triggerEvent));
+  fprintf(output, "\n");
+  fprintf(output, "   monitorReplicas: %u",
+                  monitorReplicas);
+  fprintf(output, "\n");
+  fprintf(output, "   monitorAllAttributes: %u",
+                  monitorAllAttributes);
+  fprintf(output, "\n");
+  fprintf(output, "   reportAllMonitoredAttributes : %u",
+                  reportAllMonitoredAttributes);
+  fprintf(output, "\n");
+  fprintf(output, " receiverRef: %x", sig->receiverRef);
+  fprintf(output, "\n");
   char buf[MAXNROFATTRIBUTESINWORDS * 8 + 1];
-  fprintf(output, "Attribute mask: %s", attributeMask.getText(buf));
+  fprintf(output, " attributeMask: %s", sig->attributeMask.getText(buf));
   fprintf(output, "\n");  
-
-  return false;
+  return true;
 }
 
-bool printCREATE_TRIG_CONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo)
+bool
+printCREATE_TRIG_CONF(FILE* output, const Uint32* theData, Uint32 len, Uint16)
 {
-  const CreateTrigConf * const sig = (CreateTrigConf *) theData;
-  
-  fprintf(output, "User: %u, ", sig->getUserRef());
-  fprintf(output, "Trigger id: %u, ", sig->getTriggerId());
-  fprintf(output, "Table id: %u, ", sig->getTableId());
+  const CreateTrigConf* sig = (const CreateTrigConf*)theData;
+  fprintf(output, " senderRef: %x", sig->senderRef);
+  fprintf(output, " clientData: %x", sig->clientData);
+  fprintf(output, " transId: %x", sig->transId);
+  fprintf(output, " requestType: %x", sig->requestType);
   fprintf(output, "\n");  
-
-  return false;
+  fprintf(output, " tableId: %x", sig->tableId);
+  fprintf(output, " indexId: %x", sig->indexId);
+  fprintf(output, " triggerId: %x", sig->triggerId);
+  fprintf(output, " triggerInfo: %x", sig->triggerInfo);
+  fprintf(output, "\n");  
+  return true;
 }
 
-bool printCREATE_TRIG_REF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo)
+bool
+printCREATE_TRIG_REF(FILE* output, const Uint32* theData, Uint32 len, Uint16)
 {
-  const CreateTrigRef * const sig = (CreateTrigRef *) theData;
-
-  fprintf(output, "User: %u, ", sig->getUserRef());
-  fprintf(output, "Trigger id: %u, ", sig->getTriggerId());
-  fprintf(output, "Table id: %u, ", sig->getTableId());
-  fprintf(output, "Error code: %u, ", sig->getErrorCode());
+  const CreateTrigRef* sig = (CreateTrigRef*)theData;
+  fprintf(output, " senderRef: %x", sig->senderRef);
+  fprintf(output, " clientData: %x", sig->clientData);
+  fprintf(output, " transId: %x", sig->transId);
+  fprintf(output, " requestType: %x", sig->requestType);
+  fprintf(output, "\n");  
+  fprintf(output, " tableId: %x", sig->tableId);
+  fprintf(output, " indexId: %x", sig->indexId);
+  fprintf(output, " triggerInfo: %x", sig->triggerInfo);
+  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 false;
+  return true;
 }

--- 1.23/storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp	2007-01-14 12:39:54 +01:00
+++ 1.24/storage/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp	2007-01-16 12:39:54 +01:00
@@ -237,6 +237,10 @@
   ,{ GSN_ALTER_INDX_IMPL_CONF, printALTER_INDX_IMPL_CONF }
   ,{ GSN_ALTER_INDX_IMPL_REF, printALTER_INDX_IMPL_REF }
 
+  ,{ GSN_CREATE_TRIG_IMPL_REQ, printCREATE_TRIG_IMPL_REQ }
+  ,{ GSN_CREATE_TRIG_IMPL_CONF, printCREATE_TRIG_IMPL_CONF }
+  ,{ GSN_CREATE_TRIG_IMPL_REF, printCREATE_TRIG_IMPL_REF }
+
   ,{ 0, 0 }
 };
 

--- 1.20/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp	2007-01-14 12:39:54 +01:00
+++ 1.21/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp	2007-01-16 12:39:54 +01:00
@@ -659,5 +659,9 @@
   ,{ GSN_ALTER_INDX_IMPL_REQ, "ALTER_INDX_IMPL_REQ" }
   ,{ GSN_ALTER_INDX_IMPL_CONF, "ALTER_INDX_IMPL_CONF" }
   ,{ GSN_ALTER_INDX_IMPL_REF, "ALTER_INDX_IMPL_REF" }
+
+  ,{ GSN_CREATE_TRIG_IMPL_REQ, "CREATE_TRIG_IMPL_REQ" }
+  ,{ GSN_CREATE_TRIG_IMPL_CONF, "CREATE_TRIG_IMPL_CONF" }
+  ,{ GSN_CREATE_TRIG_IMPL_REF, "CREATE_TRIG_IMPL_REF" }
 };
 const unsigned short NO_OF_SIGNAL_NAMES = sizeof(SignalNames)/sizeof(GsnName);

--- 1.60/storage/ndb/src/kernel/blocks/backup/Backup.cpp	2006-12-05 22:45:13 +01:00
+++ 1.61/storage/ndb/src/kernel/blocks/backup/Backup.cpp	2007-01-16 12:39:54 +01:00
@@ -46,7 +46,7 @@
 
 #include <signaldata/UtilSequence.hpp>
 
-#include <signaldata/CreateTrig.hpp>
+#include <signaldata/CreateTrigImpl.hpp>
 #include <signaldata/AlterTrig.hpp>
 #include <signaldata/DropTrig.hpp>
 #include <signaldata/FireTrigOrd.hpp>
@@ -940,7 +940,7 @@
     }
     case GSN_WAIT_GCP_REQ:
     case GSN_DROP_TRIG_REQ:
-    case GSN_CREATE_TRIG_REQ:
+    case GSN_CREATE_TRIG_IMPL_REQ:
     case GSN_ALTER_TRIG_REQ:
       ptr.p->setErrorCode(AbortBackupOrd::BackupFailureDueToNodeFail);
       return;
@@ -1377,7 +1377,7 @@
    * We've received GSN_DEFINE_BACKUP_CONF from all participants.
    *
    * Our next step is to send START_BACKUP_REQ to all participants,
-   * who will then send CREATE_TRIG_REQ for all tables to their local
+   * who will then send CREATE_TRIG_IMPL_REQ for all tables to their local
    * DBTUP.
    */
   TablePtr tabPtr;
@@ -1410,7 +1410,8 @@
 Backup::sendCreateTrig(Signal* signal, 
 			   BackupRecordPtr ptr, TablePtr tabPtr)
 {
-  CreateTrigReq * req =(CreateTrigReq *)signal->getDataPtrSend();
+  CreateTrigImplReq * req =
+    (CreateTrigImplReq *)signal->getDataPtrSend();
 
   /*
    * First, setup the structures
@@ -1451,45 +1452,54 @@
   /*
    * now ask DBTUP to create
    */
-  ptr.p->slaveData.gsn = GSN_CREATE_TRIG_REQ;
+  ptr.p->slaveData.gsn = GSN_CREATE_TRIG_IMPL_REQ;
   ptr.p->slaveData.trigSendCounter = 3;
   ptr.p->slaveData.createTrig.tableId = tabPtr.p->tableId;
 
-  req->setUserRef(reference());
-  req->setReceiverRef(reference());
-  req->setConnectionPtr(ptr.i);
-  req->setRequestType(CreateTrigReq::RT_USER);
+  req->senderRef = reference();
+  req->receiverRef = reference();
+  req->senderData = ptr.i;
+  // TUP ignores following, there is no ALTER online stage
+  req->requestType = CreateTrigImplReq::CreateTriggerOnline;
 
   Bitmask<MAXNROFATTRIBUTESINWORDS> attrMask;
   createAttributeMask(tabPtr, attrMask);
-  req->setAttributeMask(attrMask);
-  req->setTableId(tabPtr.p->tableId);
-  req->setIndexId(RNIL);        // not used
-  req->setTriggerType(TriggerType::SUBSCRIPTION);
-  req->setTriggerActionTime(TriggerActionTime::TA_DETACHED);
-  req->setMonitorReplicas(true);
-  req->setMonitorAllAttributes(false);
-  req->setOnline(true);
+  req->attributeMask = attrMask;
+  req->tableId = tabPtr.p->tableId;
+  req->tableVersion = 0; // not used
+  req->indexId = ~(Uint32)0;
+  req->indexVersion = 0;
+
+  Uint32 ti = 0;
+  TriggerInfo::setTriggerType(ti, TriggerType::SUBSCRIPTION);
+  TriggerInfo::setTriggerActionTime(ti, TriggerActionTime::TA_DETACHED);
+  TriggerInfo::setMonitorReplicas(ti, true);
+  TriggerInfo::setMonitorAllAttributes(ti, false);
 
   for (int i=0; i < 3; i++) {
-    req->setTriggerId(tabPtr.p->triggerIds[i]);
-    req->setTriggerEvent(triggerEventValues[i]);
+    req->triggerId = tabPtr.p->triggerIds[i];
 
-    sendSignal(DBTUP_REF, GSN_CREATE_TRIG_REQ,
-	       signal, CreateTrigReq::SignalLength, JBB);
+    Uint32 ti2 = ti;
+    TriggerInfo::setTriggerEvent(ti2, triggerEventValues[i]);
+    req->triggerInfo = ti2;
+
+    sendSignal(DBTUP_REF, GSN_CREATE_TRIG_IMPL_REQ,
+	       signal, CreateTrigImplReq::SignalLength, JBB);
   }
 }
 
 void
-Backup::execCREATE_TRIG_CONF(Signal* signal)
+Backup::execCREATE_TRIG_IMPL_CONF(Signal* signal)
 {
   jamEntry();
-  CreateTrigConf * conf = (CreateTrigConf*)signal->getDataPtr();
+  const CreateTrigImplConf * conf =
+    (const CreateTrigImplConf*)signal->getDataPtr();
   
-  const Uint32 ptrI = conf->getConnectionPtr();
-  const Uint32 tableId = conf->getTableId();
-  const TriggerEvent::Value type = conf->getTriggerEvent();
-  const Uint32 triggerId = conf->getTriggerId();
+  const Uint32 ptrI = conf->senderData;
+  const Uint32 tableId = conf->tableId;
+  const TriggerEvent::Value type =
+    TriggerInfo::getTriggerEvent(conf->triggerInfo);
+  const Uint32 triggerId = conf->triggerId;
 
   BackupRecordPtr ptr LINT_SET_PTR;
   c_backupPool.getPtr(ptr, ptrI);
@@ -1500,7 +1510,7 @@
    * ptr.p->masterRef != reference()
    * as slaves and masters have triggers now.
    */
-  ndbrequire(ptr.p->slaveData.gsn == GSN_CREATE_TRIG_REQ);
+  ndbrequire(ptr.p->slaveData.gsn == GSN_CREATE_TRIG_IMPL_REQ);
   ndbrequire(ptr.p->slaveData.trigSendCounter.done() == false);
   ndbrequire(ptr.p->slaveData.createTrig.tableId == tableId);
 
@@ -1512,13 +1522,14 @@
 }
 
 void
-Backup::execCREATE_TRIG_REF(Signal* signal)
+Backup::execCREATE_TRIG_IMPL_REF(Signal* signal)
 {
   jamEntry();
-  CreateTrigRef* ref = (CreateTrigRef*)signal->getDataPtr();
+  const CreateTrigImplRef* ref =
+    (const CreateTrigImplRef*)signal->getDataPtr();
 
-  const Uint32 ptrI = ref->getConnectionPtr();
-  const Uint32 tableId = ref->getTableId();
+  const Uint32 ptrI = ref->senderData;
+  const Uint32 tableId = ref->tableId;
 
   BackupRecordPtr ptr LINT_SET_PTR;
   c_backupPool.getPtr(ptr, ptrI);
@@ -1529,11 +1540,11 @@
    * ptr.p->masterRef != reference()
    * as slaves and masters have triggers now
    */
-  ndbrequire(ptr.p->slaveData.gsn == GSN_CREATE_TRIG_REQ);
+  ndbrequire(ptr.p->slaveData.gsn == GSN_CREATE_TRIG_IMPL_REQ);
   ndbrequire(ptr.p->slaveData.trigSendCounter.done() == false);
   ndbrequire(ptr.p->slaveData.createTrig.tableId == tableId);
 
-  ptr.p->setErrorCode(ref->getErrorCode());
+  ptr.p->setErrorCode(ref->errorCode);
 
   createTrigReply(signal, ptr);
 }
@@ -2341,7 +2352,7 @@
     sendSignal(rg, GSN_ABORT_BACKUP_ORD, signal, 
 	       AbortBackupOrd::SignalLength, JBB);
     return;
-  case GSN_CREATE_TRIG_REQ:
+  case GSN_CREATE_TRIG_IMPL_REQ:
   case GSN_START_BACKUP_REQ:
   case GSN_ALTER_TRIG_REQ:
   case GSN_WAIT_GCP_REQ:

--- 1.26/storage/ndb/src/kernel/blocks/backup/Backup.hpp	2006-10-20 16:25:12 +02:00
+++ 1.27/storage/ndb/src/kernel/blocks/backup/Backup.hpp	2007-01-16 12:39:54 +01:00
@@ -97,8 +97,8 @@
   void execLIST_TABLES_CONF(Signal* signal);
   void execGET_TABINFOREF(Signal* signal);
   void execGET_TABINFO_CONF(Signal* signal);
-  void execCREATE_TRIG_REF(Signal* signal);
-  void execCREATE_TRIG_CONF(Signal* signal);
+  void execCREATE_TRIG_IMPL_REF(Signal* signal);
+  void execCREATE_TRIG_IMPL_CONF(Signal* signal);
   void execDROP_TRIG_REF(Signal* signal);
   void execDROP_TRIG_CONF(Signal* signal);
 

--- 1.25/storage/ndb/src/kernel/blocks/backup/BackupInit.cpp	2006-08-02 14:27:03 +02:00
+++ 1.26/storage/ndb/src/kernel/blocks/backup/BackupInit.cpp	2007-01-16 12:39:54 +01:00
@@ -59,8 +59,8 @@
   addRecSignal(GSN_GET_TABINFOREF, &Backup::execGET_TABINFOREF);
   addRecSignal(GSN_GET_TABINFO_CONF, &Backup::execGET_TABINFO_CONF);
 
-  addRecSignal(GSN_CREATE_TRIG_REF, &Backup::execCREATE_TRIG_REF);
-  addRecSignal(GSN_CREATE_TRIG_CONF, &Backup::execCREATE_TRIG_CONF);
+  addRecSignal(GSN_CREATE_TRIG_IMPL_REF, &Backup::execCREATE_TRIG_IMPL_REF);
+  addRecSignal(GSN_CREATE_TRIG_IMPL_CONF, &Backup::execCREATE_TRIG_IMPL_CONF);
 
   addRecSignal(GSN_DROP_TRIG_REF, &Backup::execDROP_TRIG_REF);
   addRecSignal(GSN_DROP_TRIG_CONF, &Backup::execDROP_TRIG_CONF);

--- 1.132/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2007-01-14 12:39:54 +01:00
+++ 1.133/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2007-01-16 12:39:54 +01:00
@@ -1586,7 +1586,6 @@
   c_opSubEvent(c_opRecordPool),
   c_opDropEvent(c_opRecordPool),
   c_opSignalUtil(c_opRecordPool),
-  c_opCreateTrigger(c_opRecordPool),
   c_opDropTrigger(c_opRecordPool),
   c_opAlterTrigger(c_opRecordPool),
   c_schemaOperation(c_opRecordPool),
@@ -1987,12 +1986,15 @@
   triggerPtr.p->triggerLocal = 0;
   triggerPtr.p->triggerId = RNIL;
   triggerPtr.p->tableId = RNIL;
+  triggerPtr.p->triggerInfo = ~(Uint32)0;
+#if wl3600_todo //remove
   triggerPtr.p->triggerType = (TriggerType::Value)~0;
   triggerPtr.p->triggerActionTime = (TriggerActionTime::Value)~0;
   triggerPtr.p->triggerEvent = (TriggerEvent::Value)~0;
   triggerPtr.p->monitorReplicas = false;
   triggerPtr.p->monitorAllAttributes = false;
   triggerPtr.p->attributeMask.clear();
+#endif
   triggerPtr.p->indexId = RNIL;
 }
 
@@ -2173,7 +2175,7 @@
   c_dropIndexDataPool.setSize(256);
   c_alterIndexDataPool.setSize(256);
   c_opBuildIndex.setSize(8);
-  c_opCreateTrigger.setSize(8);
+  c_createTriggerDataPool.setSize(256);
   c_opDropTrigger.setSize(8);
   c_opAlterTrigger.setSize(8);
 
@@ -4189,14 +4191,13 @@
     bool checkExist = (getOwnNodeId() != c_masterNodeId);
     handleTabInfoInit(r, &parseRecord, checkExist);
 
-    ndbrequire(parseRecord.errorCode == 0);
+    ndbrequire(parseRecord.errorCode == 0);//wl3600_todo return error
   }
 
-  //createTabPtr.p->m_tabInfoPtrI = tabInfoPtr.i;
-  //createTabPtr.p->m_fragmentsPtrI = fragPtr.i;
-  
-  //signal->header.m_noOfSections = 0;
-  
+  // save sections
+  saveOpSection(op_ptr, signal, CreateTabReq::DICT_TAB_INFO);
+  saveOpSection(op_ptr, signal, CreateTabReq::FRAGMENTATION);
+
   TableRecordPtr tabPtr;
   c_tableRecordPool.getPtr(tabPtr, tableId);
   tabPtr.p->packedSize = tabInfoPtr.sz;
@@ -9458,7 +9459,6 @@
   const OpInfo& info = getOpInfo(op_ptr);
 
   SchemaTransPtr& trans_ptr = op_ptr.p->m_trans_ptr;
-
   CreateIndexDataPtr createIndexPtr;
   getOpData(op_ptr, createIndexPtr);
 
@@ -10285,7 +10285,7 @@
   TableRecordPtr tablePtr;
   c_tableRecordPool.getPtr(tablePtr, indexPtr.p->primaryTableId);
 
-  // master sets primary table, participant verifies it agrees
+  // master sets primary table, slave verifies it agrees
   if (reference() == impl_req->senderRef) {
     impl_req->tableId = tablePtr.p->tableId;
     impl_req->tableVersion = tablePtr.p->tableVersion;
@@ -13135,6 +13135,46 @@
   parseClientReq<AlterIndexData, AlterIndxImplReq>(signal, trans_ptr);
 }
 
+const Dbdict::TriggerTmpl
+Dbdict::g_hashIndexTriggerTmpl[3] = {
+  { "NDB$INDEX_%u_INSERT",
+    {
+      TriggerType::SECONDARY_INDEX,
+      TriggerActionTime::TA_AFTER,
+      TriggerEvent::TE_INSERT,
+      false, false, true // monitor replicas, monitor all, report all
+    }
+  },
+  { "NDB$INDEX_%u_DELETE",
+    {
+      TriggerType::SECONDARY_INDEX,
+      TriggerActionTime::TA_AFTER,
+      TriggerEvent::TE_DELETE,
+      false, false, true
+    }
+  },
+  { "NDB$INDEX_%u_UPDATE",
+    {
+      TriggerType::SECONDARY_INDEX,
+      TriggerActionTime::TA_AFTER,
+      TriggerEvent::TE_UPDATE,
+      false, false, true
+    }
+  },
+};
+
+const Dbdict::TriggerTmpl
+Dbdict::g_orderedIndexTriggerTmpl[1] = {
+  { "NDB$INDEX_%u_CUSTOM",
+    {
+      TriggerType::ORDERED_INDEX,
+      TriggerActionTime::TA_CUSTOM,
+      TriggerEvent::TE_CUSTOM,
+      true, false, true
+    }
+  }
+};
+
 void
 Dbdict::alterIndex_parseCommon(Signal* signal, SchemaOpPtr op_ptr,
                               ErrorInfo& error)
@@ -13160,11 +13200,24 @@
     return;
   }
 
-  if (!indexPtr.p->isIndex()) {
+  // check it is an index and set trigger info for sub-ops
+  switch (indexPtr.p->tableType) {
+  case DictTabInfo::UniqueHashIndex:
+    jam();
+    alterIndexPtr.p->m_triggerTmpl = g_hashIndexTriggerTmpl;
+    alterIndexPtr.p->m_triggerCount = 3;
+    break;
+  case DictTabInfo::OrderedIndex:
+    jam();
+    alterIndexPtr.p->m_triggerTmpl = g_orderedIndexTriggerTmpl;
+    alterIndexPtr.p->m_triggerCount = 1;
+    break;
+  default:
     jam();
     setError(error, AlterIndxRef::NotAnIndex, __LINE__);
     return;
   }
+  alterIndexPtr.p->m_triggerNo = 0; // also in ctor
 
   if (indexPtr.p->tableVersion != impl_req->indexVersion) {
     jam();
@@ -13193,27 +13246,267 @@
     }
   }
 
+  // check request type
   switch (impl_req->requestType) {
-  case AlterIndxReq::AlterIndexOffline:
-    indexPtr.p->indexState = TableRecord::IS_DROPPING;
-    break;
   case AlterIndxReq::AlterIndexOnline:
     indexPtr.p->indexState = TableRecord::IS_BUILDING;
     break;
+  case AlterIndxReq::AlterIndexOffline:
+    indexPtr.p->indexState = TableRecord::IS_DROPPING;
+    break;
   default:
     setError(error, AlterIndxRef::BadRequestType, __LINE__);
     return;
   }
+
+  // set attribute mask (of primary table attribute ids)
+  getIndexAttrMask(indexPtr, alterIndexPtr.p->m_attrMask);
 }
 
 bool
 Dbdict::alterIndex_subOps(Signal* signal, SchemaOpPtr op_ptr)
 {
-  D("alterIndex_subOps");
+  D("alterIndex_subOps" << V(op_ptr.i) << *op_ptr.p);
+
+  AlterIndexDataPtr alterIndexPtr;
+  getOpData(op_ptr, alterIndexPtr);
+  const AlterIndxImplReq* impl_req = &alterIndexPtr.p->m_request;
+
+  // ops to create or drop triggers
+  if (alterIndexPtr.p->m_triggerNo < alterIndexPtr.p->m_triggerCount) {
+    jam();
+    switch (impl_req->requestType) {
+    case AlterIndxImplReq::AlterIndexOnline:
+      jam();
+      {
+        Callback c = {
+          safe_cast(&Dbdict::alterIndex_fromCreateTrigger),
+          op_ptr.p->op_key
+        };
+        op_ptr.p->m_callback = c;
+        alterIndex_toCreateTrigger(signal, op_ptr);
+      }
+      break;
+    case AlterIndxImplReq::AlterIndexOffline:
+      jam();
+      return false; //wl3600_todo not yet
+      {
+        Callback c = {
+          safe_cast(&Dbdict::alterIndex_fromDropTrigger),
+          op_ptr.p->op_key
+        };
+        op_ptr.p->m_callback = c;
+        alterIndex_toDropTrigger(signal, op_ptr);
+      }
+      break;
+    default:
+      ndbrequire(false);
+      break;
+    }
+    return true;
+  }
+
+  ndbrequire(alterIndexPtr.p->m_triggerNo == alterIndexPtr.p->m_triggerCount);
   return false;
 }
 
 void
+Dbdict::alterIndex_toCreateTrigger(Signal* signal, SchemaOpPtr op_ptr)
+{
+  D("alterIndex_toCreateTrigger");
+
+  SchemaTransPtr trans_ptr = op_ptr.p->m_trans_ptr;
+  AlterIndexDataPtr alterIndexPtr;
+  getOpData(op_ptr, alterIndexPtr);
+  const AlterIndxImplReq* impl_req = &alterIndexPtr.p->m_request;
+
+  const Uint32 triggerNo = alterIndexPtr.p->m_triggerNo;
+  const TriggerTmpl& triggerTmpl = alterIndexPtr.p->m_triggerTmpl[triggerNo];
+
+  CreateTrigReq* req = (CreateTrigReq*)signal->getDataPtrSend();
+
+  req->clientRef = reference();
+  req->clientData = op_ptr.p->op_key;
+  req->transId = trans_ptr.p->m_transId;
+  req->transKey = trans_ptr.p->trans_key;
+  req->requestType = CreateTrigReq::CreateTriggerOnline;
+  req->tableId = impl_req->tableId;
+  req->tableVersion = impl_req->tableVersion;
+  req->indexId = impl_req->indexId;
+  req->indexVersion = impl_req->indexVersion;
+
+  TriggerInfo::setTriggerInfo(req->triggerInfo, triggerTmpl.triggerStruct);
+
+  req->receiverRef = 0;
+  req->attributeMask = alterIndexPtr.p->m_attrMask;
+
+  char triggerName[MAX_TAB_NAME_SIZE];
+  sprintf(triggerName, triggerTmpl.nameFormat, triggerNo);
+
+  // name section
+  Uint32 buffer[2 + ((MAX_TAB_NAME_SIZE + 3) >> 2)];    // SP string
+  LinearWriter w(buffer, sizeof(buffer) >> 2);
+  w.reset();
+  w.add(DictTabInfo::TableName, triggerName);
+  LinearSectionPtr lsPtr[3];
+  lsPtr[0].p = buffer;
+  lsPtr[0].sz = w.getWordsUsed();
+
+  sendSignal(reference(), GSN_CREATE_TRIG_REQ, signal,
+             CreateTrigReq::SignalLength, JBB, lsPtr, 1);
+}
+
+void
+Dbdict::alterIndex_fromCreateTrigger(Signal* signal, Uint32 op_key, Uint32 ret)
+{
+  D("alterIndex_fromCreateTrigger" << hex << V(op_key) << dec << V(ret));
+
+  SchemaOpPtr op_ptr;
+  AlterIndexDataPtr alterIndexPtr;
+
+  findSchemaOp(op_ptr, alterIndexPtr, op_key);
+  ndbrequire(!op_ptr.isNull());
+  SchemaTransPtr trans_ptr = op_ptr.p->m_trans_ptr;
+  const AlterIndxImplReq* impl_req = &alterIndexPtr.p->m_request;
+
+  TableRecordPtr indexPtr;
+  c_tableRecordPool.getPtr(indexPtr, impl_req->indexId);
+
+  Uint32 errorCode = 0;
+  if (ret == 0) {
+    jam();
+    const CreateTrigConf* conf =
+      (const CreateTrigConf*)signal->getDataPtr();
+
+    ndbrequire(conf->transId == trans_ptr.p->m_transId);
+
+    const Uint32 triggerNo = alterIndexPtr.p->m_triggerNo;
+    ndbrequire(triggerNo < alterIndexPtr.p->m_triggerCount);
+
+    // connect trigger id to index wl3600_todo array would be nice
+    //indexPtr.p->indexTriggerId[triggerNo] = conf->triggerId;
+
+    alterIndexPtr.p->m_triggerNo = triggerNo + 1;
+  } else {
+    ndbrequire(false);//TODO
+    jam();
+    const CreateTrigRef* ref =
+      (const CreateTrigRef*)signal->getDataPtr();
+
+    ndbrequire(ref->transId == trans_ptr.p->m_transId);
+    ndbrequire(ref->errorCode != 0);
+    errorCode = ref->errorCode;
+  }
+
+  createSubOps(signal, op_ptr);
+}
+
+void
+Dbdict::alterIndex_toDropTrigger(Signal* signal, SchemaOpPtr op_ptr)
+{
+  ndbrequire(false);
+#if wl3600_todo
+  ndbrequire(false);
+  jam();
+  TableRecordPtr indexPtr;
+  c_tableRecordPool.getPtr(indexPtr, opPtr.p->m_request.getIndexId());
+  // start drop of index triggers
+  DropTrigReq* const req = (DropTrigReq*)signal->getDataPtrSend();
+  req->setUserRef(reference());
+  req->setConnectionPtr(opPtr.p->key);
+  req->setRequestType(DropTrigReq::RT_ALTER_INDEX);
+  req->addRequestFlag(opPtr.p->m_requestFlag);
+  req->setTableId(opPtr.p->m_request.getTableId());
+  req->setIndexId(opPtr.p->m_request.getIndexId());
+  req->setTriggerInfo(0);       // not used
+  opPtr.p->m_triggerCounter = 0;
+  if (indexPtr.p->isHashIndex()) {
+    // insert
+    req->setTriggerId(indexPtr.p->insertTriggerId);
+    sendSignal(reference(), GSN_DROP_TRIG_REQ, 
+        signal, DropTrigReq::SignalLength, JBB);
+    opPtr.p->m_triggerCounter++;
+    // update
+    req->setTriggerId(indexPtr.p->updateTriggerId);
+    sendSignal(reference(), GSN_DROP_TRIG_REQ, 
+        signal, DropTrigReq::SignalLength, JBB);
+    opPtr.p->m_triggerCounter++;
+    // delete
+    req->setTriggerId(indexPtr.p->deleteTriggerId);
+    sendSignal(reference(), GSN_DROP_TRIG_REQ, 
+        signal, DropTrigReq::SignalLength, JBB);
+    opPtr.p->m_triggerCounter++;
+    // build
+    if (indexPtr.p->buildTriggerId != RNIL) {
+      req->setTriggerId(indexPtr.p->buildTriggerId);
+      sendSignal(reference(), GSN_DROP_TRIG_REQ, 
+          signal, DropTrigReq::SignalLength, JBB);
+      opPtr.p->m_triggerCounter++;
+    }
+    return;
+  }
+  if (indexPtr.p->isOrderedIndex()) {
+    // custom
+    req->addRequestFlag(RequestFlag::RF_NOTCTRIGGER);
+    req->setTriggerId(indexPtr.p->customTriggerId);
+    sendSignal(reference(), GSN_DROP_TRIG_REQ, 
+        signal, DropTrigReq::SignalLength, JBB);
+    opPtr.p->m_triggerCounter++;
+    return;
+  }
+  ndbrequire(false);
+#endif
+}
+
+void
+Dbdict::alterIndex_fromDropTrigger(Signal* signal, Uint32 op_key, Uint32 ret)
+{
+  ndbrequire(false);
+#if wl3600_todo
+  D("alterIndex_fromCreateTrigger" << hex << V(op_key) << dec << V(ret));
+
+  SchemaOpPtr op_ptr;
+  AlterIndexDataPtr alterIndexPtr;
+
+  findSchemaOp(op_ptr, alterIndexPtr, op_key);
+  ndbrequire(!op_ptr.isNull());
+  SchemaTransPtr trans_ptr = op_ptr.p->m_trans_ptr;
+  const AlterIndxImplReq* impl_req = &alterIndexPtr.p->m_request;
+
+  TableRecordPtr indexPtr;
+  c_tableRecordPool.getPtr(indexPtr, impl_req->indexId);
+
+  Uint32 errorCode = 0;
+  if (ret == 0) {
+    jam();
+    const CreateTrigConf* conf =
+      (const CreateTrigConf*)signal->getDataPtr();
+
+    ndbrequire(conf->transId == trans_ptr.p->m_transId);
+
+    const Uint32 triggerNo = alterIndexPtr.p->m_triggerNo;
+    ndbrequire(triggerNo < alterIndexPtr.p->m_triggerCount);
+
+    // connect trigger id to index wl3600_todo array would be nice
+    //indexPtr.p->indexTriggerId[triggerNo] = conf->triggerId;
+
+    alterIndexPtr.p->m_triggerNo = triggerNo + 1;
+  } else {
+    ndbrequire(false);//TODO
+    jam();
+    const CreateTrigRef* ref =
+      (const CreateTrigRef*)signal->getDataPtr();
+
+    ndbrequire(ref->transId == trans_ptr.p->m_transId);
+    ndbrequire(ref->errorCode != 0);
+    errorCode = ref->errorCode;
+  }
+
+  createSubOps(signal, op_ptr);
+#endif
+}
+
+void
 Dbdict::alterIndex_reply(Signal* signal, SchemaOpPtr op_ptr)
 {
   D("alterIndex_reply" << V(op_ptr.i) << *op_ptr.p);
@@ -13288,12 +13581,12 @@
   const AlterIndxRef* ref =
     (const AlterIndxRef*)signal->getDataPtr();
 
-  D("execALTER_INDX_CONF" << hex << V(ref->clientData)
-                          << dec << V(ref->errorCode));
+  D("execALTER_INDX_REF" << hex << V(ref->clientData)
+                         << dec << V(ref->errorCode));
 
   SchemaOpPtr op_ptr;
   findSchemaOp(op_ptr, ref->clientData);
-  ndbrequire(ref->errorCode != 0); //wl3600_todo not crash master..
+  ndbrequire(ref->errorCode != 0);
   execute(signal, op_ptr.p->m_callback, ref->errorCode);
 }
 
@@ -13556,11 +13849,11 @@
 #endif
 }
 
+#if wl3600_todo
 void
 Dbdict::alterIndex_toCreateTrigger(Signal* signal, AlterIndexDataPtr opPtr)
 {
   ndbrequire(false);
-#if wl3600_todo
   jam();
   TableRecordPtr indexPtr;
   c_tableRecordPool.getPtr(indexPtr, opPtr.p->m_request.getIndexId());
@@ -13646,14 +13939,14 @@
     return;
   }
   ndbrequire(false);
-#endif
 }
+#endif
 
+#if wl3600_todo
 void
 Dbdict::alterIndex_fromCreateTrigger(Signal* signal, AlterIndexDataPtr opPtr)
 {
   ndbrequire(false);
-#if wl3600_todo
   jam();
   ndbrequire(opPtr.p->m_triggerCounter != 0);
   if (--opPtr.p->m_triggerCounter != 0) {
@@ -13679,14 +13972,14 @@
    * Build a bit later when REDO has been run
    */
   alterIndex_sendReply(signal, opPtr, true);
-#endif
 }
+#endif
 
+#if wl3600_todo
 void
 Dbdict::alterIndex_toDropTrigger(Signal* signal, AlterIndexDataPtr opPtr)
 {
   ndbrequire(false);
-#if wl3600_todo
   jam();
   TableRecordPtr indexPtr;
   c_tableRecordPool.getPtr(indexPtr, opPtr.p->m_request.getIndexId());
@@ -13735,14 +14028,14 @@
     return;
   }
   ndbrequire(false);
-#endif
 }
+#endif
 
+#if wl3600_todo
 void
 Dbdict::alterIndex_fromDropTrigger(Signal* signal, AlterIndexDataPtr opPtr)
 {
   ndbrequire(false);
-#if wl3600_todo
   jam();
   ndbrequire(opPtr.p->m_triggerCounter != 0);
   if (--opPtr.p->m_triggerCounter != 0) {
@@ -13760,8 +14053,8 @@
   if (isOrderedIndex)
     opPtr.p->m_requestType = AlterIndxReq::RT_DICT_COMMIT;
   alterIndex_sendSlaveReq(signal, opPtr);
-#endif
 }
+#endif
 
 void
 Dbdict::alterIndex_toBuildIndex(Signal* signal, AlterIndexDataPtr opPtr)
@@ -14160,6 +14453,8 @@
 void
 Dbdict::buildIndex_toCreateConstr(Signal* signal, OpBuildIndexPtr opPtr)
 {
+  ndbrequire(false);
+#if wl3600_todo
   jam();
   TableRecordPtr indexPtr;
   c_tableRecordPool.getPtr(indexPtr, opPtr.p->m_request.getIndexId());
@@ -14195,6 +14490,7 @@
   lsPtr[0].sz = w.getWordsUsed();
   sendSignal(reference(), GSN_CREATE_TRIG_REQ,
       signal, CreateTrigReq::SignalLength, JBB, lsPtr, 1);
+#endif
 }
 
 void
@@ -14412,12 +14708,106 @@
  * RT_LQH - sending to LQH (operation alter trigger)
  */
 
+// MODULE: CreateTrigger
+
+const Dbdict::OpInfo
+Dbdict::CreateTriggerData::g_opInfo = {
+  GSN_CREATE_TRIG_IMPL_REQ,
+  CreateTrigImplReq::SignalLength,
+  //
+  &Dbdict::createTrigger_seize,
+  &Dbdict::createTrigger_release,
+  //
+  &Dbdict::createTrigger_parse,
+  &Dbdict::createTrigger_parseCommon,
+  &Dbdict::createTrigger_subOps,
+  &Dbdict::createTrigger_reply,
+  //
+  &Dbdict::createTrigger_prepare,
+  &Dbdict::createTrigger_commit
+};
+
+bool
+Dbdict::createTrigger_seize(SchemaOpPtr op_ptr)
+{
+  return seizeOpData<CreateTriggerData>(op_ptr);
+}
+
+void
+Dbdict::createTrigger_release(SchemaOpPtr op_ptr)
+{
+  releaseOpData<CreateTriggerData>(op_ptr);
+}
+
 void
 Dbdict::execCREATE_TRIG_REQ(Signal* signal) 
 {
   jamEntry();
+  if (!assembleFragments(signal)) {
+    jam();
+    return;
+  }
+
+  const CreateTrigReq reqData =
+    *(const CreateTrigReq*)signal->getDataPtr();
+  const CreateTrigReq* req = &reqData;
+
+  ErrorInfo error;
+  do {
+    SchemaOpPtr op_ptr;
+    CreateTriggerDataPtr createTriggerPtr;
+
+    checkClientReq<CreateTriggerData, CreateTrigReq>(signal, op_ptr, error);
+    if (hasError(error)) {
+      jam();
+      break;
+    }
+    getOpData(op_ptr, createTriggerPtr);
+
+    CreateTrigImplReq* impl_req = &createTriggerPtr.p->m_request;
+    impl_req->senderRef = reference();
+    impl_req->senderData = op_ptr.p->op_key;
+    impl_req->requestType = req->requestType;
+    impl_req->tableId = req->tableId;
+    impl_req->tableVersion = req->tableVersion;
+    impl_req->indexId = req->indexId;
+    impl_req->indexVersion = req->indexVersion;
+    impl_req->triggerId = ILLEGAL_TRIGGER_ID;
+    impl_req->triggerInfo = req->triggerInfo;
+    impl_req->receiverRef = req->receiverRef;
+    impl_req->attributeMask = req->attributeMask;
+
+    createTrigger_parseCommon(signal, op_ptr, error);
+    if (hasError(error)) {
+      jam();
+      break;
+    }
+
+    schemaTrans_sendParseReq(signal, op_ptr);
+    return;
+  } while (0);
+
+  releaseSections(signal);
+
+  CreateTrigRef* ref = (CreateTrigRef*)signal->getDataPtrSend();
+
+  //wl3600_todo too many fields
+  ref->senderRef = reference();
+  ref->clientData = req->clientData;
+  ref->transId = req->transId;
+  ref->requestType = req->requestType;
+  ref->tableId = req->tableId;
+  ref->indexId = req->indexId;
+  ref->triggerInfo = req->triggerInfo;
+  getError(error, ref);
+
+  sendSignal(req->clientRef, GSN_CREATE_TRIG_REF, signal,
+             CreateTrigRef::SignalLength, JBB);
+
+#if wl3600_todo //parts to createTrigger_parseCommon
+  jamEntry();
   CreateTrigReq* const req = (CreateTrigReq*)signal->getDataPtrSend();
-  OpCreateTriggerPtr opPtr;
+  CreateTriggerDataPtr opPtr;
   const Uint32 senderRef = signal->senderBlockRef();
   const CreateTrigReq::RequestType requestType = req->getRequestType();
   if (requestType == CreateTrigReq::RT_USER ||
@@ -14440,7 +14830,7 @@
         jam();
 
 	releaseSections(signal);
-	OpCreateTrigger opBad;
+	CreateTriggerData opBad;
 	opPtr.p = &opBad;
 	opPtr.p->save(req);
 	opPtr.p->m_errorCode = CreateTrigRef::NotMaster;
@@ -14459,7 +14849,7 @@
     // seize operation record
     ndbrequire(signal->getLength() == CreateTrigReq::SignalLength + 1);
     const Uint32 opKey = req->getOpKey();
-    OpCreateTrigger opBusy;
+    CreateTriggerData opBusy;
     if (! c_opCreateTrigger.seize(opPtr))
       opPtr.p = &opBusy;
     opPtr.p->save(req);
@@ -14536,12 +14926,199 @@
   jam();
   // return to sender
   releaseSections(signal);
-  OpCreateTrigger opBad;
+  CreateTriggerData opBad;
   opPtr.p = &opBad;
   opPtr.p->save(req);
   opPtr.p->m_errorCode = CreateTrigRef::BadRequestType;
   opPtr.p->m_errorLine = __LINE__;
   createTrigger_sendReply(signal,  opPtr, true);
+#endif
+}
+
+void
+Dbdict::createTrigger_parse(Signal* signal, SchemaTransPtr trans_ptr)
+{
+  jam();
+  D("createTrigger_parse");
+  parseClientReq<CreateTriggerData, CreateTrigImplReq>(signal, trans_ptr);
+}
+
+void
+Dbdict::createTrigger_parseCommon(Signal* signal, SchemaOpPtr op_ptr,
+                                ErrorInfo& error)
+{
+  D("createTrigger_parseCommon" << V(op_ptr.i) << *op_ptr.p);
+
+  CreateTriggerDataPtr createTriggerPtr;
+  getOpData(op_ptr, createTriggerPtr);
+  CreateTrigImplReq* impl_req = &createTriggerPtr.p->m_request;
+
+  ndbrequire(impl_req->senderRef == numberToRef(DBDICT, c_masterNodeId));
+  ndbrequire(impl_req->senderData == op_ptr.p->op_key);
+
+  // save name
+  {
+    SegmentedSectionPtr ss_ptr;
+    signal->getSection(ss_ptr, CreateTrigReq::TRIGGER_NAME_SECTION);
+    SimplePropertiesSectionReader r(ss_ptr, getSectionSegmentPool());
+    DictTabInfo::Table tableDesc;
+    tableDesc.init();
+    SimpleProperties::UnpackStatus status =
+      SimpleProperties::unpack(
+          r, &tableDesc,
+          DictTabInfo::TableMapping, DictTabInfo::TableMappingSize,
+          true, true);
+
+    if (status != SimpleProperties::Eof ||
+        tableDesc.TableName[0] == 0) {
+      jam();
+      setError(error, CreateTrigRef::InvalidName, __LINE__);
+      return;
+    }
+    const Uint32 bytesize = sizeof(createTriggerPtr.p->m_triggerName);
+    memcpy(createTriggerPtr.p->m_triggerName, tableDesc.TableName, bytesize);
+  }
+
+  // check name is unique
+  if (get_object(createTriggerPtr.p->m_triggerName) != 0) {
+    jam();
+    setError(error, CreateTrigRef::TriggerExists, __LINE__);
+    return;
+  }
+
+  // check the table
+  {
+    const Uint32 tableId = impl_req->tableId;
+    if (! (tableId < c_tableRecordPool.getSize())) {
+      jam();
+      setError(error, CreateTrigRef::InvalidTable, __LINE__);
+      return;
+    }
+    TableRecordPtr tablePtr;
+    c_tableRecordPool.getPtr(tablePtr, tableId);
+#if wl3600_todo // no PARSE state
+    if (tablePtr.p->tabState != TableRecord::PARSE &&
+        tablePtr.p->tabState != TableRecord::DEFINED &&
+        tablePtr.p->tabState != TableRecord::BACKUP_ONGOING) {
+      jam();
+      setError(error, CreateTrigRef::InvalidTable, __LINE__);
+      return;
+    }
+#endif
+  }
+
+  const bool fromMaster = (reference() == impl_req->senderRef);
+
+  TriggerRecordPtr triggerPtr;
+  if (fromMaster) {
+    jam();
+    // master allocates trigger id (array index)
+    triggerPtr.i = getFreeTriggerRecord();
+    if (triggerPtr.i == RNIL) {
+      jam();
+      setError(error, CreateTrigRef::TooManyTriggers, __LINE__);
+      return;
+    }
+    impl_req->triggerId = triggerPtr.i;
+    c_triggerRecordPool.getPtr(triggerPtr, impl_req->triggerId);
+    D("master allocated triggerId " << hex << impl_req->triggerId);
+  } else {
+    jam();
+    // slave receives trigger id (array index) from master
+    // wl3600_todo array index bad idea
+    if (! (impl_req->triggerId < c_triggerRecordPool.getSize())) {
+      jam();
+      setError(error, CreateTrigRef::TooManyTriggers, __LINE__);
+      return;
+    }
+    c_triggerRecordPool.getPtr(triggerPtr, impl_req->triggerId);
+    if (triggerPtr.p->triggerState != TriggerRecord::TS_NOT_DEFINED) {
+      jam();
+      // wl3600_todo inconsistency, need new error code
+      setError(error, CreateTrigRef::TriggerExists, __LINE__);
+      return;
+    }
+    initialiseTriggerRecord(triggerPtr);
+    D("slave allocated triggerId " << hex << impl_req->triggerId);
+  }
+
+  // fill in trigger data
+  triggerPtr.p->triggerId = impl_req->triggerId;
+  triggerPtr.p->tableId = impl_req->tableId;
+  triggerPtr.p->indexId = ~(Uint32)0; // caller connects to index
+  triggerPtr.p->triggerInfo = impl_req->triggerInfo;
+  triggerPtr.p->attributeMask = impl_req->attributeMask;
+  triggerPtr.p->triggerState = TriggerRecord::TS_OFFLINE;
+
+#ifdef wl3600_todo // do object stuff later
+  {
+    Ptr<DictObject> obj_ptr;
+    ndbrequire(c_obj_hash.seize(obj_ptr));
+    obj_ptr.p->m_name = triggerPtr.p->triggerName;
+    obj_ptr.p->m_id = impl_req->triggerId; // XXX non-unique
+    obj_ptr.p->m_type = triggerPtr.p->triggerType;
+    obj_ptr.p->m_ref_count = 0;
+    c_obj_hash.add(obj_ptr);
+    triggerPtr.p->m_obj_ptr_i = obj_ptr.i;
+  }
+#endif
+}
+
+bool
+Dbdict::createTrigger_subOps(Signal* signal, SchemaOpPtr op_ptr)
+{
+  D("createTrigger_subOps" << V(op_ptr.i) << *op_ptr.p);
+  return false;
+}
+
+void
+Dbdict::createTrigger_reply(Signal* signal, SchemaOpPtr op_ptr)
+{
+  const OpInfo& info = getOpInfo(op_ptr);
+
+  SchemaTransPtr& trans_ptr = op_ptr.p->m_trans_ptr;
+  CreateTriggerDataPtr createTriggerPtr;
+  getOpData(op_ptr, createTriggerPtr);
+  const CreateTrigImplReq* impl_req = &createTriggerPtr.p->m_request;
+
+  TableRecordPtr triggerPtr;
+  c_tableRecordPool.getPtr(triggerPtr, createTriggerPtr.p->m_request.triggerId);
+
+  CreateTrigConf* conf = (CreateTrigConf*)signal->getDataPtrSend();
+  conf->senderRef = reference();
+  conf->clientData = op_ptr.p->m_clientData;
+  conf->transId = trans_ptr.p->m_transId;
+  conf->requestType = impl_req->requestType;
+  conf->tableId = impl_req->tableId;
+  conf->indexId = impl_req->indexId;
+  conf->triggerId = impl_req->triggerId;
+  conf->triggerInfo = impl_req->triggerInfo;
+
+  D("createTrigger_reply" << V(conf->triggerId));
+
+  Uint32 clientRef = op_ptr.p->m_clientRef;
+  sendSignal(clientRef, GSN_CREATE_TRIG_CONF, signal,
+             CreateTrigConf::SignalLength, JBB);
+}
+
+void
+Dbdict::createTrigger_prepare(Signal* signal, SchemaOpPtr op_ptr,
+                            Uint32 repeat)
+{
+  jam();
+  D("createTrigger_prepare");
+
+  schemaTrans_sendConf(signal, op_ptr.p->m_trans_ptr, 0);
+}
+
+void
+Dbdict::createTrigger_commit(Signal* signal, SchemaOpPtr op_ptr,
+                           Uint32 repeat)
+{
+  jam();
+  D("createTrigger_commit");
+
+  schemaTrans_sendConf(signal, op_ptr.p->m_trans_ptr, 0);
 }
 
 void
@@ -14549,16 +15126,34 @@
 {
   jamEntry();
   ndbrequire(signal->getNoOfSections() == 0);
-  CreateTrigConf* conf = (CreateTrigConf*)signal->getDataPtrSend();
-  createTrigger_recvReply(signal, conf, 0);
+
+  const CreateTrigConf* conf =
+    (const CreateTrigConf*)signal->getDataPtr();
+
+  D("execCREATE_TRIG_CONF" << hex << V(conf->clientData));
+
+  // the main operation e.g. alter index
+  SchemaOpPtr op_ptr;
+  findSchemaOp(op_ptr, conf->clientData);
+  execute(signal, op_ptr.p->m_callback, 0);
 }
 
 void
 Dbdict::execCREATE_TRIG_REF(Signal* signal) 
 {
   jamEntry();
-  CreateTrigRef* ref = (CreateTrigRef*)signal->getDataPtrSend();
-  createTrigger_recvReply(signal, ref->getConf(), ref);
+  ndbrequire(signal->getNoOfSections() == 0);
+
+  const CreateTrigRef* ref =
+    (const CreateTrigRef*)signal->getDataPtr();
+
+  D("execCREATE_TRIG_REF" << hex << V(ref->clientData)
+                          << dec << V(ref->errorCode));
+
+  SchemaOpPtr op_ptr;
+  findSchemaOp(op_ptr, ref->clientData);
+  ndbrequire(ref->errorCode != 0);
+  execute(signal, op_ptr.p->m_callback, ref->errorCode);
 }
 
 void
@@ -14604,7 +15199,7 @@
     alterTrigger_fromCreateLocal(signal, opPtr);
     return;
   }
-  OpCreateTriggerPtr opPtr;
+  CreateTriggerDataPtr opPtr;
   c_opCreateTrigger.find(opPtr, key);
   ndbrequire(! opPtr.isNull());
   ndbrequire(opPtr.p->m_isMaster);
@@ -14660,8 +15255,10 @@
 }
 
 void
-Dbdict::createTrigger_slavePrepare(Signal* signal, OpCreateTriggerPtr opPtr)
+Dbdict::createTrigger_slavePrepare(Signal* signal, CreateTriggerDataPtr opPtr)
 {
+  ndbrequire(false);
+#if wl3600_todo
   jam();
   const CreateTrigReq* const req = &opPtr.p->m_request;
   // check trigger type
@@ -14697,11 +15294,14 @@
     opPtr.p->m_errorLine = __LINE__;
     return;
   }
+#endif
 }
 
 void
-Dbdict::createTrigger_masterSeize(Signal* signal, OpCreateTriggerPtr opPtr)
+Dbdict::createTrigger_masterSeize(Signal* signal, CreateTriggerDataPtr opPtr)
 {
+  ndbrequire(false);
+#if wl3600_todo
   TriggerRecordPtr triggerPtr;
   if (opPtr.p->m_requestFlag & RequestFlag::RF_LOCAL) {
     triggerPtr.i = opPtr.p->m_request.getTriggerId();
@@ -14718,11 +15318,14 @@
   initialiseTriggerRecord(triggerPtr);
   triggerPtr.p->triggerState = TriggerRecord::TS_DEFINING;
   opPtr.p->m_request.setTriggerId(triggerPtr.i);
+#endif
 }
 
 void
-Dbdict::createTrigger_slaveCreate(Signal* signal, OpCreateTriggerPtr opPtr)
+Dbdict::createTrigger_slaveCreate(Signal* signal, CreateTriggerDataPtr opPtr)
 {
+  ndbrequire(false);
+#if wl3600_todo
   jam();
   const CreateTrigReq* const req = &opPtr.p->m_request;
   // get the trigger record
@@ -14795,11 +15398,14 @@
     c_tableRecordPool.getPtr(indexPtr, triggerPtr.p->indexId);
     indexPtr.p->buildTriggerId = triggerPtr.p->triggerId;
   }
+#endif
 }
 
 void
-Dbdict::createTrigger_toAlterTrigger(Signal* signal, OpCreateTriggerPtr opPtr)
+Dbdict::createTrigger_toAlterTrigger(Signal* signal, CreateTriggerDataPtr opPtr)
 {
+  ndbrequire(false);
+#if wl3600_todo
   jam();
   AlterTrigReq* req = (AlterTrigReq*)signal->getDataPtrSend();
   req->setUserRef(reference());
@@ -14813,11 +15419,14 @@
   req->setReceiverRef(opPtr.p->m_request.getReceiverRef());
   sendSignal(reference(), GSN_ALTER_TRIG_REQ,
       signal, AlterTrigReq::SignalLength, JBB);
+#endif
 }
 
 void
-Dbdict::createTrigger_fromAlterTrigger(Signal* signal, OpCreateTriggerPtr opPtr)
+Dbdict::createTrigger_fromAlterTrigger(Signal* signal, CreateTriggerDataPtr opPtr)
 {
+  ndbrequire(false);
+#if wl3600_todo
   jam();
   if (opPtr.p->hasError()) {
     jam();
@@ -14827,11 +15436,14 @@
   }
   opPtr.p->m_requestType = CreateTrigReq::RT_DICT_COMMIT;
   createTrigger_sendSlaveReq(signal, opPtr);
+#endif
 }
 
 void
-Dbdict::createTrigger_slaveCommit(Signal* signal, OpCreateTriggerPtr opPtr)
+Dbdict::createTrigger_slaveCommit(Signal* signal, CreateTriggerDataPtr opPtr)
 {
+  ndbrequire(false);
+#if wl3600_todo
   jam();
   const CreateTrigReq* const req = &opPtr.p->m_request;
   // get the trigger record
@@ -14843,17 +15455,23 @@
   } else {
     ndbrequire(triggerPtr.p->triggerState == TriggerRecord::TS_ONLINE);
   }
+#endif
 }
 
 void
-Dbdict::createTrigger_slaveAbort(Signal* signal, OpCreateTriggerPtr opPtr)
+Dbdict::createTrigger_slaveAbort(Signal* signal, CreateTriggerDataPtr opPtr)
 {
+  ndbrequire(false);
+#if wl3600_todo
   jam();
+#endif
 }
 
 void
-Dbdict::createTrigger_sendSlaveReq(Signal* signal, OpCreateTriggerPtr opPtr)
+Dbdict::createTrigger_sendSlaveReq(Signal* signal, CreateTriggerDataPtr opPtr)
 {
+  ndbrequire(false);
+#if wl3600_todo
   CreateTrigReq* const req = (CreateTrigReq*)signal->getDataPtrSend();
   *req = opPtr.p->m_request;
   req->setUserRef(opPtr.p->m_coordinatorRef);
@@ -14869,12 +15487,15 @@
   NodeReceiverGroup rg(DBDICT, receiverNodes);
   sendSignal(rg, GSN_CREATE_TRIG_REQ,
       signal, CreateTrigReq::SignalLength, JBB);
+#endif
 }
 
 void
-Dbdict::createTrigger_sendReply(Signal* signal, OpCreateTriggerPtr opPtr,
+Dbdict::createTrigger_sendReply(Signal* signal, CreateTriggerDataPtr opPtr,
     bool toUser)
 {
+  ndbrequire(false);
+#if wl3600_todo
   CreateTrigRef* rep = (CreateTrigRef*)signal->getDataPtrSend();
   Uint32 gsn = GSN_CREATE_TRIG_CONF;
   Uint32 length = CreateTrigConf::InternalLength;
@@ -14907,6 +15528,7 @@
     length = CreateTrigRef::SignalLength;
   }
   sendSignal(rep->getUserRef(), gsn, signal, length, JBB);
+#endif
 }
 
 /**
@@ -15185,6 +15807,8 @@
 void
 Dbdict::dropTrigger_slaveCommit(Signal* signal, OpDropTriggerPtr opPtr)
 {
+  ndbrequire(false);
+#if wl3600_todo
   jam();
   const DropTrigReq* const req = &opPtr.p->m_request;
   // get trigger record
@@ -15229,6 +15853,7 @@
   //ndbout_c("++++++++++++ Removing trigger id %u, %s", triggerPtr.p->triggerId, triggerPtr.p->triggerName);
   release_object(triggerPtr.p->m_obj_ptr_i);
   triggerPtr.p->triggerState = TriggerRecord::TS_NOT_DEFINED;
+#endif
 }
 
 void
@@ -15393,23 +16018,31 @@
 void
 Dbdict::execALTER_TRIG_CONF(Signal* signal) 
 {
+  ndbrequire(false);
+#if wl3600_todo
   jamEntry();
   AlterTrigConf* conf = (AlterTrigConf*)signal->getDataPtrSend();
   alterTrigger_recvReply(signal, conf, 0);
+#endif
 }
 
 void
 Dbdict::execALTER_TRIG_REF(Signal* signal) 
 {
+  ndbrequire(false);
+#if wl3600_todo
   jamEntry();
   AlterTrigRef* ref = (AlterTrigRef*)signal->getDataPtrSend();
   alterTrigger_recvReply(signal, ref->getConf(), ref);
+#endif
 }
 
 void
 Dbdict::alterTrigger_recvReply(Signal* signal, const AlterTrigConf* conf,
     const AlterTrigRef* ref)
 {
+  ndbrequire(false);
+#if wl3600_todo
   jam();
   const Uint32 senderRef = signal->senderBlockRef();
   const AlterTrigReq::RequestType requestType = conf->getRequestType();
@@ -15417,7 +16050,7 @@
   if (requestType == AlterTrigReq::RT_CREATE_TRIGGER) {
     jam();
     // part of create trigger operation
-    OpCreateTriggerPtr opPtr;
+    CreateTriggerDataPtr opPtr;
     c_opCreateTrigger.find(opPtr, key);
     ndbrequire(! opPtr.isNull());
     opPtr.p->setError(ref);
@@ -15526,11 +16159,14 @@
     }
   }
   ndbrequire(false);
+#endif
 }
 
 void
 Dbdict::alterTrigger_slavePrepare(Signal* signal, OpAlterTriggerPtr opPtr)
 {
+  ndbrequire(false);
+#if wl3600_todo
   jam();
   const AlterTrigReq* const req = &opPtr.p->m_request;
   const Uint32 triggerId = req->getTriggerId();
@@ -15553,11 +16189,14 @@
   {
     opPtr.p->m_request.addRequestFlag(RequestFlag::RF_NOTCTRIGGER);
   }
+#endif
 }
 
 void
 Dbdict::alterTrigger_toCreateLocal(Signal* signal, OpAlterTriggerPtr opPtr)
 {
+  ndbrequire(false);
+#if wl3600_todo
   jam();
   // find trigger record
   const Uint32 triggerId = opPtr.p->m_request.getTriggerId();
@@ -15599,6 +16238,7 @@
   req->setAttributeMask(triggerPtr.p->attributeMask);
   sendSignal(blockRef, GSN_CREATE_TRIG_REQ,
       signal, CreateTrigReq::SignalLength, JBB);
+#endif
 }
 
 void
@@ -15626,6 +16266,8 @@
 void
 Dbdict::alterTrigger_toDropLocal(Signal* signal, OpAlterTriggerPtr opPtr)
 {
+  ndbrequire(false);
+#if wl3600_todo
   jam();
   TriggerRecordPtr triggerPtr;
   c_triggerRecordPool.getPtr(triggerPtr, opPtr.p->m_request.getTriggerId());
@@ -15675,6 +16317,7 @@
   }
   sendSignal(blockRef, GSN_DROP_TRIG_REQ,
       signal, DropTrigReq::SignalLength, JBB);
+#endif
 }
 
 void
@@ -18625,6 +19268,7 @@
   &Dbdict::CreateIndexData::g_opInfo,
   &Dbdict::DropIndexData::g_opInfo,
   &Dbdict::AlterIndexData::g_opInfo,
+  &Dbdict::CreateTriggerData::g_opInfo,
   0
 };
 
@@ -19078,6 +19722,7 @@
   SchemaTransPtr trans_ptr = op_ptr.p->m_trans_ptr;
   trans_ptr.p->m_requestType = SchemaTransImplReq::RT_PARSE;
   schemaTrans_sendReq(signal, trans_ptr, 0);
+  releaseSections(signal);
 }
 
 void

--- 1.60/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2007-01-14 12:39:54 +01:00
+++ 1.61/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2007-01-16 12:39:54 +01:00
@@ -52,7 +52,8 @@
 #include <signaldata/BuildIndx.hpp>
 #include <signaldata/UtilPrepare.hpp>
 #include <signaldata/CreateEvnt.hpp>
-#include <signaldata/CreateTrig.hpp>
+#include <signaldata/CreateTrig.hpp>//wl3600_todo client sigs not used in .hpp
+#include <signaldata/CreateTrigImpl.hpp>
 #include <signaldata/DropTrig.hpp>
 #include <signaldata/AlterTrig.hpp>
 #include <signaldata/DictLock.hpp>
@@ -366,8 +367,8 @@
 
     /**   Trigger ids of index (volatile data) */
     Uint32 insertTriggerId;
-    Uint32 updateTriggerId;
     Uint32 deleteTriggerId;
+    Uint32 updateTriggerId;
     Uint32 customTriggerId;     // ordered index
     Uint32 buildTriggerId;      // temp during build
 
@@ -439,6 +440,10 @@
     /** Table id, the table the trigger is defined on */
     Uint32 tableId;
 
+    /** TriggerInfo (should not be interpreted by DICT) */
+    Uint32 triggerInfo;
+
+#if wl3600_todo //remove
     /** Trigger type, defines what the trigger is used for */
     TriggerType::Value triggerType;
     
@@ -456,7 +461,8 @@
 
     /** Monitor all, the trigger monitors changes of all attributes in table */
     bool reportAllMonitoredAttributes;
-        
+#endif
+
     /**
      * Attribute mask, defines what attributes are to be monitored.
      * Can be seen as a compact representation of SQL column name list.
@@ -1684,6 +1690,7 @@
 
     ErrorInfo error;
     if (impl_req->senderRef == reference()) {
+      // wl3600_todo this branch is fairly useless
       jam();
       findSchemaOp(op_ptr, t_ptr, impl_req->senderData);
       ndbrequire(!op_ptr.isNull());
@@ -1705,12 +1712,8 @@
       return;
     }
 
-    ndbrequire(op_ptr.p->m_sections == 0);
-    Uint32 ss_no;
-    for (ss_no = 0; ss_no < signal->getNoOfSections(); ss_no++)
-      saveOpSection(op_ptr, signal, ss_no);
+    // parseCommon must consume/save but not release signal sections
     releaseSections(signal);
-
     schemaTrans_sendConf(signal, trans_ptr, 0);
   }
 
@@ -2224,9 +2227,18 @@
   void dropIndex_fromAlterIndex(Signal*, Uint32 op_key, Uint32 ret);
 
   // MODULE: AlterIndex
+  
+  struct TriggerTmpl {
+    const char* nameFormat; // contains one %u
+    const TriggerStruct triggerStruct;
+  };
+
+  static const TriggerTmpl g_hashIndexTriggerTmpl[3];
+  static const TriggerTmpl g_orderedIndexTriggerTmpl[1];
 
   struct AlterIndexData : public OpData {
     AlterIndxImplReq m_request;
+    AttributeMask m_attrMask;
 
     // reflection
     static const OpInfo g_opInfo;
@@ -2236,9 +2248,18 @@
       return dict->c_alterIndexDataPool;
     }
 
+    // sub-operation counters
+    const TriggerTmpl* m_triggerTmpl;
+    Uint32 m_triggerCount;      // 3 or 1
+    Uint32 m_triggerNo;
+
     AlterIndexData() :
       OpData(g_opInfo, (Uint32*)&m_request) {
       memset(&m_request, 0, sizeof(m_request));
+      m_attrMask.clear();
+      m_triggerTmpl = 0;
+      m_triggerCount = 0;
+      m_triggerNo = 0;
     }
 
 #ifdef VM_TRACE
@@ -2389,6 +2410,12 @@
   void alterIndex_prepare(Signal*, SchemaOpPtr, Uint32 repeat);
   void alterIndex_commit(Signal*, SchemaOpPtr, Uint32 repeat);
 
+  // sub-ops
+  void alterIndex_toCreateTrigger(Signal*, SchemaOpPtr);
+  void alterIndex_fromCreateTrigger(Signal*, Uint32 op_key, Uint32 ret);
+  void alterIndex_toDropTrigger(Signal*, SchemaOpPtr);
+  void alterIndex_fromDropTrigger(Signal*, Uint32 op_key, Uint32 ret);
+
   /**
    * Operation record for build index.
    */
@@ -2458,6 +2485,7 @@
 #endif
     }
     void setError(const CreateTrigRef* ref) {
+#if wl3600_todo
       m_lastError = BuildIndxRef::NoError;
       if (ref != 0) {
         m_lastError = (BuildIndxRef::ErrorCode)ref->getErrorCode();
@@ -2467,6 +2495,7 @@
           m_errorNode = ref->getErrorNode();
         }
       }
+#endif
     }
     void setError(const DropTrigRef* ref) {
       m_lastError = BuildIndxRef::NoError;
@@ -2593,13 +2622,32 @@
   };
   typedef Ptr<OpDropEvent> OpDropEventPtr;
 
-  /**
-   * Operation record for create trigger.
-   */
-  struct OpCreateTrigger : OpRecordCommon {
-    // original request (trigger id will be added)
-    CreateTrigReq m_request;
+  // MODULE: CreateTrigger
+
+  struct CreateTriggerData : public OpData {
+    CreateTrigImplReq m_request;
     char m_triggerName[MAX_TAB_NAME_SIZE];
+
+    // reflection
+    static const OpInfo g_opInfo;
+
+    static ArrayPool<Dbdict::CreateTriggerData>&
+    getPool(Dbdict* dict) {
+      return dict->c_createTriggerDataPool;
+    }
+
+    // sub-operation counters
+    bool m_sub_alter_trigger;
+
+    CreateTriggerData() :
+      OpData(g_opInfo, (Uint32*)&m_request) {
+      memset(&m_request, 0, sizeof(m_request));
+      memset(m_triggerName, 0, sizeof(m_triggerName));
+      m_sub_alter_trigger = false;
+    }
+
+    //wl3600_todo rest out
+
     // coordinator DICT
     Uint32 m_coordinatorRef;
     bool m_isMaster;
@@ -2614,6 +2662,7 @@
     // counters
     SignalCounter m_signalCounter;
     // ctor
+#if wl3600_todo
     OpCreateTrigger() {
       memset(&m_request, 0, sizeof(m_request));
       m_coordinatorRef = 0;
@@ -2624,10 +2673,13 @@
       m_errorLine = 0;
       m_errorNode = 0;
     }
+#endif
     void save(const CreateTrigReq* req) {
+#if wl3600_todo
       m_request = *req;
       m_requestType = req->getRequestType();
       m_requestFlag = req->getRequestFlag();
+#endif
     }
     bool hasLastError() {
       return m_lastError != CreateTrigRef::NoError;
@@ -2636,6 +2688,7 @@
       return m_errorCode != CreateTrigRef::NoError;
     }
     void setError(const CreateTrigRef* ref) {
+#if wl3600_todo
       m_lastError = CreateTrigRef::NoError;
       if (ref != 0) {
         m_lastError = ref->getErrorCode();
@@ -2645,6 +2698,7 @@
           m_errorNode = ref->getErrorNode();
         }
       }
+#endif
     }
     void setError(const AlterTrigRef* ref) {
       m_lastError = CreateTrigRef::NoError;
@@ -2658,7 +2712,25 @@
       }
     }
   };
-  typedef Ptr<OpCreateTrigger> OpCreateTriggerPtr;
+
+  typedef Ptr<CreateTriggerData> CreateTriggerDataPtr;
+  ArrayPool<CreateTriggerData> c_createTriggerDataPool;
+
+  // OpInfo
+  bool createTrigger_seize(SchemaOpPtr);
+  void createTrigger_release(SchemaOpPtr);
+  //
+  void createTrigger_parse(Signal*, SchemaTransPtr);
+  void createTrigger_parseCommon(Signal*, SchemaOpPtr, ErrorInfo&);
+  bool createTrigger_subOps(Signal*, SchemaOpPtr);
+  void createTrigger_reply(Signal*, SchemaOpPtr);
+  //
+  void createTrigger_prepare(Signal*, SchemaOpPtr, Uint32 repeat);
+  void createTrigger_commit(Signal*, SchemaOpPtr, Uint32 repeat);
+
+  // sub-ops
+  void createTrigger_toAlterTrigger(Signal*, SchemaOpPtr);
+  void createTrigger_fromAlterTrigger(Signal*, Uint32 op_key, Uint32 ret);
 
   /**
    * Operation record for drop trigger.
@@ -2781,6 +2853,7 @@
       }
     }
     void setError(const CreateTrigRef* ref) {
+#if wl3600_todo
       m_lastError = AlterTrigRef::NoError;
       if (ref != 0) {
         m_lastError = (AlterTrigRef::ErrorCode)ref->getErrorCode();
@@ -2790,6 +2863,7 @@
           m_errorNode = ref->getErrorNode();
         }
       }
+#endif
     }
     void setError(const DropTrigRef* ref) {
       m_lastError = AlterTrigRef::NoError;
@@ -2871,7 +2945,6 @@
   STATIC_CONST( opSubEventSize = sizeof(OpSubEvent) );
   STATIC_CONST( opDropEventSize = sizeof(OpDropEvent) );
   STATIC_CONST( opSignalUtilSize = sizeof(OpSignalUtil) );
-  STATIC_CONST( opCreateTriggerSize = sizeof(OpCreateTrigger) );
   STATIC_CONST( opDropTriggerSize = sizeof(OpDropTrigger) );
   STATIC_CONST( opAlterTriggerSize = sizeof(OpAlterTrigger) );
   STATIC_CONST( opCreateObjSize = sizeof(OpCreateObj) );
@@ -2884,7 +2957,6 @@
     Uint32 u_opDropEvent    [PTR_ALIGN(opDropEventSize)];
     Uint32 u_opSignalUtil   [PTR_ALIGN(opSignalUtilSize)];
     Uint32 u_opBuildIndex   [PTR_ALIGN(opBuildIndexSize)];
-    Uint32 u_opCreateTrigger[PTR_ALIGN(opCreateTriggerSize)];
     Uint32 u_opDropTrigger  [PTR_ALIGN(opDropTriggerSize)];
     Uint32 u_opAlterTrigger [PTR_ALIGN(opAlterTriggerSize)];
     Uint32 u_opCreateObj    [PTR_ALIGN(opCreateObjSize)];
@@ -2899,7 +2971,6 @@
   KeyTable2C<OpSubEvent, OpRecordUnion> c_opSubEvent;
   KeyTable2C<OpDropEvent, OpRecordUnion> c_opDropEvent;
   KeyTable2C<OpSignalUtil, OpRecordUnion> c_opSignalUtil;
-  KeyTable2<OpCreateTrigger, OpRecordUnion> c_opCreateTrigger;
   KeyTable2<OpDropTrigger, OpRecordUnion> c_opDropTrigger;
   KeyTable2<OpAlterTrigger, OpRecordUnion> c_opAlterTrigger;
   KeyTable2<SchemaOperation, OpRecordUnion> c_schemaOperation; 
@@ -3149,10 +3220,6 @@
   void alterIndex_fromCreateTc(Signal* signal, AlterIndexDataPtr opPtr);
   void alterIndex_toDropTc(Signal* signal, AlterIndexDataPtr opPtr);
   void alterIndex_fromDropTc(Signal* signal, AlterIndexDataPtr opPtr);
-  void alterIndex_toCreateTrigger(Signal* signal, AlterIndexDataPtr opPtr);
-  void alterIndex_fromCreateTrigger(Signal* signal, AlterIndexDataPtr opPtr);
-  void alterIndex_toDropTrigger(Signal* signal, AlterIndexDataPtr opPtr);
-  void alterIndex_fromDropTrigger(Signal* signal, AlterIndexDataPtr opPtr);
   void alterIndex_toBuildIndex(Signal* signal, AlterIndexDataPtr opPtr);
   void alterIndex_fromBuildIndex(Signal* signal, AlterIndexDataPtr opPtr);
   void alterIndex_slaveCommit(Signal* signal, AlterIndexDataPtr opPtr);
@@ -3270,15 +3337,15 @@
   // create trigger
   void createTrigger_recvReply(Signal* signal, const CreateTrigConf* conf,
       const CreateTrigRef* ref);
-  void createTrigger_slavePrepare(Signal* signal, OpCreateTriggerPtr opPtr);
-  void createTrigger_masterSeize(Signal* signal, OpCreateTriggerPtr opPtr);
-  void createTrigger_slaveCreate(Signal* signal, OpCreateTriggerPtr opPtr);
-  void createTrigger_toAlterTrigger(Signal* signal, OpCreateTriggerPtr opPtr);
-  void createTrigger_fromAlterTrigger(Signal* signal, OpCreateTriggerPtr opPtr);
-  void createTrigger_slaveCommit(Signal* signal, OpCreateTriggerPtr opPtr);
-  void createTrigger_slaveAbort(Signal* signal, OpCreateTriggerPtr opPtr);
-  void createTrigger_sendSlaveReq(Signal* signal, OpCreateTriggerPtr opPtr);
-  void createTrigger_sendReply(Signal* signal, OpCreateTriggerPtr opPtr, bool);
+  void createTrigger_slavePrepare(Signal* signal, CreateTriggerDataPtr opPtr);
+  void createTrigger_masterSeize(Signal* signal, CreateTriggerDataPtr opPtr);
+  void createTrigger_slaveCreate(Signal* signal, CreateTriggerDataPtr opPtr);
+  void createTrigger_toAlterTrigger(Signal* signal, CreateTriggerDataPtr opPtr);
+  void createTrigger_fromAlterTrigger(Signal* signal, CreateTriggerDataPtr opPtr);
+  void createTrigger_slaveCommit(Signal* signal, CreateTriggerDataPtr opPtr);
+  void createTrigger_slaveAbort(Signal* signal, CreateTriggerDataPtr opPtr);
+  void createTrigger_sendSlaveReq(Signal* signal, CreateTriggerDataPtr opPtr);
+  void createTrigger_sendReply(Signal* signal, CreateTriggerDataPtr opPtr, bool);
   // drop trigger
   void dropTrigger_recvReply(Signal* signal, const DropTrigConf* conf,
       const DropTrigRef* ref);

--- 1.56/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2006-12-01 09:10:23 +01:00
+++ 1.57/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2007-01-16 12:39:54 +01:00
@@ -2176,9 +2176,9 @@
   void execALTER_TAB_REQ(Signal* signal);
   void execALTER_TAB_CONF(Signal* signal);
 
-  void execCREATE_TRIG_CONF(Signal* signal);
-  void execCREATE_TRIG_REF(Signal* signal);
-  void execCREATE_TRIG_REQ(Signal* signal);
+  void execCREATE_TRIG_IMPL_CONF(Signal* signal);
+  void execCREATE_TRIG_IMPL_REF(Signal* signal);
+  void execCREATE_TRIG_IMPL_REQ(Signal* signal);
 
   void execDROP_TRIG_CONF(Signal* signal);
   void execDROP_TRIG_REF(Signal* signal);

--- 1.21/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp	2006-09-15 11:43:47 +02:00
+++ 1.22/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp	2007-01-16 12:39:54 +01:00
@@ -195,9 +195,9 @@
   addRecSignal(GSN_ALTER_TAB_REQ, &Dblqh::execALTER_TAB_REQ);
 
   // Trigger signals, transit to from TUP
-  addRecSignal(GSN_CREATE_TRIG_REQ, &Dblqh::execCREATE_TRIG_REQ);
-  addRecSignal(GSN_CREATE_TRIG_CONF, &Dblqh::execCREATE_TRIG_CONF);
-  addRecSignal(GSN_CREATE_TRIG_REF, &Dblqh::execCREATE_TRIG_REF);
+  addRecSignal(GSN_CREATE_TRIG_IMPL_REQ, &Dblqh::execCREATE_TRIG_IMPL_REQ);
+  addRecSignal(GSN_CREATE_TRIG_IMPL_CONF, &Dblqh::execCREATE_TRIG_IMPL_CONF);
+  addRecSignal(GSN_CREATE_TRIG_IMPL_REF, &Dblqh::execCREATE_TRIG_IMPL_REF);
 
   addRecSignal(GSN_DROP_TRIG_REQ, &Dblqh::execDROP_TRIG_REQ);
   addRecSignal(GSN_DROP_TRIG_CONF, &Dblqh::execDROP_TRIG_CONF);

--- 1.128/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2006-12-07 15:25:37 +01:00
+++ 1.129/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2007-01-16 12:39:54 +01:00
@@ -24,7 +24,7 @@
 #include <signaldata/AccScan.hpp>
 #include <signaldata/CopyActive.hpp>
 #include <signaldata/CopyFrag.hpp>
-#include <signaldata/CreateTrig.hpp>
+#include <signaldata/CreateTrigImpl.hpp>
 #include <signaldata/DropTrig.hpp>
 #include <signaldata/EmptyLcp.hpp>
 #include <signaldata/EventReport.hpp>
@@ -18848,30 +18848,30 @@
 
 // Trigger signals
 void
-Dblqh::execCREATE_TRIG_REQ(Signal* signal)
+Dblqh::execCREATE_TRIG_IMPL_REQ(Signal* signal)
 {
   jamEntry();
 
-  sendSignal(DBTUP_REF, GSN_CREATE_TRIG_REQ, signal,
-             CreateTrigReq::SignalLength, JBB);
+  sendSignal(DBTUP_REF, GSN_CREATE_TRIG_IMPL_REQ, signal,
+             CreateTrigImplReq::SignalLength, JBB);
 }
 
 void
-Dblqh::execCREATE_TRIG_CONF(Signal* signal)
+Dblqh::execCREATE_TRIG_IMPL_CONF(Signal* signal)
 {
   jamEntry();
 
-  sendSignal(DBDICT_REF, GSN_CREATE_TRIG_CONF, signal,
-             CreateTrigConf::SignalLength, JBB);
+  sendSignal(DBDICT_REF, GSN_CREATE_TRIG_IMPL_CONF, signal,
+             CreateTrigImplConf::SignalLength, JBB);
 }
 
 void
-Dblqh::execCREATE_TRIG_REF(Signal* signal)
+Dblqh::execCREATE_TRIG_IMPL_REF(Signal* signal)
 {
   jamEntry();
 
-  sendSignal(DBDICT_REF, GSN_CREATE_TRIG_REF, signal,
-             CreateTrigRef::SignalLength, JBB);
+  sendSignal(DBDICT_REF, GSN_CREATE_TRIG_IMPL_REF, signal,
+             CreateTrigImplRef::SignalLength, JBB);
 }
 
 void

--- 1.47/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp	2007-01-14 12:39:54 +01:00
+++ 1.48/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp	2007-01-16 12:39:54 +01:00
@@ -1331,7 +1331,7 @@
 
   void execABORT_ALL_REQ(Signal* signal);
 
-  void execCREATE_TRIG_REQ(Signal* signal);
+  void execCREATE_TRIG_IMPL_REQ(Signal* signal);
   void execDROP_TRIG_REQ(Signal* signal);
   void execFIRE_TRIG_ORD(Signal* signal);
   void execTRIG_ATTRINFO(Signal* signal);

--- 1.21/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp	2007-01-14 12:39:54 +01:00
+++ 1.22/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp	2007-01-16 12:39:54 +01:00
@@ -251,7 +251,7 @@
   addRecSignal(GSN_TC_COMMIT_ACK, &Dbtc::execTC_COMMIT_ACK);
   addRecSignal(GSN_ABORT_ALL_REQ, &Dbtc::execABORT_ALL_REQ);
 
-  addRecSignal(GSN_CREATE_TRIG_REQ, &Dbtc::execCREATE_TRIG_REQ);
+  addRecSignal(GSN_CREATE_TRIG_IMPL_REQ, &Dbtc::execCREATE_TRIG_IMPL_REQ);
   addRecSignal(GSN_DROP_TRIG_REQ, &Dbtc::execDROP_TRIG_REQ);
   addRecSignal(GSN_FIRE_TRIG_ORD, &Dbtc::execFIRE_TRIG_ORD);
   addRecSignal(GSN_TRIG_ATTRINFO, &Dbtc::execTRIG_ATTRINFO);

--- 1.132/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2007-01-14 12:39:54 +01:00
+++ 1.133/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp	2007-01-16 12:39:54 +01:00
@@ -44,7 +44,7 @@
 #include <signaldata/PrepDropTab.hpp>
 #include <signaldata/DropTab.hpp>
 #include <signaldata/AlterTab.hpp>
-#include <signaldata/CreateTrig.hpp>
+#include <signaldata/CreateTrigImpl.hpp>
 #include <signaldata/DropTrig.hpp>
 #include <signaldata/FireTrigOrd.hpp>
 #include <signaldata/TrigAttrInfo.hpp>
@@ -11095,47 +11095,59 @@
 /* ---------------------------------------------------------------- */
 /* **************************************************************** */
 
-void Dbtc::execCREATE_TRIG_REQ(Signal* signal)
+void Dbtc::execCREATE_TRIG_IMPL_REQ(Signal* signal)
 {
   jamEntry();
-  CreateTrigReq * const createTrigReq = 
-    (CreateTrigReq *)&signal->theData[0];
+  const CreateTrigImplReq
+    reqData = *(const CreateTrigImplReq*)signal->getDataPtr(),
+    *req = &reqData;
+
+  ndbrequire(signal->getNoOfSections() == 0);
+
   TcDefinedTriggerData* triggerData;
   DefinedTriggerPtr triggerPtr;
-  BlockReference sender = signal->senderBlockRef();
-
-  releaseSections(signal);
   
-  triggerPtr.i = createTrigReq->getTriggerId();
+  triggerPtr.i = req->triggerId;
   if (ERROR_INSERTED(8033) ||
-      !c_theDefinedTriggers.seizeId(triggerPtr, 
-				    createTrigReq->getTriggerId())) {
+      !c_theDefinedTriggers.seizeId(triggerPtr, req->triggerId)) {
+      // wl3600_todo "seizeId" should not exist
     jam();
     CLEAR_ERROR_INSERT_VALUE;
     // Failed to allocate trigger record
-    CreateTrigRef * const createTrigRef =  
-      (CreateTrigRef *)&signal->theData[0];
+    CreateTrigImplRef* ref =
+      (CreateTrigImplRef*)signal->getDataPtrSend();
     
-    createTrigRef->setConnectionPtr(createTrigReq->getConnectionPtr());
-    createTrigRef->setErrorCode(CreateTrigRef::TooManyTriggers);
-    sendSignal(sender, GSN_CREATE_TRIG_REF, 
-               signal, CreateTrigRef::SignalLength, JBB);
+    ref->senderRef = reference();
+    ref->senderData = req->senderData;
+    ref->tableId = req->tableId;
+    ref->triggerId = req->triggerId;
+    ref->triggerInfo = req->triggerInfo;
+    ref->errorCode = CreateTrigImplRef::TooManyTriggers; //wl3600_todo WRONG
+
+    sendSignal(req->senderRef, GSN_CREATE_TRIG_IMPL_REF, signal,
+               CreateTrigImplRef::SignalLength, JBB);
     return;
   }
 
   triggerData = triggerPtr.p;
-  triggerData->triggerId = createTrigReq->getTriggerId();
-  triggerData->triggerType = createTrigReq->getTriggerType();
-  triggerData->triggerEvent = createTrigReq->getTriggerEvent();
-  triggerData->attributeMask = createTrigReq->getAttributeMask();
+  triggerData->triggerId = req->triggerId;
+  triggerData->triggerType = TriggerInfo::getTriggerType(req->triggerInfo);
+  triggerData->triggerEvent = TriggerInfo::getTriggerEvent(req->triggerInfo);
+  triggerData->attributeMask = req->attributeMask;
   if (triggerData->triggerType == TriggerType::SECONDARY_INDEX)
-    triggerData->indexId = createTrigReq->getIndexId();
-  CreateTrigConf * const createTrigConf =  
-    (CreateTrigConf *)&signal->theData[0];
-  
-  createTrigConf->setConnectionPtr(createTrigReq->getConnectionPtr());
-  sendSignal(sender, GSN_CREATE_TRIG_CONF, 
-             signal, CreateTrigConf::SignalLength, JBB);
+    triggerData->indexId = req->indexId;
+
+  CreateTrigImplConf* conf =  
+    (CreateTrigImplConf*)signal->getDataPtrSend();
+  
+  conf->senderRef = reference();
+  conf->senderData = req->senderData;
+  conf->tableId = req->tableId;
+  conf->triggerId = req->triggerId;
+  conf->triggerInfo = req->triggerInfo;
+
+  sendSignal(req->senderRef, GSN_CREATE_TRIG_IMPL_CONF, signal,
+             CreateTrigImplConf::SignalLength, JBB);
 }
 
 

--- 1.53/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2006-12-07 15:25:00 +01:00
+++ 1.54/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2007-01-16 12:39:55 +01:00
@@ -24,7 +24,7 @@
 #include <AttributeHeader.hpp>
 #include <Bitmask.hpp>
 #include <signaldata/TupKey.hpp>
-#include <signaldata/CreateTrig.hpp>
+#include <signaldata/CreateTrigImpl.hpp>
 #include <signaldata/DropTrig.hpp>
 #include <signaldata/TrigAttrInfo.hpp>
 #include <signaldata/BuildIndx.hpp>
@@ -1687,7 +1687,7 @@
 // Trigger signals
 //------------------------------------------------------------------
 //------------------------------------------------------------------
-  void execCREATE_TRIG_REQ(Signal* signal);
+  void execCREATE_TRIG_IMPL_REQ(Signal* signal);
 
 //------------------------------------------------------------------
 //------------------------------------------------------------------
@@ -2058,7 +2058,7 @@
                   TriggerActionTime::Value ttime,
                   TriggerEvent::Value tevent);
 
-  bool createTrigger(Tablerec* table, const CreateTrigReq* req);
+  bool createTrigger(Tablerec* table, const CreateTrigImplReq* req);
 
   Uint32 dropTrigger(Tablerec* table,
 		     const DropTrigReq* req,

--- 1.34/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2006-12-07 15:25:37 +01:00
+++ 1.35/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2007-01-16 12:39:55 +01:00
@@ -84,7 +84,7 @@
   addRecSignal(GSN_SET_VAR_REQ,  &Dbtup::execSET_VAR_REQ);
 
   // Trigger Signals
-  addRecSignal(GSN_CREATE_TRIG_REQ, &Dbtup::execCREATE_TRIG_REQ);
+  addRecSignal(GSN_CREATE_TRIG_IMPL_REQ, &Dbtup::execCREATE_TRIG_IMPL_REQ);
   addRecSignal(GSN_DROP_TRIG_REQ,  &Dbtup::execDROP_TRIG_REQ);
 
   addRecSignal(GSN_DROP_TAB_REQ, &Dbtup::execDROP_TAB_REQ);

--- 1.26/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp	2006-11-21 14:23:41 +01:00
+++ 1.27/storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp	2007-01-16 12:39:55 +01:00
@@ -24,7 +24,7 @@
 #include "AttributeOffset.hpp"
 #include <AttributeHeader.hpp>
 #include <signaldata/FireTrigOrd.hpp>
-#include <signaldata/CreateTrig.hpp>
+#include <signaldata/CreateTrigImpl.hpp>
 #include <signaldata/TuxMaint.hpp>
 
 #define ljam() { jamLine(7000 + __LINE__); }
@@ -117,60 +117,61 @@
 
 // Trigger signals
 void
-Dbtup::execCREATE_TRIG_REQ(Signal* signal)
+Dbtup::execCREATE_TRIG_IMPL_REQ(Signal* signal)
 {
   ljamEntry();
-  BlockReference senderRef = signal->getSendersBlockRef();
-  const CreateTrigReq reqCopy = *(const CreateTrigReq*)signal->getDataPtr();
-  const CreateTrigReq* const req = &reqCopy;
-  CreateTrigRef::ErrorCode error= CreateTrigRef::NoError;
+  const CreateTrigImplReq
+    reqData = *(const CreateTrigImplReq*)signal->getDataPtr(),
+    *req = &reqData;
+
+  CreateTrigImplRef::ErrorCode error = CreateTrigImplRef::NoError;
 
   // Find table
   TablerecPtr tabPtr;
-  tabPtr.i = req->getTableId();
+  tabPtr.i = req->tableId;
   ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
 
   if (tabPtr.p->tableStatus != DEFINED )
   {
     ljam();
-    error= CreateTrigRef::InvalidTable;
+    error = CreateTrigImplRef::InvalidTable;
   }
   // Create trigger and associate it with the table
   else if (createTrigger(tabPtr.p, req))
   {
     ljam();
     // Send conf
-    CreateTrigConf* const conf = (CreateTrigConf*)signal->getDataPtrSend();
-    conf->setUserRef(reference());
-    conf->setConnectionPtr(req->getConnectionPtr());
-    conf->setRequestType(req->getRequestType());
-    conf->setTableId(req->getTableId());
-    conf->setIndexId(req->getIndexId());
-    conf->setTriggerId(req->getTriggerId());
-    conf->setTriggerInfo(req->getTriggerInfo());
-    sendSignal(senderRef, GSN_CREATE_TRIG_CONF, 
-               signal, CreateTrigConf::SignalLength, JBB);
+    CreateTrigImplConf* conf =
+      (CreateTrigImplConf*)signal->getDataPtrSend();
+    conf->senderRef = reference();
+    conf->senderData = req->senderData;
+    conf->tableId = req->tableId;
+    conf->triggerId = req->triggerId;
+    conf->triggerInfo = req->triggerInfo;
+
+    sendSignal(req->senderRef, GSN_CREATE_TRIG_IMPL_CONF, 
+               signal, CreateTrigImplConf::SignalLength, JBB);
     return;
   }
   else
   {
     ljam();
-    error= CreateTrigRef::TooManyTriggers;
+    error = CreateTrigImplRef::TooManyTriggers;
   }
-  ndbassert(error != CreateTrigRef::NoError);
+  ndbassert(error != CreateTrigImplRef::NoError);
   // Send ref
-  CreateTrigRef* const ref = (CreateTrigRef*)signal->getDataPtrSend();
-  ref->setUserRef(reference());
-  ref->setConnectionPtr(req->getConnectionPtr());
-  ref->setRequestType(req->getRequestType());
-  ref->setTableId(req->getTableId());
-  ref->setIndexId(req->getIndexId());
-  ref->setTriggerId(req->getTriggerId());
-  ref->setTriggerInfo(req->getTriggerInfo());
-  ref->setErrorCode(error);
-  sendSignal(senderRef, GSN_CREATE_TRIG_REF, 
-	     signal, CreateTrigRef::SignalLength, JBB);
-}//Dbtup::execCREATE_TRIG_REQ()
+  CreateTrigImplRef* ref =
+    (CreateTrigImplRef*)signal->getDataPtrSend();
+  ref->senderRef = reference();
+  ref->senderData = req->senderData;
+  ref->tableId = req->tableId;
+  ref->triggerId = req->triggerId;
+  ref->triggerInfo = req->triggerInfo;
+  ref->errorCode = error;
+
+  sendSignal(req->senderRef, GSN_CREATE_TRIG_IMPL_REF, 
+	     signal, CreateTrigImplRef::SignalLength, JBB);
+}
 
 void
 Dbtup::execDROP_TRIG_REQ(Signal* signal)
@@ -229,15 +230,18 @@
 /*                                                                  */
 /* ---------------------------------------------------------------- */
 bool
-Dbtup::createTrigger(Tablerec* table, const CreateTrigReq* req)
+Dbtup::createTrigger(Tablerec* table, const CreateTrigImplReq* req)
 {
   if (ERROR_INSERTED(4003)) {
     CLEAR_ERROR_INSERT_VALUE;
     return false;
   }
-  TriggerType::Value ttype = req->getTriggerType();
-  TriggerActionTime::Value ttime = req->getTriggerActionTime();
-  TriggerEvent::Value tevent = req->getTriggerEvent();
+  TriggerType::Value ttype =
+    TriggerInfo::getTriggerType(req->triggerInfo);
+  TriggerActionTime::Value ttime =
+    TriggerInfo::getTriggerActionTime(req->triggerInfo);
+  TriggerEvent::Value tevent =
+    TriggerInfo::getTriggerEvent(req->triggerInfo);
 
   DLList<TupTriggerData>* tlist = findTriggerList(table, ttype, ttime, tevent);
   ndbrequire(tlist != NULL);
@@ -247,12 +251,12 @@
     return false;
 
   // Set trigger id
-  tptr.p->triggerId = req->getTriggerId();
+  tptr.p->triggerId = req->triggerId;
 
   //  ndbout_c("Create TupTrigger %u = %u %u %u %u", tptr.p->triggerId, table, ttype, ttime, tevent);
 
   // Set index id
-  tptr.p->indexId = req->getIndexId();
+  tptr.p->indexId = req->indexId;
 
   // Set trigger type etc
   tptr.p->triggerType = ttype;
@@ -275,11 +279,14 @@
     tptr.p->sendOnlyChangedAttributes = true;
   }
   */
-  tptr.p->sendOnlyChangedAttributes = !req->getReportAllMonitoredAttributes();
+  tptr.p->sendOnlyChangedAttributes =
+    !TriggerInfo::getReportAllMonitoredAttributes(req->triggerInfo);
   // Set monitor all
-  tptr.p->monitorAllAttributes = req->getMonitorAllAttributes();
-  tptr.p->monitorReplicas = req->getMonitorReplicas();
-  tptr.p->m_receiverBlock = refToBlock(req->getReceiverRef());
+  tptr.p->monitorAllAttributes =
+    TriggerInfo::getMonitorAllAttributes(req->triggerInfo);
+  tptr.p->monitorReplicas =
+    TriggerInfo::getMonitorReplicas(req->triggerInfo);
+  tptr.p->m_receiverBlock = refToBlock(req->receiverRef);
 
   tptr.p->attributeMask.clear();
   if (tptr.p->monitorAllAttributes) {
@@ -293,7 +300,7 @@
   } else {
     // Set attribute mask
     ljam();
-    tptr.p->attributeMask = req->getAttributeMask();
+    tptr.p->attributeMask = req->attributeMask;
   }
   return true;
 }//Dbtup::createTrigger()

--- 1.49/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2006-11-27 00:47:31 +01:00
+++ 1.50/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2007-01-16 12:39:55 +01:00
@@ -33,7 +33,7 @@
 #include <signaldata/SumaImpl.hpp>
 #include <signaldata/ScanFrag.hpp>
 #include <signaldata/TransIdAI.hpp>
-#include <signaldata/CreateTrig.hpp>
+#include <signaldata/CreateTrigImpl.hpp>
 #include <signaldata/AlterTrig.hpp>
 #include <signaldata/DropTrig.hpp>
 #include <signaldata/FireTrigOrd.hpp>
@@ -2806,21 +2806,30 @@
     {
       suma.suma_ndbrequire(m_triggerIds[j] == ILLEGAL_TRIGGER_ID);
       DBUG_PRINT("info",("DEFINING trigger on table %u[%u]", m_tableId, j));
-      CreateTrigReq * const req = (CreateTrigReq*)signal->getDataPtrSend();
-      req->setUserRef(SUMA_REF);
-      req->setConnectionPtr(m_ptrI);
-      req->setTriggerType(TriggerType::SUBSCRIPTION_BEFORE);
-      req->setTriggerActionTime(TriggerActionTime::TA_DETACHED);
-      req->setMonitorReplicas(true);
-      req->setMonitorAllAttributes(j == TriggerEvent::TE_DELETE);
-      req->setReceiverRef(SUMA_REF);
-      req->setTriggerId(triggerId);
-      req->setTriggerEvent((TriggerEvent::Value)j);
-      req->setTableId(m_tableId);
-      req->setAttributeMask(attrMask);
-      req->setReportAllMonitoredAttributes(m_reportAll);
-      suma.sendSignal(DBTUP_REF, GSN_CREATE_TRIG_REQ, 
-		      signal, CreateTrigReq::SignalLength, JBB);
+      CreateTrigImplReq * const req =
+        (CreateTrigImplReq*)signal->getDataPtrSend();
+      req->senderRef = SUMA_REF;
+      req->senderData = m_ptrI;
+
+      Uint32 ti = 0;
+      TriggerInfo::setTriggerType(ti, TriggerType::SUBSCRIPTION_BEFORE);
+      TriggerInfo::setTriggerActionTime(ti, TriggerActionTime::TA_DETACHED);
+      TriggerInfo::setTriggerEvent(ti, (TriggerEvent::Value)j);
+      TriggerInfo::setMonitorReplicas(ti, true);
+      TriggerInfo::setMonitorAllAttributes(ti, j == TriggerEvent::TE_DELETE);
+      TriggerInfo::setReportAllMonitoredAttributes(ti, m_reportAll);
+      req->triggerInfo = ti;
+
+      req->receiverRef = SUMA_REF;
+      req->triggerId = triggerId;
+      req->tableId = m_tableId;
+      req->tableVersion = 0; // not used
+      req->indexId = ~(Uint32)0;
+      req->indexVersion = 0;
+      req->attributeMask = attrMask;
+
+      suma.sendSignal(DBTUP_REF, GSN_CREATE_TRIG_IMPL_REQ, 
+		      signal, CreateTrigImplReq::SignalLength, JBB);
       ret= 1;
     }
     else
@@ -2847,21 +2856,22 @@
 }
 
 void
-Suma::execCREATE_TRIG_CONF(Signal* signal){
+Suma::execCREATE_TRIG_IMPL_CONF(Signal* signal){
   jamEntry();
-  DBUG_ENTER("Suma::execCREATE_TRIG_CONF");
+  DBUG_ENTER("Suma::execCREATE_TRIG_IMPL_CONF");
   ndbassert(signal->getNoOfSections() == 0);
-  CreateTrigConf * const conf = (CreateTrigConf*)signal->getDataPtr();
-  const Uint32 triggerId = conf->getTriggerId();
+  const CreateTrigImplConf * const conf =
+    (const CreateTrigImplConf*)signal->getDataPtr();
+  const Uint32 triggerId = conf->triggerId;
   Uint32 type = (triggerId >> 16) & 0x3;
-  Uint32 tableId = conf->getTableId();
+  Uint32 tableId = conf->tableId;
 
 
   DBUG_PRINT("enter", ("type: %u tableId: %u[i=%u==%u]",
-		       type, tableId,conf->getConnectionPtr(),triggerId & 0xFFFF));
+		       type, tableId,conf->senderData,triggerId & 0xFFFF));
  
   TablePtr tabPtr;
-  c_tables.getPtr(tabPtr, conf->getConnectionPtr());
+  c_tables.getPtr(tabPtr, conf->senderData);
   ndbrequire(tabPtr.p->m_tableId == tableId);
   ndbrequire(tabPtr.p->m_state == Table::DEFINING);
 
@@ -2880,24 +2890,25 @@
 }
 
 void
-Suma::execCREATE_TRIG_REF(Signal* signal){
+Suma::execCREATE_TRIG_IMPL_REF(Signal* signal){
   jamEntry();
-  DBUG_ENTER("Suma::execCREATE_TRIG_REF");
+  DBUG_ENTER("Suma::execCREATE_TRIG_IMPL_REF");
   ndbassert(signal->getNoOfSections() == 0);  
-  CreateTrigRef * const ref = (CreateTrigRef*)signal->getDataPtr();
-  const Uint32 triggerId = ref->getTriggerId();
+  const CreateTrigImplRef * const ref =
+    (const CreateTrigImplRef*)signal->getDataPtr();
+  const Uint32 triggerId = ref->triggerId;
   Uint32 type = (triggerId >> 16) & 0x3;
-  Uint32 tableId = ref->getTableId();
+  Uint32 tableId = ref->tableId;
   
   DBUG_PRINT("enter", ("type: %u tableId: %u[i=%u==%u]",
-		       type, tableId,ref->getConnectionPtr(),triggerId & 0xFFFF));
+		       type, tableId,ref->senderData,triggerId & 0xFFFF));
  
   TablePtr tabPtr;
-  c_tables.getPtr(tabPtr, ref->getConnectionPtr());
+  c_tables.getPtr(tabPtr, ref->senderData);
   ndbrequire(tabPtr.p->m_tableId == tableId);
   ndbrequire(tabPtr.p->m_state == Table::DEFINING);
 
-  tabPtr.p->m_error= ref->getErrorCode();
+  tabPtr.p->m_error = ref->errorCode;
 
   ndbrequire(type < 3);
 

--- 1.17/storage/ndb/src/kernel/blocks/suma/Suma.hpp	2006-07-07 17:50:25 +02:00
+++ 1.18/storage/ndb/src/kernel/blocks/suma/Suma.hpp	2007-01-16 12:39:55 +01:00
@@ -100,8 +100,8 @@
   /**
    * Trigger administration
    */
-  void execCREATE_TRIG_REF(Signal* signal);
-  void execCREATE_TRIG_CONF(Signal* signal);
+  void execCREATE_TRIG_IMPL_REF(Signal* signal);
+  void execCREATE_TRIG_IMPL_CONF(Signal* signal);
   void execDROP_TRIG_REF(Signal* signal);
   void execDROP_TRIG_CONF(Signal* signal);
   

--- 1.14/storage/ndb/src/kernel/blocks/suma/SumaInit.cpp	2006-07-05 16:30:04 +02:00
+++ 1.15/storage/ndb/src/kernel/blocks/suma/SumaInit.cpp	2007-01-16 12:39:55 +01:00
@@ -115,8 +115,8 @@
   addRecSignal(GSN_TRIG_ATTRINFO, &Suma::execTRIG_ATTRINFO);
   addRecSignal(GSN_FIRE_TRIG_ORD, &Suma::execFIRE_TRIG_ORD);
 
-  addRecSignal(GSN_CREATE_TRIG_REF, &Suma::execCREATE_TRIG_REF);
-  addRecSignal(GSN_CREATE_TRIG_CONF, &Suma::execCREATE_TRIG_CONF);
+  addRecSignal(GSN_CREATE_TRIG_IMPL_REF, &Suma::execCREATE_TRIG_IMPL_REF);
+  addRecSignal(GSN_CREATE_TRIG_IMPL_CONF, &Suma::execCREATE_TRIG_IMPL_CONF);
   addRecSignal(GSN_DROP_TRIG_REF, &Suma::execDROP_TRIG_REF);
   addRecSignal(GSN_DROP_TRIG_CONF, &Suma::execDROP_TRIG_CONF);
   

--- 1.62/storage/ndb/src/kernel/main.cpp	2007-01-04 11:16:37 +01:00
+++ 1.63/storage/ndb/src/kernel/main.cpp	2007-01-16 12:39:54 +01:00
@@ -420,7 +420,7 @@
   FILE * signalLog = fopen(buf, "a");
   globalSignalLoggers.setOwnNodeId(globalData.ownId);
   globalSignalLoggers.setOutputStream(signalLog);
-#if 1 // to log startup
+#if 0 // to log startup
   globalSignalLoggers.log(SignalLoggerManager::LogInOut, "BLOCK=DBDICT,DBLQH");
   globalData.testOn = 1;
 #endif

--- 1.2/storage/ndb/include/kernel/signaldata/AlterIndxImpl.hpp	2007-01-14 12:39:54 +01:00
+++ 1.3/storage/ndb/include/kernel/signaldata/AlterIndxImpl.hpp	2007-01-16 12:39:53 +01:00
@@ -24,8 +24,8 @@
 
   // wl3600_todo maybe include from AlterIndex.hpp
   enum RequestType {
-    AlterIndexOffline = 0,
-    AlterIndexOnline = 1
+    AlterIndexOnline = 1,
+    AlterIndexOffline = 2
   };
 
   STATIC_CONST( SignalLength = 7 );
--- New file ---
+++ storage/ndb/include/kernel/signaldata/CreateTrigImpl.hpp	07/01/14 13:53:13
/* 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 CREATE_TRIG_IMPL_HPP
#define CREATE_TRIG_IMPL_HPP

#include "SignalData.hpp"
#include <Bitmask.hpp>
#include <AttributeList.hpp>

struct CreateTrigImplReq {
  friend bool printCREATE_TRIG_IMPL_REQ(FILE*, const Uint32*, Uint32, Uint16);

  enum RequestType {
    CreateTriggerOnline = 1,
    CreateTriggerOffline = 2
  };

  STATIC_CONST( SignalLength = 10 + MAXNROFATTRIBUTESINWORDS);
  SECTION( TRIGGER_NAME_SECTION = 0 );
  SECTION( ATTRIBUTE_MASK_SECTION = 1 );        // not yet in use
  enum xxxKeyValues {//wl3600_todo use DictTabInfo
    TriggerNameKey = 0xa1
  };

  // tableVersion, indexVersion, name section used only within DICT

  Uint32 senderRef;
  Uint32 senderData;
  Uint32 requestType;
  Uint32 tableId;
  Uint32 tableVersion;
  Uint32 indexId;
  Uint32 indexVersion;
  Uint32 triggerId;
  Uint32 triggerInfo;
  Uint32 receiverRef;
  AttributeMask attributeMask;
};

struct CreateTrigImplConf {
  friend bool printCREATE_TRIG_IMPL_CONF(FILE*, const Uint32*, Uint32, Uint16);

  STATIC_CONST( SignalLength = 5 );

  Uint32 senderRef;
  Uint32 senderData;
  Uint32 tableId;       // BACKUP and SUMA want these back from TUP
  Uint32 triggerId;
  Uint32 triggerInfo;
};

struct CreateTrigImplRef {
  friend bool printCREATE_TRIG_IMPL_REF(FILE*, const Uint32*, Uint32, Uint16);

  enum ErrorCode {
    NoError = 0,
    Busy = 701,
    NotMaster = 702,
    TriggerNameTooLong = 4236,
    TooManyTriggers = 4237,
    TriggerNotFound = 4238,
    TriggerExists = 4239,
    UnsupportedTriggerType = 4240,
    BadRequestType = 4247,
    InvalidName = 4248,
    InvalidTable = 4249
  };
  STATIC_CONST( SignalLength = 9 );

  Uint32 senderRef;
  Uint32 senderData;
  Uint32 tableId;
  Uint32 triggerId;
  Uint32 triggerInfo;
  Uint32 errorCode;
  Uint32 errorLine;
  Uint32 errorNodeId;
  Uint32 masterNodeId;
};

#endif

--- New file ---
+++ storage/ndb/src/common/debugger/signaldata/CreateTrigImpl.cpp	07/01/14 17:32:50
/* 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/CreateTrigImpl.hpp>
#include <trigger_definitions.h>

bool
printCREATE_TRIG_IMPL_REQ(FILE* output, const Uint32* theData, Uint32 len, Uint16)
{
  const CreateTrigImplReq* sig = (const CreateTrigImplReq*)theData;
  fprintf(output, " senderRef: %x", sig->senderRef);
  fprintf(output, " senderData: %x", sig->senderData);
  fprintf(output, "\n");  
  fprintf(output, " requestType: %x", sig->requestType);
  fprintf(output, " tableId: %x", sig->tableId);
  fprintf(output, " tableVersion: %x", sig->tableVersion);
  fprintf(output, " indexId: %x", sig->indexId);
  fprintf(output, " indexVersion: %x", sig->indexVersion);
  fprintf(output, "\n");  
  fprintf(output, " triggerId: %x", sig->triggerId);
  fprintf(output, " triggerInfo: %x", sig->triggerInfo);
  fprintf(output, " receiverRef: %x", sig->receiverRef);
  fprintf(output, "\n");  
  char buf[MAXNROFATTRIBUTESINWORDS * 8 + 1];
  fprintf(output, " attributeMask: %s", sig->attributeMask.getText(buf));
  fprintf(output, "\n");  
  return true;
}

bool
printCREATE_TRIG_IMPL_CONF(FILE* output, const Uint32* theData, Uint32 len, Uint16)
{
  const CreateTrigImplConf* sig = (const CreateTrigImplConf*)theData;
  fprintf(output, " senderRef: %x", sig->senderRef);
  fprintf(output, " senderData: %x", sig->senderData);
  fprintf(output, "\n");  
  fprintf(output, " tableId: %x", sig->tableId);
  fprintf(output, " triggerId: %x", sig->triggerId);
  fprintf(output, " triggerInfo: %x", sig->triggerInfo);
  fprintf(output, "\n");  
  return true;
}

bool
printCREATE_TRIG_IMPL_REF(FILE* output, const Uint32* theData, Uint32 len, Uint16)
{
  const CreateTrigImplRef* sig = (CreateTrigImplRef*)theData;
  fprintf(output, " senderRef: %x", sig->senderRef);
  fprintf(output, " senderData: %x", sig->senderData);
  fprintf(output, "\n");  
  fprintf(output, " tableId: %x", sig->tableId);
  fprintf(output, " triggerId: %x", sig->triggerId);
  fprintf(output, " triggerInfo: %x", sig->triggerInfo);
  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.9/storage/ndb/src/common/debugger/signaldata/SchemaTransImpl.cpp	2007-01-14 12:39:54 +01:00
+++ 1.10/storage/ndb/src/common/debugger/signaldata/SchemaTransImpl.cpp	2007-01-16 12:39:54 +01:00
@@ -77,6 +77,9 @@
     case GSN_ALTER_INDX_IMPL_REQ:
       printALTER_INDX_IMPL_REQ(output, pb_data, pb_len, rbn);
       break;
+    case GSN_CREATE_TRIG_IMPL_REQ:
+      printCREATE_TRIG_IMPL_REQ(output, pb_data, pb_len, rbn);
+      break;
     default:
       {
         Uint32 i;

--- 1.16/storage/ndb/src/common/debugger/signaldata/Makefile.am	2007-01-14 12:39:54 +01:00
+++ 1.17/storage/ndb/src/common/debugger/signaldata/Makefile.am	2007-01-16 12:39:54 +01:00
@@ -27,7 +27,8 @@
           ScanFrag.cpp \
 	  SchemaTrans.cpp SchemaTransImpl.cpp \
 	  GetTabInfo.cpp CreateTab.cpp DropTable.cpp \
-	  CreateIndxImpl.cpp DropIndxImpl.cpp AlterIndxImpl.cpp
+	  CreateIndxImpl.cpp DropIndxImpl.cpp AlterIndxImpl.cpp \
+	  CreateTrigImpl.cpp
 
 include $(top_srcdir)/storage/ndb/config/common.mk.am
 include $(top_srcdir)/storage/ndb/config/type_ndbapi.mk.am
@@ -48,6 +49,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.2390)pekka16 Jan