Databases 3 min read

Do Identical UPDATE Statements Trigger MySQL Binlog Writes? A Practical Test

This article experimentally investigates whether MySQL re‑executes UPDATE statements that set a column to its current value, comparing behavior under ROW and STATEMENT binlog formats and revealing how InnoDB handles redundant updates.

Java Backend Technology
Java Backend Technology
Java Backend Technology
Do Identical UPDATE Statements Trigger MySQL Binlog Writes? A Practical Test

Background

This article tests whether MySQL re‑executes an UPDATE statement when the new value is identical to the existing one.

Test Environment

MySQL 5.7.25 on CentOS 7.4.

binlog_format = ROW

Parameters

Test Steps

Session 1:

Session 2:

Session 1 (repeat):

Summary

When binlog_format=row and binlog_row_image=FULL , MySQL records all fields in the binlog, so reading the data pulls all columns; however, an UPDATE that does not change any values is skipped. InnoDB receives the “modify to (1,55)” request, detects no change, and returns without updating.

binlog_format = STATEMENT

Parameters

Test Steps

Session 1:

Session 2:

Session 1 (repeat):

Summary

With binlog_format=statement and binlog_row_image=FULL , InnoDB fully executes the UPDATE, performing the lock and the data change (e.g., modifying the value to (1,999)).

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

InnoDBmysqlBinlogrow formatUPDATESTATEMENT format
Java Backend Technology
Written by

Java Backend Technology

Focus on Java-related technologies: SSM, Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading. Occasionally cover DevOps tools like Jenkins, Nexus, Docker, and ELK. Also share technical insights from time to time, committed to Java full-stack development!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.