PL/SQL parser - Phase 2 (MDEV-10764)

[MDEV-10572] Automatic transaction start for sql_mode=ORACLE Created: 2016-08-17  Updated: 2020-05-11

Status: Open
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: None
Fix Version/s: None

Type: Technical task Priority: Major
Reporter: Alexander Barkov Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: Compatibility


 Description   

When running with sql_mode=ORACLE, MariaDB should emulate Oracle-style transaction related behavior:

  • No explicit transaction start (e.g. BEGIN or START statement) is needed.
    Transactions start automatically and last until COMMIT or ROLLBACK.
    This looks to be equal to SET AUTOCOMMIT=0.
  • The BEGIN keyword should always start a code block (a compound statement), even outside of a stored procedure.


 Comments   
Comment by Michael Widenius [ 2016-08-18 ]

I assume the an easy solution is that we set autocommit=0 when changing mode to Oracle.

In 10.2, we already support compound statements with BEGIN NOT ATOMIC.

The MariaDB syntax, when, running in autocommit=0 mode, is:

begin not atomic select 1 ; end ; commit |

While Oracle syntax is:

begin select 1 ; end ; commit |

Generated at Thu Feb 08 07:43:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.