Common SQL Errors

MySQL Error 1713: ER_UNDO_RECORD_TOO_BIG - How to Fix and Prevent

Galaxy Team
August 7, 2025

<p>The InnoDB storage engine cannot write an undo log record because the data modification is larger than the allowed size.</p>

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 1713 (ER_UNDO_RECORD_TOO_BIG)?

<p>MySQL Error 1713: ER_UNDO_RECORD_TOO_BIG occurs when a single INSERT, UPDATE, or DELETE generates an undo log entry that exceeds InnoDB limits. Split the operation into smaller batches or increase innodb_log_file_size to resolve the issue.</p>

Error Highlights

Typical Error Message

Undo log record is too big.

Error Type

Storage Engine Error

Language

MySQL

Symbol

ER_UNDO_RECORD_TOO_BIG

Error Code

1713

SQL State

HY000

Explanation

Table of Contents

What is MySQL error 1713 (ER_UNDO_RECORD_TOO_BIG)?

Error 1713 ER_UNDO_RECORD_TOO_BIG appears when InnoDB tries to record a data change in the undo log and the record crosses the maximum allowed size. The engine aborts the statement and returns 'Undo log record is too big', rolling back the transaction.

The limit is roughly 2GB per undo record in recent MySQL versions, but practical limits are lower because the record must fit inside an undo segment page. Large LOB updates or huge multi row statements usually reach this threshold.

What Causes This Error?

Most occurrences come from updating or inserting very large BLOB or TEXT values in a single statement. The before image for the entire column must be stored, inflating the undo record.

Another trigger is a massive UPDATE touching many wide rows, which generates an oversized metadata footprint inside the undo log. Limited undo tablespace capacity can also surface the error sooner.

How to Fix MySQL Error 1713

Break the operation into smaller batches so each individual DML statement produces a smaller undo entry. Chunked updates avoid breaching the limit.

If batch processing is not possible, raise system limits by increasing innodb_log_file_size and innodb_log_buffer_size, then restart MySQL so the new redo and undo capacity takes effect.

Common Scenarios and Solutions

Bulk loading media files often fails with error 1713. Load the files row by row or use LOAD_FILE into a staging table and copy in smaller pieces.

Schema migrations that widen VARCHAR to LONGTEXT may hit the error when updating existing rows. Alter the table with ALGORITHM=INPLACE and update rows in limited slices using LIMIT and OFFSET.

Best Practices to Avoid This Error

Store large object data in external blob storage and only keep pointers in MySQL to prevent oversized undo entries.

Enable application level batching so that no single transaction updates or inserts gigabytes of data. Combine this with monitoring of innodb_undo_log_truncate metrics.

Related Errors and Solutions

Error 1205 lock wait timeout exceeded appears when large transactions block others. Reducing batch size fixes both issues simultaneously.

Error 1114 table is full can surface when the undo tablespace grows on disk. Freeing disk space or adding undo tablespaces resolves it.

Common Causes

Large LOB Update or Insert

Updating or inserting a single row that contains a multi megabyte BLOB or TEXT column produces an undo entry larger than InnoDB allows.

Massive Multi Row UPDATE

An UPDATE without a WHERE clause on a table containing wide rows generates a huge before image for every modified row inside one undo record.

Compression Expansion

Changing compressed data or altering row format may expand the physical row size, unexpectedly inflating the undo payload.

Small Undo Tablespace

Using default undo tablespace files with limited size leaves no room for large records, triggering the error sooner.

Related Errors

MySQL Error 1205: Lock wait timeout exceeded

Occurs when a long transaction like the one that triggers 1713 blocks other sessions.

MySQL Error 1114: Table is full

Appears when undo or temporary tables run out of space during large data changes.

MySQL Error 1030: Got error 194 'Tablespace full'

Signals that the tablespace, including undo, has no free pages, often linked to the same workload pattern.

FAQs

Can I disable the undo log to bypass error 1713?

No. InnoDB requires undo logging for transactional consistency. Disabling it is not supported.

What is the safe maximum BLOB size per row?

Staying below a few hundred megabytes per row keeps the undo record well under internal limits on most builds.

Does increasing innodb_log_file_size always fix the error?

It helps but is not guaranteed. If a single row change exceeds 2GB the error still appears. Batching is safer.

How does Galaxy help avoid this problem?

Galaxy's AI copilot flags risky bulk updates and suggests batching strategies before you run the query, reducing the chance of error 1713 in production.

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