SET pseudo_slave_mode=1;
CREATE TABLE t1 (c INT) ENGINE=InnoDB;
CREATE TABLE t2 (c INT) ENGINE=MEMORY;
XA START 'a';
INSERT INTO t1 VALUES (0);
CREATE TEMPORARY TABLE t1t (c INT) ENGINE=InnoDB;
INSERT INTO t1t VALUES (0);
XA END 'a';
XA PREPARE 'a';
OPTIMIZE TABLE t1t;
Table	Op	Msg_type	Msg_text
test.t1t	optimize	Error	Table 'test.t1t' doesn't exist
test.t1t	optimize	status	Operation failed
LOCK TABLE t2 READ;
XA COMMIT 'a';
# restart
DROP TABLE t1, t2;