[CONJ-1076] Bug when using sequence Created: 2023-05-05  Updated: 2023-09-01

Status: Open
Project: MariaDB Connector/J
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: KOH WEN YEN Assignee: Diego Dupin
Resolution: Unresolved Votes: 0
Labels: None
Environment:

MariaDb 11.1.0



 Description   

When using spring boot project using mariadb 10.6.11 there is no issue when create table with some custom sequence id using Hibernate. I noticed hibernate will use this query to capture new id and it is fine without error:
select nextval(seq_merchant_nextval) ;

When using 11.1.0 the query was different and casue error:
select next_val as id_val from seq_merchant_nextval for update;

Error summary: (conn=2246) Unknown column 'next_val' in 'field list'



 Comments   
Comment by Diego Dupin [ 2023-06-05 ]

second kind of command is when using TableGenerator, not SequenceStyleGenerator.
What version of hibernate do you use ? Have you set dialect to MariaDBDialect ?

Comment by KOH WEN YEN [ 2023-06-08 ]

The hibernate used wasa bind with spring boot 2.7.3, and the setting in application.yml is as follow: url: jdbc:mariadb://localhost:3307.

Generated at Thu Feb 08 03:20:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.