Skip to content

Conversation

@peter1123581321
Copy link
Contributor

@peter1123581321 peter1123581321 commented Dec 3, 2025

The related bug-ticket in Jira describes an AssertionError when using hibernate.id.db_structure_naming_strategy=legacy with an InsertSelect-query on MySQL.

The AssertionError occurs because the row number window function is used instead of the hibernate_sequence table.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-18835

@beikov
Copy link
Member

beikov commented Jan 8, 2026

Thanks for the test and attempt to fix. Unfortunately the fix wasn't quite correct, because you can't use table sequences for insert-select directly. One must use the row numbering scheme and update the temporary table with generated values, but that only happens when using the multi-table insert strategy. I fixed the condition that was missing a case in the superseded PR: #11570

@beikov beikov closed this Jan 8, 2026
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.

2 participants