[hibernate-issues] [JIRA] (HHH-14088) Schema validation fails with same name sequences in different schemas

Alex CD (JIRA) jira at hibernate.atlassian.net
Fri Jun 26 15:35:43 EDT 2020


Alex CD ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A9b0f6d49-bc76-4aca-875b-c8525b2f039d ) *updated* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMjEwZTlmMmZlYzFjNDQxMWI4NDcyMWFiN2E4YWZlNjYiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-14088?atlOrigin=eyJpIjoiMjEwZTlmMmZlYzFjNDQxMWI4NDcyMWFiN2E4YWZlNjYiLCJwIjoiaiJ9 ) HHH-14088 ( https://hibernate.atlassian.net/browse/HHH-14088?atlOrigin=eyJpIjoiMjEwZTlmMmZlYzFjNDQxMWI4NDcyMWFiN2E4YWZlNjYiLCJwIjoiaiJ9 ) Schema validation fails with same name sequences in different schemas ( https://hibernate.atlassian.net/browse/HHH-14088?atlOrigin=eyJpIjoiMjEwZTlmMmZlYzFjNDQxMWI4NDcyMWFiN2E4YWZlNjYiLCJwIjoiaiJ9 )

Change By: Alex CD ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A9b0f6d49-bc76-4aca-875b-c8525b2f039d )

Using multiple schemas with same name sequences but different parameters.
I use a default schema name, but the sequence information extractor retrieves all sequences and database information is initialized with sequences devoid of schema name in the order received from the extractor.
So if the result is a sequence from default schema followed by the same sequence from another schema, it will be overwritten with invalid information from another schema.

Extractor uses [select * from information_schema.sequences|https://github.com/hibernate/hibernate-orm/blob/604b594226355dc789586c40f1eee241aca259b5/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL81Dialect.java#L245-L247] to get all sequences disregarding any default schema configuration.

Then, DatabaseInformationImpl _DatabaseInformationImpl. java java_ populates sequenceInformationMap _sequenceInformationMap_ in order received from executing the above sql, removing schema qualifier and overwriting without any check. [source|https://github.com/hibernate/hibernate-orm/blob/604b594226355dc789586c40f1eee241aca259b5/hibernate-core/src/main/java/org/hibernate/tool/schema/extract/internal/DatabaseInformationImpl.java#L62-L78]

( https://hibernate.atlassian.net/browse/HHH-14088#add-comment?atlOrigin=eyJpIjoiMjEwZTlmMmZlYzFjNDQxMWI4NDcyMWFiN2E4YWZlNjYiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14088#add-comment?atlOrigin=eyJpIjoiMjEwZTlmMmZlYzFjNDQxMWI4NDcyMWFiN2E4YWZlNjYiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100130- sha1:d095cd6 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200626/f6773dd6/attachment.html 


More information about the hibernate-issues mailing list