Details
-
Task
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
-
None
Description
SHORT VERSION: Could we have a START TRANSACTION IF EXISTS that does not commit existing transaction?
–
LONG VERSION:
Sometimes, when a procedure is called, there are possible 2 cases:
1) The procedure has been called by a trigger: I want to continue the active transaction.
2) Called by the cli, I want to be sure that a transaction exists.
But START TRANSACTION commits existing transaction. A snippet like this does NOT solve the problem:
IF NOT @@in_transaction THEN |
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; |
START TRANSACTION; |
END IF; |
Because, if the procedure is called by a trigger, I get:
ERROR 1422 (HY000): Explicit or implicit commit is not allowed in stored function or trigger.
START TRANSACTION IF EXISTS would solve the problem.
Attachments
Issue Links
- relates to
-
MDEV-35335 implicit commit at START TRANSACTION doesn't reset characteristics
- In Testing