SELECT … FOR UPDATE is sent to read server when it shouldn't be
-
Using a SELECT … FOR UPDATE Read Locking query (https://dev.mysql.com/doc/refman/5.0/en/innodb-locking-reads.html), the query can be incorrectly sent to a Read-only server, resulting in this error:
The MySQL server is running with the --read-only option so it cannot execute this statement
I appears the check for a Write query is incorrect in
is_write_query
:return !preg_match('/^(?:SELECT|SHOW|DESCRIBE|EXPLAIN)\s/i', $q);
- The topic ‘SELECT … FOR UPDATE is sent to read server when it shouldn't be’ is closed to new replies.