MYSQL | ERROR 1305(42000) SAVEPOINT *** DOES NOT EXIST

autocommit mode: In the open case, for each statement, it will automatically form a commit, that is, will immediately start and end of a transaction. So, when there is rollback to savepoint this error occurs, the first step is to check whether there autocommit mode is turned on.

select @@autocommit;

1 represents the open, 0 represents the unopened.

To switch, enter the following code

set autocommit = 0 ;

At this time, that must be started manually or saved for each transaction. Code

START TRANSACTION
# OR
BEGIN

To end, then we would comment or rollback to the end of this stage

In the case of autocommit on, it may be artificially, the statement several together,

At this time also spend a piece of code, this time commit or rollback is a good statement of a few.

Guess you like

Origin www.cnblogs.com/lxwphp/p/11348530.html