Home > database >  Mysql stored procedures using PREPARE - EXECUTE code execution, cannot be rolled back
Mysql stored procedures using PREPARE - EXECUTE code execution, cannot be rolled back

Time:03-24

Specific operation:
1 in the Mysql stored procedures, define SQLEXCEPTION, start the transaction open transaction;
2, use the PREPARE - EXECUTE perform insert statement;
3, the EXECUTE executed after the ROLLBACK,

And found that the rollback is invalid,,,

This thing is submitted automatically, is there any way can do any wrong rollback

Request, guiding a wave

CodePudding user response:

The official documentation for half a day did not mention this will automatically submit,,,

CodePudding user response:

See if ni database parameter is set automatically submit, show variables like 'autocommit mode;

CodePudding user response:

Thank you, I was solved,
Setting is the default autocommit,
Said to check the document in the stored procedure with start transaction instead of the autocommit mode, has been written, so before start the transaction can indeed replace the autocommit mode, I don't know why this time have PREPARE - EXECUTE failure,
Don't know if a MySQL bug, and set the autocommit=0 before start the transaction will roll back,
  • Related