QUESTION WITHDRAWN! When I spell everything correctly, the problem goes away!
I have a MySQL stored procedure which creates a temporary table. When I call the procedure from the mysql prompt, it appears to run successfully, but if I then SELECT COUNT(*) from the temporary table, I get an error saying the table doesn't exist.
Does a temporary table created inside a stored procedure cease to exist when the stored procedure ends?
mysql> delimiter //
mysql> drop procedure if exists sp_temp_reciepts//
mysql> create procedure sp_temp_receipts ()
begin
drop temporary table if exists receipts;
create temporary table receipts
( ... snip ...
);
insert into receipts
select ... snip ...
end//
mysql> delimiter ;
mysql> call sp_temp_reciepts();
Query OK, 46903 rows affected, 1 warning (2.15 sec)
mysql> select count(*) from receipts;
ERROR 1146 (42S02): Table 'receipts' doesn't exist