I create a table t1 and a temporary table t1.
Now I create and call a procedure that queries t1:
It uses the temporary table t1 (rather than the permanent table) and returns this result:
So far so good.
Now I drop the temporary table and call the procedure again.
It returns an error:
Notice, it still tries to use the column x which belonged to the temporary table and which does not exist in the permanent table. This looks wrong.
Note, if I now run a stand-alone SELECT query outside of a routine, it works fine:
The second CALL is expected to return the same result.