Common SQL Errors

MySQL Error ER_NON_RO_SELECT_DISABLE_TIMER (3025): Select is not a read only statement - How to Fix and Prevent

Galaxy Team
August 8, 2025

MySQL issues this warning when a SELECT statement contains write operations, so query profiling timers are disabled.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error ER_NON_RO_SELECT_DISABLE_TIMER?

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.

Error Highlights

Typical Error Message

ER_NON_RO_SELECT_DISABLE_TIMER

Error Type

Runtime Warning

Language

MySQL

Symbol

ER_NON_RO_SELECT_DISABLE_TIMER was added in 5.7.4.

Error Code

3025

SQL State

HY000

Explanation

Table of Contents

What is MySQL error 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.

When does this error occur?

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.

Why is fixing it important?

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.

Common Causes

Common Causes of ER_NON_RO_SELECT_DISABLE_TIMER

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.

Related Errors

Related Errors and Warnings

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.

FAQs

Does ER_NON_RO_SELECT_DISABLE_TIMER stop my query?

No. It is a warning. The query still runs but without profiling timers.

Is data modified when this warning appears?

Not always. The statement may only lock rows. Review the query to confirm.

How do I suppress the warning?

Rewrite the query to be read-only or disable the profiler for that session.

Can Galaxy help avoid this warning?

Yes. Galaxy's AI copilot highlights write clauses in SELECT statements and offers one-click refactoring to read-only syntax.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo