Details
-
New Feature
-
Status: In Progress (View Workflow)
-
Critical
-
Resolution: Unresolved
-
Q1/2026 Server Development, Q2/2026 Server Maintenance
Description
To create a system trigger on start up/shut down the following statement should be executed:
CREATE TRIGGER [IF NOT EXISTS] trigger_name AFTER STARTUP trigger_body |
CREATE TRIGGER [IF NOT EXISTS] trigger_name BEFORE SHUTDOWN trigger_body |
To drop a system trigger, the regular DROP TRIGGER statement is used.
The SUPER privilege is required to create or drop a system trigger.
A system trigger is created in the schema that is current at the moment the CREATE TRIGGER statement executed.
Metadata of system trigger is stored at the table mysql.event. To store system trigger metadata this table is extended with the following columns:
kind, when, ddl_type
The table mysql.event has the primary on columns (`db`,`name`). In result, it is not possible to create an event and a system trigger with name in the same database. Attempt to do it will fail with the error ER_TRG_EVENT_CONFLICTS_NAME
Implementation of the statements
SHOW TRIGGERS
|
SHOW CREATE TRIGGER |
are modified to handle system triggers.
The utility program mariadb-dump is patched to support dumping of system triggers.
In case server is started on the data dictionary with broken structure of the table mysql.event (for example, missed some columns required for storing trigger's metadata), running of server will be failed with error complaining on wrong structure of the table mysql.event.
To fix the issue, start server with the option --skip-grant-tables.
Attachments
Issue Links
- includes
-
MDEV-36006 Implement generalized triggers 2
-
- Closed
-
- relates to
-
MDEV-37488 Adapting innodb_buffer_pool_dump_pct from innodb_old_blocks_pct
-
- Open
-
-
MDEV-30643 Allow CONCAT in SIGNAL
-
- Open
-