Databases 3 min read

MySQL Update Behavior with Identical Data under Different binlog_format Settings

This article tests whether MySQL re‑executes an UPDATE statement that does not change any column values, comparing the behavior under binlog_format=ROW and binlog_format=STATEMENT on MySQL 5.7.25 running on CentOS 7.4.

Architecture Digest
Architecture Digest
Architecture Digest
MySQL Update Behavior with Identical Data under Different binlog_format Settings

1. Background

This article tests whether MySQL re‑executes an UPDATE statement that sets a column to the same value it already holds, i.e., whether the statement is internally executed when the new data equals the original data.

2. Test Environment

MySQL 5.7.25

CentOS 7.4

3. binlog_format = ROW

Parameters

Test Steps

session1

session2

session1

Summary

When binlog_format=row and binlog_row_image=FULL, MySQL records all fields in the binlog, reads all data, and therefore skips executing an UPDATE that would not change any values; the InnoDB engine receives the “modify to (1,55)” request, detects no change, and returns without updating.

4. binlog_format = STATEMENT

Parameters

Test Steps

session1

session2

session1

Summary

When binlog_format=statement and binlog_row_image=FULL, InnoDB fully executes the UPDATE, performing the lock and the actual 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.

InnoDBmysqldatabasesUPDATE
Architecture Digest
Written by

Architecture Digest

Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.

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.