trigger_definitions.h
上传用户:romrleung
上传日期:2022-05-23
资源大小:18897k
文件大小:2k
源码类别:

MySQL数据库

开发平台:

Visual C++

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