Re: [Maria-developers] How to check for active transaction?
29 Feb
2012
29 Feb
'12
10:13 p.m.
Davi Arnaut <davi@twitter.com> writes:
I have a session variable @@skip_replication. I want to ensure that this variable is not modified in the middle of a statement or while a transaction is active.
Copy and paste fail. I meant THD::in_multi_stmt_transaction_mode. Try to avoid using the flag directly, in the 5.5 cycle we cleaned up some of this stuff.
Thanks Davi! I also need to check if one is in the middle of a statement, ie to prevent this: CREATE FUNCTION foo (x INT) RETURNS INT BEGIN SET SESSION skip_replication=x; RETURN x; END UPDATE t1 SET b=foo(0); It seems to work with this: if (thd->locked_tables_mode || thd->in_active_multi_stmt_transaction()) ... but I am not sure if this is the correct way? - Kristian.
4679
Age (days ago)
4679
Last active (days ago)
0 comments
1 participants
participants (1)
-
Kristian Nielsen