Skip to content

Respect case-insensitive identifiers in ON DUPLICATE KEY UPDATE - #4524

Merged
grandinj merged 4 commits into
h2database:masterfrom
wozhenbang2004:fix/mysql-case-insensitive-duplicate-key
Nov 3, 2026
Merged

grandinj merged 4 commits into
h2database:masterfrom
wozhenbang2004:fix/mysql-case-insensitive-duplicate-key

Conversation

@wozhenbang2004

Copy link
Copy Markdown
Contributor

Fixes #4238.

The MySQL compatibility parser compares schema and table qualifiers in ON DUPLICATE KEY UPDATE assignments with String.equals, even when CASE_INSENSITIVE_IDENTIFIERS=TRUE is enabled. Use Database.equalsIdentifiers for both checks so they follow the database's identifier rules while preserving case-sensitive behavior.

The regression test uses isolated in-memory databases with the setting enabled and disabled. It covers quoted and unquoted schema/table qualifiers, rejects genuinely different names, and checks update counts and the resulting row value.

Validation

CheckTextFiles and SpellChecker fail identically on this patch and on unmodified 6f9a229: existing copyright/line-length findings and 47 existing unknown words, respectively. No unrelated source or dictionary changes are included.

The full TestAll / jar testCI suite was not run locally. Java 11-targeted classes were tested on JDK 21, not on a Java 11 runtime.

License

I am contributing the changes in this pull request to H2 for distribution multiple-licensed under the MPL 2.0 and the EPL 1.0 (https://h2database.com/html/license.html).

@wozhenbang2004
wozhenbang2004 marked this pull request as ready for review October 30, 2026 17:41
@grandinj

grandinj commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

I cannot merge this because it has a conflict and you have done something to prevent me from merging a conflict resolution?

@grandinj

grandinj commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Thank you!

@grandinj
grandinj merged commit 6dc1340 into h2database:master Nov 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MySQL mode does not respect IGNORECASE/CASE_INSENSITIVE_IDENTIFIERS in 'on duplicate key update' part (H2 2.3.232)

2 participants