Closed dependabot[bot] closed 1 year ago
@gastaldi Something that I noticed while trying to write a reproducer: your application uses the json
type for the platform.metadata
column, but recent versions of Hibernate ORM expect the type jsonb
. And, critically, you won't have that error when using the jsonb
column type.
As a workaround, and perhaps just a migration step, I'd recommend you move to jsonb
.
I'll continue working on a reproducer and report to the ORM team.
@yrodiere unfortunately changing the column to jsonb
is not a valid workaround. It gives:
Caused by: org.postgresql.util.PSQLException: ERROR: column "p4_0.platform_stream_id" must appear in the GROUP BY clause or be used in an aggregate function
Position: 468
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2713)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2401)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:368)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:498)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:415)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:190)
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:134)
at io.agroal.pool.wrapper.PreparedStatementWrapper.executeQuery(PreparedStatementWrapper.java:78)
at org.hibernate.sql.results.jdbc.internal.DeferredResultSetAccess.executeQuery(DeferredResultSetAccess.java:239)
It produces the following SQL:
SELECT p1_0.id,
p1_0.bom,
p1_0.created_at,
p1_0.member_boms,
p1_0.metadata,
p1_0.pinned,
p1_0.platform_stream_id,
p1_0.quarkus_core_version,
p1_0.unlisted,
p1_0.upstream_quarkus_core_version,
p1_0.version,
p1_0.version_sortable
FROM platform_release p1_0
JOIN platform_stream p2_0 ON p2_0.id=p1_0.platform_stream_id
JOIN platform p3_0 ON p3_0.id=p2_0.platform_id
WHERE p1_0.unlisted=FALSE
AND p3_0.platform_type='C'
AND (p1_0.platform_stream_id,
p1_0.version_sortable) in
(SELECT p4_0.platform_stream_id,
max(p4_0.version_sortable)
FROM platform_release p4_0
JOIN platform_stream p5_0 ON p5_0.id=p4_0.platform_stream_id
WHERE p5_0.unlisted=FALSE
AND p4_0.unlisted=FALSE
GROUP BY p5_0.id,
p5_0.created_at,
p5_0.metadata,
p5_0.name,
p5_0.pinned,
p5_0.platform_id,
p5_0.stream_key,
p5_0.stream_key_sortable,
p5_0.unlisted)
ORDER BY p1_0.version_sortable DESC,
p3_0.is_default DESC
@gastaldi Is this with the same HQL, i.e. this?
select pr from PlatformRelease pr
where pr.unlisted = false
and pr.platformStream.platform.platformType = 'C'
and (pr.platformStream, pr.versionSortable) in
(
select pr2.platformStream, max(pr2.versionSortable) from PlatformRelease pr2
where pr2.platformStream.unlisted = false
and pr2.unlisted = false
group by pr2.platformStream
)
order by pr.versionSortable desc, pr.platformStream.platform.isDefault desc
If so that looks like a bug...
Regardless, you could also try to avoid using associations in the query where you only need the ID, i.e. something like this (might need adjustment, I didn't try it):
select pr from PlatformRelease pr
where pr.unlisted = false
and pr.platformStream.platform.platformType = 'C'
and (pr.platformStream.id, pr.versionSortable) in
(
select pr2.platformStream.id, max(pr2.versionSortable) from PlatformRelease pr2
where pr2.platformStream.unlisted = false
and pr2.unlisted = false
group by pr2.platformStream.id
)
order by pr.versionSortable desc, pr.platformStream.platform.isDefault desc
@yrodiere ah good idea, that seems to work, I've pushed a commit with your suggestion and the tests passed.
Bumps
quarkus.version
from 3.1.0.Final to 3.1.1.Final. Updatesquarkus-bom
from 3.1.0.Final to 3.1.1.FinalRelease notes
Sourced from quarkus-bom's releases.
... (truncated)
Commits
481b0b7
[RELEASE] - Bump version to 3.1.1.Finald68dd00
Merge pull request #33853 from gsmet/3.1.1-backports-26b50326
Register PGobject subtypes for reflection04b2b8e
Update Jackson to 2.15.2 in independent-projects15dcca8
set jackson-bom version to 2.15.2cbe6b53
Bump apicurio-registry.version from 2.4.2.Final to 2.4.3.Finalb3866a1
Bump kotlinx-serialization-json from 1.5.0 to 1.5.17552b20
Redis Hostname provider - do not call getHosts() twice226ff97
Fix Dev UI v1 link in the guides1bf7e7f
Only expose the Dev UI Routes if Vert.x HTTP is presentUpdates
quarkus-ide-config
from 3.1.0.Final to 3.1.1.FinalRelease notes
Sourced from quarkus-ide-config's releases.
... (truncated)
Commits
481b0b7
[RELEASE] - Bump version to 3.1.1.Finald68dd00
Merge pull request #33853 from gsmet/3.1.1-backports-26b50326
Register PGobject subtypes for reflection04b2b8e
Update Jackson to 2.15.2 in independent-projects15dcca8
set jackson-bom version to 2.15.2cbe6b53
Bump apicurio-registry.version from 2.4.2.Final to 2.4.3.Finalb3866a1
Bump kotlinx-serialization-json from 1.5.0 to 1.5.17552b20
Redis Hostname provider - do not call getHosts() twice226ff97
Fix Dev UI v1 link in the guides1bf7e7f
Only expose the Dev UI Routes if Vert.x HTTP is presentUpdates
quarkus-maven-plugin
from 3.1.0.Final to 3.1.1.FinalDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)