Skip to content

sql(mysql): accept any spelling of ON DUPLICATE KEY UPDATE in the update helper#32040

Open
robobun wants to merge 2 commits into
mainfrom
farm/e95a5336/mysql-upsert-keyword-case
Open

sql(mysql): accept any spelling of ON DUPLICATE KEY UPDATE in the update helper#32040
robobun wants to merge 2 commits into
mainfrom
farm/e95a5336/mysql-upsert-keyword-case

sql(mysql): accept flexible whitespace in the upsert suffix check

124d4cf
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 12, 2026 in 18m 15s

Code review found 1 potential issue

Found 1 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/js/internal/sql/mysql.ts:287 Tail-slice optimization dropped: regex now scans full query string

Annotations

Check warning on line 287 in src/js/internal/sql/mysql.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

Tail-slice optimization dropped: regex now scans full query string

nit (non-blocking): the previous review suggested `.slice(-64)` to keep the regex off the full query for large bulk inserts, but 124d4cf applies `upsertSuffixRegExp.test(query)` to the entire accumulated string — which at this call site already contains the expanded `VALUES (?,?,...),(?,?,...),...` list and can be hundreds of KB. The PR description still says "only the tail of the query is uppercased since bulk inserts can make the string large", so either restore the tail slice (`upsertSuffixRe