Tagged articles
11 articles
Page 1 of 1
FunTester
FunTester
Jan 21, 2026 · Databases

Mastering MySQL Upserts: INSERT IGNORE, REPLACE INTO, and ON DUPLICATE KEY UPDATE Explained

This article explains three MySQL INSERT variants—INSERT IGNORE, REPLACE INTO, and INSERT ... ON DUPLICATE KEY UPDATE—detailing their syntax, execution behavior, advantages, drawbacks, typical use cases, and practical comparison to help developers choose the most suitable method for handling duplicate or bulk data operations.

Duplicate KeyInsertSQL
0 likes · 12 min read
Mastering MySQL Upserts: INSERT IGNORE, REPLACE INTO, and ON DUPLICATE KEY UPDATE Explained
macrozheng
macrozheng
Jun 30, 2025 · Backend Development

Mastering Java Stream toMap: Handling Duplicate Keys with Ease

Learn how to effectively use Java's Stream API to convert a list of User objects into a Map, handle duplicate keys by providing a merge function, and avoid common pitfalls like IllegalStateException and NullPointerException using Optional and concise code examples.

CollectorsDuplicate KeyJava
0 likes · 6 min read
Mastering Java Stream toMap: Handling Duplicate Keys with Ease
Aikesheng Open Source Community
Aikesheng Open Source Community
Nov 13, 2024 · Databases

InnoDB Locking Analysis for INSERT … ON DUPLICATE KEY under REPEATABLE‑READ and READ‑COMMITTED

This article examines how InnoDB acquires row‑level locks during INSERT … ON DUPLICATE KEY operations under REPEATABLE‑READ and READ‑COMMITTED isolation levels, explains the lock types on primary and unique indexes, and shows the rollback and lock‑conversion process with concrete SQL examples.

Duplicate KeyInnoDBmysql
0 likes · 11 min read
InnoDB Locking Analysis for INSERT … ON DUPLICATE KEY under REPEATABLE‑READ and READ‑COMMITTED
macrozheng
macrozheng
Jul 11, 2024 · Backend Development

Mastering Java Stream toMap: Handling Duplicate Keys and Null Values

This article explains how to convert a list of Java objects into a Map using Stream's toMap collector, addresses duplicate key exceptions, demonstrates providing a merge function, handling null values with Optional, and compares alternative approaches such as manual loops, offering complete code examples.

CollectorsDuplicate KeyStream
0 likes · 7 min read
Mastering Java Stream toMap: Handling Duplicate Keys and Null Values
Code Ape Tech Column
Code Ape Tech Column
Mar 16, 2021 · Databases

How Unique Indexes Affect Auto-Increment and How to Handle Duplicate Keys in MySQL

This article explains how MySQL unique indexes influence auto‑increment behavior, compares unique constraints with primary keys, and demonstrates three techniques—INSERT IGNORE, REPLACE INTO, and INSERT … ON DUPLICATE KEY UPDATE—to avoid duplicate‑key errors, including their effects on auto‑increment values and potential deadlocks.

Duplicate KeyINSERT IGNOREREPLACE INTO
0 likes · 10 min read
How Unique Indexes Affect Auto-Increment and How to Handle Duplicate Keys in MySQL
Architecture Digest
Architecture Digest
Mar 15, 2021 · Databases

Impact of UNIQUE Indexes in MySQL and Strategies to Avoid Duplicate Key Errors

This article explains how MySQL UNIQUE indexes affect data insertion and auto‑increment behavior, compares them with primary keys, and presents three techniques—INSERT IGNORE, REPLACE INTO, and INSERT … ON DUPLICATE KEY UPDATE—to prevent duplicate‑key failures, including deadlock considerations.

Duplicate KeyINSERT IGNOREREPLACE INTO
0 likes · 8 min read
Impact of UNIQUE Indexes in MySQL and Strategies to Avoid Duplicate Key Errors
ITPUB
ITPUB
Nov 5, 2020 · Databases

Why Does MySQL 5.7 Throw Duplicate‑Key Errors After an Auto‑Increment Upgrade?

After upgrading a critical MySQL 5.6 table to 5.7, the system began reporting duplicate‑key errors on master, replica and read‑only instances due to unexpected changes in the AUTO_INCREMENT value, prompting a deep kernel investigation, bug analysis, on‑site reproduction, and practical mitigation steps.

BinlogDuplicate KeyInnoDB
0 likes · 12 min read
Why Does MySQL 5.7 Throw Duplicate‑Key Errors After an Auto‑Increment Upgrade?
ITPUB
ITPUB
Jul 18, 2020 · Databases

Why MySQL 5.7 Auto‑Increment Duplicates After Upgrade and How to Diagnose It

After upgrading a MySQL 5.6 master to 5.7, inserts on several InnoDB tables began failing with duplicate‑key errors because the auto_increment value became inconsistent, and the article walks through kernel‑level investigation, reproduction steps, bug analysis, and practical fixes.

BinlogBug AnalysisDuplicate Key
0 likes · 11 min read
Why MySQL 5.7 Auto‑Increment Duplicates After Upgrade and How to Diagnose It
21CTO
21CTO
Jul 10, 2020 · Databases

Why MySQL 5.7 Upgrade Triggers Duplicate Key Errors on Auto‑Increment?

After upgrading a critical MySQL client from 5.6 to 5.7, duplicate‑key errors appeared during inserts on master, replica and read‑only instances, prompting a deep dive into InnoDB auto‑increment mechanics, related kernel bugs, on‑site analysis, and both application‑side and engine‑side remediation strategies.

Bug AnalysisDuplicate KeyInnoDB
0 likes · 12 min read
Why MySQL 5.7 Upgrade Triggers Duplicate Key Errors on Auto‑Increment?
Tencent Database Technology
Tencent Database Technology
Dec 3, 2018 · Databases

Investigation of Duplicate Key Errors After MySQL 5.6→5.7 Upgrade and Auto‑Increment Bugs

The article analyzes why MySQL tables upgraded from 5.6 to 5.7 began generating duplicate‑key errors during inserts, examines related InnoDB auto‑increment mechanisms, reproduces the issue, discusses known bugs (including replace‑into replication problems), and proposes both operational and kernel‑level solutions.

Bug AnalysisDuplicate KeyInnoDB
0 likes · 13 min read
Investigation of Duplicate Key Errors After MySQL 5.6→5.7 Upgrade and Auto‑Increment Bugs