Syntax\n------\n\nSAVEPOINT identifier\nROLLBACK [WORK] TO [SAVEPOINT] identifier\nRELEASE SAVEPOINT identifier\n\nDescription\n-----------\n\nInnoDB supports the SQL statements SAVEPOINT,ROLLBACK TO SAVEPOINT, RELEASE SAVEPOINT\\\nand the optional WORK keyword forROLLBACK.\n\nEach savepoint must have a legal MariaDB identifier. A savepoint is a named sub-transaction.\n\nNormally ROLLBACK undoes the changes performed by the whole transaction. When used with the TO clause, it undoes the changes performed after the specified savepoint, and erases all subsequent savepoints. However, all locks that have been acquired after the save point will survive. RELEASE SAVEPOINT does not rollback or commit any changes, but removes the specified savepoint.\n\nWhen the execution of a trigger or a stored function begins, it is not possible to use statements which reference a savepoint which was defined from out of that stored program.\n\nWhen a COMMIT (including implicit commits) or a ROLLBACK statement (with no TO clause) is performed, they act on the whole transaction, and all savepoints are removed.\n\nErrors\n\nIf COMMIT or ROLLBACK is issued and no transaction was started, no error is reported.\n\nIf SAVEPOINT is issued and no transaction was started, no error is reported but no savepoint is created. When ROLLBACK TO SAVEPOINT or RELEASE SAVEPOINT is called for a savepoint that does not exist, an error like this is issued:\n\n``sql\nERROR 1305 (42000): SAVEPOINT svp_name does not exist\n``\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/transactions/savepoint