Common SQL Errors

MySQL Error 1020: ER_CHECKREAD – How to Fix and Prevent

Galaxy Team
August 5, 2025

MySQL error 1020 (ER_CHECKREAD) means a row changed between two read operations, usually during CHECK TABLE or concurrent MyISAM access, indicating potential table corruption or race conditions.

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 1020 ER_CHECKREAD?

MySQL error 1020: ER_CHECKREAD occurs when a record changes between reads, typically during CHECK TABLE or concurrent MyISAM queries. Lock the table, run CHECK/REPAIR, or migrate to InnoDB to resolve the issue and prevent future occurrences.

Error Highlights

Typical Error Message

Record has changed since last read in table '%s'

Error Type

Data Consistency Error

Language

MySQL

Symbol

ER_CHECKREAD

Error Code

1020

SQL State

Explanation

Table of Contents

What does "Record has changed since last read" mean?

Error 1020 signals that MySQL detected a mismatch between two reads of the same row. The engine expected identical data but found differences, so it aborted the operation to prevent inconsistent results.

The message appears most often with MyISAM tables during CHECK TABLE, REPAIR TABLE, or long-running reads while other sessions modify the data.

It can also surface in replication when the slave rereads rows for consistency checks.

When does ER_CHECKREAD usually happen?

The error is raised during internal consistency checks. Operations like myisamchk, CHECK TABLE, and SELECT statements using non-locking reads are prime triggers. If another session updates the same row between those reads, MySQL throws ER_CHECKREAD.

Because MyISAM lacks row-level locking and full ACID guarantees, concurrent writes are permitted even while reads run.

That design trade-off makes the engine faster but more prone to this race condition.

Why fixing the error matters

Ignoring ER_CHECKREAD risks data corruption, failed backups, or replication stops. Addressing the root cause ensures table integrity, reliable query results, and uninterrupted application availability. Production systems should treat the warning as a signal to investigate storage engines, locking, and table health.

.

Common Causes

Concurrent Write During CHECK TABLE

A session updates or deletes rows while another thread runs CHECK TABLE on the same MyISAM table, leading to inconsistent reads.

Long SELECT on MyISAM Table

A long-running SELECT without LOCK TABLE overlaps with DML statements that modify the scanned rows.

Corrupted Index or Data File

Physical corruption in the .MYI or .MYD files causes mismatched records when MySQL re-reads the page.

Replication Consistency Check

A slave re-reads a row for relay log processing, finds a changed value, and raises ER_CHECKREAD to stop replication.

File System or Disk Glitch

Unexpected disk errors write partial blocks, so subsequent reads return altered data.

.

Related Errors

FAQs

Does ER_CHECKREAD affect InnoDB tables?

No. The error is specific to engines lacking MVCC, mainly MyISAM. InnoDB uses consistent snapshots, so the race condition cannot occur.

Can I ignore the error if the query eventually works?

Ignoring it risks hidden corruption and replication failures. Always investigate, repair, or migrate to a safer engine.

Will setting the table to READ ONLY fix the problem?

Temporary READ ONLY status stops writes and eliminates the race, but long-term you should migrate to an ACID-compliant engine.

How does Galaxy help?

Galaxy lets teams version endorsed maintenance scripts that lock tables before checks, reducing the chance of ER_CHECKREAD in shared environments.

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