
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
How can MySQL handle the errors during trigger execution?
Suppose if an error occurs during trigger execution then MySQL can handle it as follows −
- If a BEFORE trigger fails, the operation on the corresponding row is not performed.
- A BEFORE trigger is activated by the attempt to insert or modify the row, regardless of whether the attempt subsequently succeeds.
- An AFTER trigger is executed only if any BEFORE triggers and the row operation execute successfully.
- An error during either a BEFORE or AFTER trigger results in failure of the entire statement that caused trigger invocation.
- For transactional tables, failure of a statement should cause a rollback of all changes performed by the statement. Failure of a trigger causes the statement to fail, so trigger failure also causes rollback. For nontransactional tables, such rollback cannot be done, so although the statement fails, any changes performed prior to the point of the error remain in effect.
- Related Articles
- How to set delay for MySQL trigger/procedure execution?
- How does MySQL handle overflow during numeric expression assessment?
- How to handle Geolocation errors in HTML5?
- How to handle errors in HTML5 Web Workers?
- How to handle errors within WaitGroups in Golang?
- How Can MySQL CAST handle overflow?
- How to trigger headless test execution in Selenium with Python?
- How to handle errors in middleware C# Asp.net Core?
- How can we create and use a MySQL trigger?
- How to handle errors while working with Navigation in ReactNative?
- How to handle the errors generated while deserializing a JSON in Java?
- How Can MySQL exact-value arithmetic handle overflow?
- In MySQL, how can we declare a handler while handling errors?
- How can we destroy a trigger?
- How to stop a function during its execution in JavaScript?

Advertisements