I've opened a bug report against MySQL http://bugs.mysql.com/bug.php?id=70793&thanks=4. There is a code example here that demonstrates this on this bug. There is also a workaround that I found that is included in the bug report. This workaround works for PHP and console
I'm running into a bizarre issue with a Stored Procedure and PHP PDO.
I am not allowed to post the body of the stored procedure, but I can provide the following information.
My issue is that I cannot call this stored procedure from PHP PDO, I get this error
SQLSTATE[HY000]: General error: 1290 The MySQL server is running with the --read-only option so it cannot execute this statement
This makes absolutely no sense because I can call this on the read only replica as long as I'm not doing it from PHP.
Can anyone shed any light on what might be going on here?
Edit More bizarre information
I can get a console session to fail, but I can also make it succeed. It depends on if the temporary table that the stored proc uses has already been created. So let me explain my working and failing use cases
Fail
The MySQL server is running with the --read-only option so it cannot execute this statement
Pass
Even stranger is that I most definitely drop that temp table inside the the stored proc and recreate it if it exists.
I'm reasonably certain at this point we are looking at a MySQL bug
Did you try adding the TEMPORARY keyword to the DROP TABLE command?
The TEMPORARY keyword has the following effects:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With