Details
Description
MariaDB [test]> SET SESSION autocommit = 0;
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> SAVEPOINT x;
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> SELECT @@in_transaction;
+------------------+
| @@in_transaction |
+------------------+
| 0 |
+------------------+
1 row in set (0.00 sec)
In this case, SAVEPOINT did nothing. I think that one of the following alternatives should be implemented:
1) Implicitly start a transaction, and then create the savepoint.
2) Issue an error.
3) Like 1, but also issue a warning because there is probably a bug in an application.
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Note that 1 would be very useful for stored procedures in a reusable context. You may want to enclose a procedure in a transaction. But you don't know if the user wants to execute it as part of another transaction, or if a transaction is already active.