How event handlers are executed

When an event handler is triggered, a temporary internal connection is made on which the event handler is executed. The handler is not executed on the connection that caused the handler to be triggered, so statements such as MESSAGE ... TO CLIENT, which interact with the client application, are not meaningful within event handlers. Similarly, statements that return result sets are not permitted.

The temporary connection on which the handler is executed does not count towards the connection limit for licensing purposes, and the procedure specified by the login_procedure option is not executed for event connections.

Event creation requires DBA authority, and events execute with the permissions of their creator. If you want event handlers to execute with non-DBA authority, you can call a procedure from within the handler, as stored procedures run with the permissions of their creator.

Any event errors are logged to the database server message log.

Event handlers and errors

The transaction in an event handler is committed if no errors are detected during execution, and rolled back if errors are detected.

If an error occurs within an atomic compound statement and that statement has an exception handler that handles the error, then any changes made within the statement are left outstanding. If the exception handler does not handle the error or causes another error (including via RESIGNAL), then changes made within the atomic statement are undone.