Databases 3 min read

Do Identical UPDATE Statements Trigger MySQL Execution? A Binlog Format Comparison

This article investigates whether MySQL re‑executes UPDATE statements that do not change any data, comparing the behavior under binlog_format = ROW and binlog_format = STATEMENT with a full row image setting, and presents test results from two sessions.

Programmer DD
Programmer DD
Programmer DD
Do Identical UPDATE Statements Trigger MySQL Execution? A Binlog Format Comparison

Background

This article mainly tests whether MySQL re‑executes an UPDATE statement that is identical to the original data (i.e., no change) when the UPDATE is issued.

Test Environment

MySQL 5.7.25

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 data loads every column; consequently, an UPDATE that does not change any values is not executed. MySQL calls the InnoDB interface to modify the row, but the engine detects that the value is unchanged and returns without performing an update.

binlog_format = STATEMENT

Parameters

Test Steps

Session 1:

Session 2:

Session 1 (repeat):

Summary

When binlog_format=statement and binlog_row_image=FULL , InnoDB fully executes the UPDATE statement, applying locks and performing the actual data modification (e.g., changing 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.

mysqlBinlogRowUPDATEStatement
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

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.