Error creating hibernate_sequence in MariaDB 10.3

Description

If information_schema.TABLES exists in hibernate_sequence of other databases, SequenceInformationExtractorMariaDBDatabaseImpl does not correctly extract the sequence information of the current database.

In hibernate 5.3.10, the application can start but does not create hibernate_sequence.

In hibernate 5.4.3, the application cannot be started.

demo: https://github.com/lyh8577/spring-boot-issue-16893-demo

Environment

MariaDB: 10.3
jdk: 11
spring-boot: 2.2.0.M4

Activity

Show:
Nathan Xu
December 13, 2019, 10:55 PM

I launched your demo spring boot app locally without any problem. I used mariadb locally. Maybe the new version of Hibernate has solved the issue?

Nathan Xu
December 13, 2019, 11:08 PM

So I guessed maybe your dbs contain different sequence names. There is a known bug that in such cases your error comes up. See .

During my testing of your demo, I started from empty dbs and found both sequence names are the same, i.e. ‘hibernate_sequence’. So I can launch it successfully.

Could you run the following SQL command to ensure whether the sequence names are different or not?

 

 

Nathan Xu
December 13, 2019, 11:44 PM

Now I understand. You modified the class of SequenceInformationExtractorMariaDBDatabaseImpl to make your app launched. Yeah, this ticket shares the same root cause with and you provided a solution. Thanks.

Nathan Xu
December 13, 2019, 11:54 PM

I found an easy fix to change getQuerySequencesString from

to

 

Nathan Xu
December 14, 2019, 1:09 AM

PR created at: . I tested by your demo app. Thanks.

Assignee

Nathan Xu

Reporter

lyh

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.3.10

Components

Affects versions

Priority

Major
Configure