Tagged articles
Duplicate Key
11 articles · Page 1 of 1
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 KeyINSERTMySQL
0 likes · 12 min read

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

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

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

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 IGNOREMySQL
0 likes · 10 min read

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 IGNOREMySQL
0 likes · 8 min read


ITPUBNov 5, 2020 · Databases
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.
Duplicate KeyInnoDBMySQL
0 likes · 12 min read


ITPUBJul 18, 2020 · Databases
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.
Duplicate KeyInnoDBMySQL
0 likes · 11 min read


21CTOJul 10, 2020 · Databases
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.
Duplicate KeyInnoDBMySQL
0 likes · 12 min read


ITPUBJul 9, 2020 · Databases
After upgrading a critical MySQL 5.6 database to 5.7, inserts on the master began failing with duplicate‑key errors due to unexpected auto‑increment values, prompting a deep dive into InnoDB internals, related bugs, and practical mitigation steps.
Duplicate KeyInnoDBMySQL
0 likes · 10 min read

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.
Duplicate KeyInnoDBMySQL
0 likes · 13 min read
