I'm trying to run the following simple test- creating a temp table, and then UNIONing two different selections:
CREATE TEMPORARY TABLE tmp
SELECT * FROM people;
SELECT * FROM tmp
UNION ALL
SELECT * FROM tmp;
But get a #1137 - Can't reopen table: 'tmp'
I thought temp tables were supposed to last the session. What's the problem here?