1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Bug#20837 Apparent change of isolation level during transaction

Bug#46527 COMMIT AND CHAIN RELEASE does not make sense
Bug#53343 completion_type=1, COMMIT/ROLLBACK AND CHAIN don't 
          preserve the isolation level
Bug#53346 completion_type has strange effect in a stored 
          procedure/prepared statement

Added test cases to verify the expected behaviour of :
 SET SESSION TRANSACTION ISOLATION LEVEL, 
 SET TRANSACTION ISOLATION LEVEL,
 @@completion_type,
 COMMIT AND CHAIN,
 ROLLBACK AND CHAIN
 ..and some combinations of the above
This commit is contained in:
Magne Mahre
2010-06-08 19:47:10 +02:00
19 changed files with 939 additions and 64 deletions

View File

@ -1941,8 +1941,31 @@ public:
uint server_status,open_options;
enum enum_thread_type system_thread;
uint select_number; //number of select (used for EXPLAIN)
/* variables.transaction_isolation is reset to this after each commit */
enum_tx_isolation session_tx_isolation;
/*
Current or next transaction isolation level.
When a connection is established, the value is taken from
@@session.tx_isolation (default transaction isolation for
the session), which is in turn taken from @@global.tx_isolation
(the global value).
If there is no transaction started, this variable
holds the value of the next transaction's isolation level.
When a transaction starts, the value stored in this variable
becomes "actual".
At transaction commit or rollback, we assign this variable
again from @@session.tx_isolation.
The only statement that can otherwise change the value
of this variable is SET TRANSACTION ISOLATION LEVEL.
Its purpose is to effect the isolation level of the next
transaction in this session. When this statement is executed,
the value in this variable is changed. However, since
this statement is only allowed when there is no active
transaction, this assignment (naturally) only affects the
upcoming transaction.
At the end of the current active transaction the value is
be reset again from @@session.tx_isolation, as described
above.
*/
enum_tx_isolation tx_isolation;
enum_check_fields count_cuted_fields;
DYNAMIC_ARRAY user_var_events; /* For user variables replication */