For the complete documentation index, see llms.txt. This page is also available as Markdown.

Trigger Limitations

Understand the constraints of triggers, such as the prohibition of statements that return result sets or explicitly start/commit transactions.

The following restrictions apply to triggers:

  • All of the restrictions listed in Stored Routine Limitations.

  • All of the restrictions listed in Stored Function Limitations.

  • Triggers are always executed for each row. MariaDB does not support the standard FOR EACH STATEMENT option.

  • Triggers cannot operate on any tables in the mysql, information_schema or performance_schema database.

  • Cannot return a result set.

  • The RETURN statement is not permitted, since triggers don't return any values. Use LEAVE to immediately exit a trigger.

  • Triggers are not activated by foreign key actions.

  • If a trigger is loaded into cache, it is not automatically reloaded when the table metadata changes. In this case a trigger can operate using the outdated metadata.

  • By default, with row-based replication, triggers run on the master, and the effects of their executions are replicated to the slaves. It is possible to run triggers on slaves. See Running triggers on the slave for Row-based events.

  • Conflict Detection and Resolution (CDR) triggers, added in MariaDB Enterprise Server 12.3 (beta), carry additional restrictions: a CDR trigger binds to exactly one conflict type, cannot be combined with the INSERT, UPDATE, or DELETE events or with a BEFORE/AFTER timing keyword, and only fires for tables that have a PRIMARY KEY.

See Also

This page is licensed: CC BY-SA / Gnu FDL

spinner

Last updated

Was this helpful?