Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HQL parser rejects INSERT … ON CONFLICT clause #3689

Open
jdupont22 opened this issue Nov 24, 2024 · 1 comment · May be fixed by #3691
Open

HQL parser rejects INSERT … ON CONFLICT clause #3689

jdupont22 opened this issue Nov 24, 2024 · 1 comment · May be fixed by #3691
Assignees
Labels
type: regression A regression from a previous release

Comments

@jdupont22
Copy link

Migrating from Spring Boot 3.3.5 to 3.4 lead to this error

The error

Caused by: org.springframework.data.jpa.repository.query.BadJpqlGrammarException: Line 4:8 mismatched input 'ON' expecting {, ','}; Bad JPQL grammar [
INSERT INTO AggregationPrice(range, price, type)
VALUES (:range, :price, :priceType)
ON CONFLICT (range) DO UPDATE
SET price = :price, type = :priceType
]

The code

@Modifying
@Query(
  """
    INSERT INTO AggregationPrice(range, price, type) 
    VALUES (:range, :price, :priceType) 
    ON CONFLICT (range) DO UPDATE 
    SET price = :price, type = :priceType 
  """
)
fun save(range: Range<LocalDateTime>, price: Double, priceType: AggregationPriceType)
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 24, 2024
@mp911de mp911de added type: regression A regression from a previous release and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 25, 2024
@mp911de
Copy link
Member

mp911de commented Nov 25, 2024

This is a regression. Specifically, the issue that we do not consider the conflict clause is becoming visible by eagerly parsing statements.

@mp911de mp911de self-assigned this Nov 26, 2024
@mp911de mp911de changed the title BadJpqlGrammarException 'ON' after lib upgrade HQL parser reject INSERT … ON CONFLICT clause Nov 26, 2024
@mp911de mp911de changed the title HQL parser reject INSERT … ON CONFLICT clause HQL parser rejects INSERT … ON CONFLICT clause Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: regression A regression from a previous release
Projects
None yet
3 participants