MySQL stored procedure on a read replica with PHP PDO
Did you try adding the TEMPORARY keyword to the DROP TABLE command?
The TEMPORARY keyword has the following effects:
- The statement drops only TEMPORARY tables.
- The statement does not end an ongoing transaction.
- No access rights are checked. (A TEMPORARY table is visible only to the session that created it, so no check is necessary.)