Add support for nested transactions.
Technically the implementation is trivial - START TRANSACTION
should contain a check if there is an existing transaction, and if yes - execute
SAVEPOINT instead. Similarly, ROLLBACK should cause "ROLLBACK TO SAVEPOINT" if
transaction nesting level is more than 1.
The problem - this is a serious change in behavior for START
Possible solutions: add an sql mode or a server variable, e.g. SET
Or - create a special syntax, such as START NESTED TRANSACTION, ROLLBACK NESTED,
COMMIT NESTED. These statements should execute internally either transaction or
savepoint functions, as appropriate.
Observers changed: Sergei