MySQL issues this warning when a SELECT statement contains write operations, so query profiling timers are disabled.
ER_NON_RO_SELECT_DISABLE_TIMER occurs when MySQL detects that your SELECT is not truly read-only and turns off the execution timer. Remove modifying clauses or use proper read-only syntax to resolve the warning.
ER_NON_RO_SELECT_DISABLE_TIMER
MySQL throws the warning Select is not a read only statement, disabling timer when it detects that a SELECT includes write activity such as locking reads or assignment expressions. To avoid inaccurate metrics, the server disables the profiling timer for that statement.
The warning was introduced in MySQL 5.7.4 and appears with SQLSTATE HY000 and error code 3025. Although it does not stop the query, it signals that the operation is not purely read-only and may have performance implications.
The warning surfaces during SELECT statements that modify data or state, for example SELECT … FOR UPDATE or SELECT INTO OUTFILE. It can also appear when SET profiling is ON and the server decides the timer is unreliable for the current statement.
Applications that rely on query profiling or expect strict read-only behavior should address the cause to maintain accurate monitoring and safe concurrency.
Ignoring the message can hide performance regressions because execution times are no longer captured. It may also reveal misuse of read-only connections or replica databases, leading to replication lag or data consistency issues.
Using SELECT … FOR UPDATE or SELECT … LOCK IN SHARE MODE marks the query as write-intent on transactional engines, triggering the warning.
Including user-variable assignments in the select list (e.g., SELECT @x:=col FROM t) causes side effects that break read-only semantics.
Running SELECT INTO OUTFILE or INTO DUMPFILE writes to disk, so MySQL disables the timer.
Profiling a cursor inside stored procedures where statements acquire locks can also emit the warning.
ER_CANT_LOCK: Occurs when a SELECT … FOR UPDATE cannot acquire row locks, unlike 3025 which only disables timers.
ER_OPTION_PREVENTS_STATEMENT: Triggered when a read-only replica blocks a write inside a SELECT.
ER_VIEW_SELECT_CLAUSE: Appears when a view definition contains disallowed constructs similar to those that raise 3025.
No. It is a warning. The query still runs but without profiling timers.
Not always. The statement may only lock rows. Review the query to confirm.
Rewrite the query to be read-only or disable the profiler for that session.
Yes. Galaxy's AI copilot highlights write clauses in SELECT statements and offers one-click refactoring to read-only syntax.