~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to storage/ndb/include/kernel/trigger_definitions.h

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#ifndef NDB_TRIGGER_DEFINITIONS_H
 
17
#define NDB_TRIGGER_DEFINITIONS_H
 
18
 
 
19
#include <ndb_global.h>
 
20
#include "ndb_limits.h"
 
21
#include <signaldata/DictTabInfo.hpp>
 
22
 
 
23
#define ILLEGAL_TRIGGER_ID ((Uint32)(~0))
 
24
 
 
25
struct TriggerType {
 
26
  enum Value {
 
27
    //CONSTRAINT            = 0,
 
28
    SECONDARY_INDEX       = DictTabInfo::HashIndexTrigger,
 
29
    //FOREIGN_KEY           = 2,
 
30
    //SCHEMA_UPGRADE        = 3,
 
31
    //API_TRIGGER           = 4,
 
32
    //SQL_TRIGGER           = 5,
 
33
    SUBSCRIPTION          = DictTabInfo::SubscriptionTrigger,
 
34
    READ_ONLY_CONSTRAINT  = DictTabInfo::ReadOnlyConstraint,
 
35
    ORDERED_INDEX         = DictTabInfo::IndexTrigger,
 
36
    
 
37
    SUBSCRIPTION_BEFORE   = 9 // Only used by TUP/SUMA, should be REMOVED!!
 
38
  };
 
39
};
 
40
 
 
41
struct TriggerActionTime {
 
42
  enum Value {
 
43
    TA_BEFORE   = 0, /* Immediate, before operation */
 
44
    TA_AFTER    = 1, /* Immediate, after operation */
 
45
    TA_DEFERRED = 2, /* Before commit */
 
46
    TA_DETACHED = 3, /* After commit in a separate transaction, NYI */
 
47
    TA_CUSTOM   = 4  /* Hardcoded per TriggerType */
 
48
  };
 
49
};
 
50
 
 
51
struct TriggerEvent {
 
52
  /** TableEvent must match 1 << TriggerEvent */
 
53
  enum Value {
 
54
    TE_INSERT = 0,
 
55
    TE_DELETE = 1,
 
56
    TE_UPDATE = 2,
 
57
    TE_CUSTOM = 3    /* Hardcoded per TriggerType */
 
58
  };
 
59
};
 
60
 
 
61
#endif