Spec-Zone .ru
спецификации, руководства, описания, API

20.27. The INFORMATION_SCHEMA TRIGGERS Table

The TRIGGERS table provides information about triggers. You can see results only for databases and tables for which you have the TRIGGER privilege.

INFORMATION_SCHEMA Name SHOW Name Remarks
TRIGGER_CATALOG def
TRIGGER_SCHEMA
TRIGGER_NAME Trigger
EVENT_MANIPULATION Event
EVENT_OBJECT_CATALOG def
EVENT_OBJECT_SCHEMA
EVENT_OBJECT_TABLE Table
ACTION_ORDER 0
ACTION_CONDITION NULL
ACTION_STATEMENT Statement
ACTION_ORIENTATION ROW
ACTION_TIMING Timing
ACTION_REFERENCE_OLD_TABLE NULL
ACTION_REFERENCE_NEW_TABLE NULL
ACTION_REFERENCE_OLD_ROW OLD
ACTION_REFERENCE_NEW_ROW NEW
CREATED NULL (0)
SQL_MODE MySQL extension
DEFINER MySQL extension
CHARACTER_SET_CLIENT MySQL extension
COLLATION_CONNECTION MySQL extension
DATABASE_COLLATION MySQL extension

Notes:

Example, using the ins_sum trigger defined in Section 19.3, "Using Triggers":

mysql> SELECT * FROM
        INFORMATION_SCHEMA.TRIGGERS    -> WHERE TRIGGER_SCHEMA='test'
        AND TRIGGER_NAME='ins_sum'\G*************************** 1. row ***************************           TRIGGER_CATALOG: def            TRIGGER_SCHEMA: test              TRIGGER_NAME: ins_sum        EVENT_MANIPULATION: INSERT      EVENT_OBJECT_CATALOG: def       EVENT_OBJECT_SCHEMA: test        EVENT_OBJECT_TABLE: account              ACTION_ORDER: 0          ACTION_CONDITION: NULL          ACTION_STATEMENT: SET @sum = @sum + NEW.amount        ACTION_ORIENTATION: ROW             ACTION_TIMING: BEFOREACTION_REFERENCE_OLD_TABLE: NULLACTION_REFERENCE_NEW_TABLE: NULL  ACTION_REFERENCE_OLD_ROW: OLD  ACTION_REFERENCE_NEW_ROW: NEW                   CREATED: NULL                  SQL_MODE:                   DEFINER: me@localhost      CHARACTER_SET_CLIENT: utf8      COLLATION_CONNECTION: utf8_general_ci        DATABASE_COLLATION: latin1_swedish_ci

See also Section 13.7.5.39, "SHOW TRIGGERS Syntax".