USE test;
DROP TABLE IF EXISTS T1;
SET autocommit=1;
BEGIN;
CREATE TABLE T1 (id integer);
SELECT (@@server_id) INTO @a;
SELECT IF(@a <> @TMASTER_ID,'OK (slave)','FAIL (master)') AS result;
result
OK (slave)
DROP TABLE T1;
COMMIT;
