Davi Arnaut <[email protected]> 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.

_______________________________________________
Mailing list: https://launchpad.net/~maria-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to