hibernate / hibernate-reactive

A reactive API for Hibernate ORM, supporting non-blocking database drivers and a reactive style of interaction with the database.
https://hibernate.org/reactive
Apache License 2.0
441 stars 92 forks source link

JPQL did not translated to SQL correctly when using Window Functions #1957

Closed anaconda875 closed 1 month ago

anaconda875 commented 3 months ago

Models:

@Entity
@Data
//This is main entity
public class Collection {

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;

  private String name;

  @OneToMany(mappedBy = "belongsTo", cascade = CascadeType.ALL)
  @OrderBy("id desc")
  private List<Vocabulary> vocabularies;

  @OneToMany(mappedBy = "collection")
  private List<CollectionAccess> collectionAccesses;

  @CreatedDate protected LocalDateTime createdAtUtc;
  @CreatedBy protected UUID createdBy;
  @LastModifiedDate protected LocalDateTime lastModifiedAtUtc;
  @LastModifiedBy protected UUID lastModifiedBy;
}

@Entity
@Data
public class Vocabulary {

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;

  //Other fields

}

@Entity
@Data
public class CollectionAccess {

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;

  private Integer accessType; //1 means public
  private LocalDateTime expirationAtUtc;

  //Other field
}

Our goal: Find Collection(s) that:

Since there is/are join fetch here, so Hibernate will do limit/offset in memory. To avoid that, a tweak need to be done using Window Function (see this)

Our JPQL:

SELECT c FROM Collection c 
  LEFT JOIN FETCH c.vocabularies v --(3)
WHERE c.id IN (
    SELECT id FROM (
        SELECT 
          cc.id AS id, 
          dense_rank() over (
            order by 
              id asc
          ) AS ranking 
        FROM Collection cc 
        WHERE 
          UPPER(name) LIKE ?1 --(0)
          AND (
            createdBy = ?2 --(1)
            OR EXISTS (
              SELECT 1 FROM CollectionAccess ca 
              WHERE ca.collection.id = id 
                AND ca.accessType = : accessType --(2)
                AND ca.expirationAtUtc <= : expirationAtUtc --just check expiration
            )
          )
      ) pr 
    WHERE 
      ranking >= : offset 
      AND ranking <= : until --(4)
  ) 
order by 
  c.id asc

This JPQL can run, but did not return anything, and I found out the reason.
This is native SQL generated by Hibernate:

    select
        c1_0.id,
        c1_0.created_at_utc,
        c1_0.created_by,
        c1_0.description,
        c1_0.image_id,
        c1_0.image_name,
        c1_0.image_url,
        c1_0.language,
        c1_0.last_modified_at_utc,
        c1_0.last_modified_by,
        c1_0.name,
        c1_0.owner_id,
        c1_0.persistable_status,
        v1_0.collection_id,
        v1_0.id,
        v1_0.created_at_utc,
        v1_0.created_by,
        v1_0.last_modified_at_utc,
        v1_0.last_modified_by,
        v1_0.owner_id,
        v1_0.persistable_status,
        v1_0.vocabulary 
    from
        collection c1_0 
    left join
        vocabulary v1_0 
            on c1_0.id=v1_0.collection_id 
    where
        c1_0.id in (select
            pr1_0.id 
        from
            (select
                c2_0.id id, dense_rank() over(
            order by
                c2_0.id) ranking 
            from
                collection c2_0 
            where
                upper(c2_0.name) like replace(?, '\\', '\\\\') 
                and (c2_0.created_by=? 
                or exists(select
                    1 id 
                from
                    collection_access ca1_0 
                where
                    ca1_0.collection_id=ca1_0.id --WRONG HERE
                    and ca1_0.access_type=? 
                    and ca1_0.expiration_at_utc<=?))) pr1_0 
        where
            pr1_0.ranking>=? 
            and pr1_0.ranking<=?) 
    order by
        c1_0.id,
        v1_0.id desc

The where ca1_0.collection_id=ca1_0.id is WRONG. It should be where ca1_0.collection_id=c2_0.id or just where ca1_0.collection_id=id We also tried some small tweak and hope that Hibernate would generate correct SQL:

SELECT c FROM Collection c 
  LEFT JOIN FETCH c.vocabularies v 
WHERE c.id IN (
    SELECT id FROM (
        SELECT 
          cc.id AS id, 
          dense_rank() over (
            order by 
              id asc
          ) AS ranking 
        FROM Collection cc 
        WHERE 
          UPPER(name) LIKE ?1 
          AND (
            createdBy = ?2 
            OR EXISTS (
              SELECT 1 FROM CollectionAccess ca 
              WHERE 
                ca.collection.id = cc.id --FIX HERE: change ca.collection.id = id to ca.collection.id = cc.id
                AND ca.accessType = : accessType 
                AND ca.expirationAtUtc <= : expirationAtUtc
            )
          )
      ) pr 
    WHERE 
      ranking >= : offset 
      AND ranking <= : until
  ) 
order by 
  c.id asc

But we got an error:

Caused by: org.hibernate.query.SemanticException: Could not interpret path expression 'cc.id'
    at org.hibernate.query.hql.internal.BasicDotIdentifierConsumer$BaseLocalSequencePart.resolvePathPart(BasicDotIdentifierConsumer.java:255) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.BasicDotIdentifierConsumer.consumeIdentifier(BasicDotIdentifierConsumer.java:91) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitSimplePath(SemanticQueryBuilder.java:5060) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitIndexedPathAccessFragment(SemanticQueryBuilder.java:5009) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitGeneralPathFragment(SemanticQueryBuilder.java:4984) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitGeneralPathExpression(SemanticQueryBuilder.java:1776) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$GeneralPathExpressionContext.accept(HqlParser.java:7699) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:46) ~[antlr4-runtime-4.13.0.jar:4.13.0]
    at org.hibernate.grammars.hql.HqlParserBaseVisitor.visitBarePrimaryExpression(HqlParserBaseVisitor.java:756) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$BarePrimaryExpressionContext.accept(HqlParser.java:7157) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.createComparisonPredicate(SemanticQueryBuilder.java:2430) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitComparisonPredicate(SemanticQueryBuilder.java:2392) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitComparisonPredicate(SemanticQueryBuilder.java:269) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$ComparisonPredicateContext.accept(HqlParser.java:6164) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitAndPredicate(SemanticQueryBuilder.java:2261) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitAndPredicate(SemanticQueryBuilder.java:269) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$AndPredicateContext.accept(HqlParser.java:6039) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitAndPredicate(SemanticQueryBuilder.java:2261) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitAndPredicate(SemanticQueryBuilder.java:269) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$AndPredicateContext.accept(HqlParser.java:6039) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitWhereClause(SemanticQueryBuilder.java:2244) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitWhereClause(SemanticQueryBuilder.java:269) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$WhereClauseContext.accept(HqlParser.java:5905) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitQuery(SemanticQueryBuilder.java:1159) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitQuerySpecExpression(SemanticQueryBuilder.java:941) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitQuerySpecExpression(SemanticQueryBuilder.java:269) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$QuerySpecExpressionContext.accept(HqlParser.java:1869) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitSimpleQueryGroup(SemanticQueryBuilder.java:926) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitSimpleQueryGroup(SemanticQueryBuilder.java:269) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$SimpleQueryGroupContext.accept(HqlParser.java:1740) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitSubquery(SemanticQueryBuilder.java:4931) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitSubqueryExpression(SemanticQueryBuilder.java:4911) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitSubqueryExpression(SemanticQueryBuilder.java:269) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$SubqueryExpressionContext.accept(HqlParser.java:7326) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitExistsPredicate(SemanticQueryBuilder.java:2677) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitExistsPredicate(SemanticQueryBuilder.java:269) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$ExistsPredicateContext.accept(HqlParser.java:6015) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitOrPredicate(SemanticQueryBuilder.java:2271) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitOrPredicate(SemanticQueryBuilder.java:269) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$OrPredicateContext.accept(HqlParser.java:6255) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitGroupedPredicate(SemanticQueryBuilder.java:2252) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitGroupedPredicate(SemanticQueryBuilder.java:269) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$GroupedPredicateContext.accept(HqlParser.java:6084) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitAndPredicate(SemanticQueryBuilder.java:2262) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitAndPredicate(SemanticQueryBuilder.java:269) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$AndPredicateContext.accept(HqlParser.java:6039) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitWhereClause(SemanticQueryBuilder.java:2244) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitWhereClause(SemanticQueryBuilder.java:269) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$WhereClauseContext.accept(HqlParser.java:5905) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitQuery(SemanticQueryBuilder.java:1159) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitQuerySpecExpression(SemanticQueryBuilder.java:941) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitQuerySpecExpression(SemanticQueryBuilder.java:269) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$QuerySpecExpressionContext.accept(HqlParser.java:1869) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitSimpleQueryGroup(SemanticQueryBuilder.java:926) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitSimpleQueryGroup(SemanticQueryBuilder.java:269) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.grammars.hql.HqlParser$SimpleQueryGroupContext.accept(HqlParser.java:1740) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitSelectStatement(SemanticQueryBuilder.java:443) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.visitStatement(SemanticQueryBuilder.java:402) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.SemanticQueryBuilder.buildSemanticModel(SemanticQueryBuilder.java:311) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.hql.internal.StandardHqlTranslator.translate(StandardHqlTranslator.java:71) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.internal.QueryInterpretationCacheStandardImpl.createHqlInterpretation(QueryInterpretationCacheStandardImpl.java:165) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.query.internal.QueryInterpretationCacheStandardImpl.resolveHqlInterpretation(QueryInterpretationCacheStandardImpl.java:147) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.internal.AbstractSharedSessionContract.interpretHql(AbstractSharedSessionContract.java:790) ~[hibernate-core-6.4.4.Final.jar:6.4.4.Final]
    at org.hibernate.reactive.session.impl.ReactiveSessionImpl.createReactiveQuery(ReactiveSessionImpl.java:368) ~[hibernate-reactive-core-2.2.2.Final.jar:2.2.2.Final]
    at org.hibernate.reactive.stage.impl.StageSessionImpl.createQuery(StageSessionImpl.java:517) ~[hibernate-reactive-core-2.2.2.Final.jar:2.2.2.Final]
    at com.htech.vocab.repository.impl.CollectionRepositoryCustomImpl.getSelectionQuery(CollectionRepositoryCustomImpl.java:240) ~[classes/:na]
    at com.htech.vocab.repository.impl.CollectionRepositoryCustomImpl.buildQueryAndExecute(CollectionRepositoryCustomImpl.java:281) ~[classes/:na]
    at com.htech.vocab.repository.impl.CollectionRepositoryCustomImpl.lambda$findAllOwnedOrPublicIncludingAllMany$7(CollectionRepositoryCustomImpl.java:146) ~[classes/:na]
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:132) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoZip$ZipCoordinator.signal(MonoZip.java:297) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoZip$ZipInner.onNext(MonoZip.java:478) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:158) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onNext(FluxFilterFuseable.java:118) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.onNext(FluxMapFuseable.java:299) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2571) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.request(FluxOnAssembly.java:649) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.request(FluxOnAssembly.java:649) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.request(FluxMapFuseable.java:360) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.request(FluxOnAssembly.java:649) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.request(FluxFilterFuseable.java:191) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.request(FluxOnAssembly.java:649) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.request(MonoFlatMap.java:194) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.request(FluxOnAssembly.java:649) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:171) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.request(FluxOnAssembly.java:649) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:171) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.request(FluxOnAssembly.java:649) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:171) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.request(FluxOnAssembly.java:649) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoZip$ZipInner.onSubscribe(MonoZip.java:470) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onSubscribe(FluxOnAssembly.java:633) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:96) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onSubscribe(FluxOnAssembly.java:633) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:96) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onSubscribe(FluxOnAssembly.java:633) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:96) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onSubscribe(FluxOnAssembly.java:633) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:117) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onSubscribe(FluxOnAssembly.java:633) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxFilterFuseable$FilterFuseableSubscriber.onSubscribe(FluxFilterFuseable.java:87) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onSubscribe(FluxOnAssembly.java:633) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.onSubscribe(FluxMapFuseable.java:265) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onSubscribe(FluxOnAssembly.java:633) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onSubscribe(FluxOnAssembly.java:633) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:55) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoZip$ZipCoordinator.request(MonoZip.java:220) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.request(FluxOnAssembly.java:649) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.request(MonoFlatMap.java:194) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.request(FluxOnAssembly.java:649) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.request(MonoFlatMap.java:194) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.request(FluxOnAssembly.java:649) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.request(FluxUsingWhen.java:320) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.request(FluxOnAssembly.java:649) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2367) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onSubscribe(FluxOnErrorResume.java:74) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onSubscribe(FluxOnAssembly.java:633) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxUsingWhen$UsingWhenSubscriber.onSubscribe(FluxUsingWhen.java:407) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onSubscribe(FluxOnAssembly.java:633) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:117) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onSubscribe(FluxOnAssembly.java:633) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.onSubscribe(MonoFlatMap.java:117) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onSubscribe(FluxOnAssembly.java:633) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoZip.subscribe(MonoZip.java:129) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoUsingWhen.subscribe(MonoUsingWhen.java:87) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoUsingWhen.subscribe(MonoUsingWhen.java:87) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoUsingWhen$ResourceSubscriber.onNext(MonoUsingWhen.java:184) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:74) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondComplete(MonoFlatMap.java:245) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:305) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondComplete(MonoFlatMap.java:245) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:305) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondComplete(MonoFlatMap.java:245) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:305) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onNext(MonoPeekTerminal.java:180) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.complete(MonoIgnoreThen.java:293) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onNext(MonoIgnoreThen.java:188) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:237) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:204) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onComplete(FluxOnAssembly.java:549) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onComplete(MonoPeekTerminal.java:299) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onComplete(FluxOnAssembly.java:549) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onComplete(MonoPeekTerminal.java:299) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onComplete(FluxOnAssembly.java:549) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoIgnoreElements$IgnoreElementsSubscriber.onComplete(MonoIgnoreElements.java:89) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onComplete(FluxOnAssembly.java:549) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onComplete(FluxOnAssembly.java:549) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onComplete(Operators.java:2231) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onComplete(FluxOnAssembly.java:549) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondComplete(MonoFlatMap.java:246) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:305) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onNext(FluxOnAssembly.java:539) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.complete(MonoIgnoreThen.java:293) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onNext(MonoIgnoreThen.java:188) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:237) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:204) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onComplete(FluxOnAssembly.java:549) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoPeekTerminal$MonoTerminalPeekSubscriber.onComplete(MonoPeekTerminal.java:299) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onComplete(FluxOnAssembly.java:549) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:210) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:239) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:204) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onComplete(FluxOnAssembly.java:549) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:210) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onComplete(FluxOnAssembly.java:549) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onComplete(FluxOnAssembly.java:549) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoRunnable.subscribe(MonoRunnable.java:50) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:241) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onComplete(MonoIgnoreThen.java:204) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onComplete(FluxOnAssembly.java:549) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.FluxOnAssembly$OnAssemblySubscriber.onComplete(FluxOnAssembly.java:549) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.apply(MonoCompletionStage.java:125) ~[reactor-core-3.6.0.jar:3.6.0]
    at reactor.core.publisher.MonoCompletionStage$MonoCompletionStageSubscription.apply(MonoCompletionStage.java:67) ~[reactor-core-3.6.0.jar:3.6.0]
    at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934) ~[na:na]
    at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911) ~[na:na]
    at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[na:na]
    at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147) ~[na:na]
    at io.vertx.core.Future.lambda$toCompletionStage$3(Future.java:581) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.future.FutureImpl$4.onSuccess(FutureImpl.java:176) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.future.FutureImpl$ListenerArray.onSuccess(FutureImpl.java:310) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:66) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:259) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.future.PromiseImpl.onSuccess(PromiseImpl.java:49) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.future.PromiseImpl.handle(PromiseImpl.java:41) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.sqlclient.impl.TransactionImpl.lambda$wrap$0(TransactionImpl.java:72) ~[vertx-sql-client-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.future.FutureImpl$4.onSuccess(FutureImpl.java:176) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:60) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.ContextImpl.execute(ContextImpl.java:298) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.ContextImpl.execute(ContextImpl.java:288) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:57) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:259) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.future.PromiseImpl.onSuccess(PromiseImpl.java:49) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.future.PromiseImpl.handle(PromiseImpl.java:41) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.future.PromiseImpl.handle(PromiseImpl.java:23) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.mysqlclient.impl.MySQLSocketConnection.lambda$doSchedule$0(MySQLSocketConnection.java:109) ~[vertx-mysql-client-4.5.7.jar:4.5.7]
    at io.vertx.sqlclient.impl.command.CommandResponse.fire(CommandResponse.java:46) ~[vertx-sql-client-4.5.7.jar:4.5.7]
    at io.vertx.sqlclient.impl.SocketConnectionBase.handleMessage(SocketConnectionBase.java:324) ~[vertx-sql-client-4.5.7.jar:4.5.7]
    at io.vertx.mysqlclient.impl.MySQLSocketConnection.handleMessage(MySQLSocketConnection.java:124) ~[vertx-mysql-client-4.5.7.jar:4.5.7]
    at io.vertx.sqlclient.impl.SocketConnectionBase.lambda$init$0(SocketConnectionBase.java:137) ~[vertx-sql-client-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.ContextImpl.emit(ContextImpl.java:328) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.impl.ContextImpl.emit(ContextImpl.java:321) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.net.impl.NetSocketImpl.handleMessage(NetSocketImpl.java:388) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.net.impl.ConnectionBase.read(ConnectionBase.java:159) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:153) ~[vertx-core-4.5.7.jar:4.5.7]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.vertx.mysqlclient.impl.codec.MySQLEncoder.fireCommandResponse(MySQLEncoder.java:63) ~[vertx-mysql-client-4.5.7.jar:4.5.7]
    at io.vertx.mysqlclient.impl.codec.QueryCommandBaseCodec.handleAllResultsetDecodingCompleted(QueryCommandBaseCodec.java:175) ~[vertx-mysql-client-4.5.7.jar:4.5.7]
    at io.vertx.mysqlclient.impl.codec.QueryCommandBaseCodec.handleSingleResultsetDecodingCompleted(QueryCommandBaseCodec.java:136) ~[vertx-mysql-client-4.5.7.jar:4.5.7]
    at io.vertx.mysqlclient.impl.codec.SimpleQueryCommandCodec.handleInitPacket(SimpleQueryCommandCodec.java:51) ~[vertx-mysql-client-4.5.7.jar:4.5.7]
    at io.vertx.mysqlclient.impl.codec.QueryCommandBaseCodec.decodePayload(QueryCommandBaseCodec.java:56) ~[vertx-mysql-client-4.5.7.jar:4.5.7]
    at io.vertx.mysqlclient.impl.codec.MySQLDecoder.decodePackets(MySQLDecoder.java:69) ~[vertx-mysql-client-4.5.7.jar:4.5.7]
    at io.vertx.mysqlclient.impl.codec.MySQLDecoder.channelRead(MySQLDecoder.java:45) ~[vertx-mysql-client-4.5.7.jar:4.5.7]
    at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[netty-codec-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[netty-codec-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[netty-transport-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.101.Final.jar:4.1.101.Final]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.101.Final.jar:4.1.101.Final]
    at java.base/java.lang.Thread.run(Thread.java:857) ~[na:na]

Is it a bug or just an unsupported feature?

DavideD commented 3 months ago

It seems like a bug, I will have to check if it works using Hibernate ORM 6.5. Or maybe you have already tried?

anaconda875 commented 3 months ago

@DavideD thanks for your input. Those are we are using image

DavideD commented 3 months ago

have you tried Hibernate Reactive 2.3.1.Final?

anaconda875 commented 3 months ago

Let me try hibernate core 6.5 and Hibernate Reactive 2.3.1.Final and come back to you

anaconda875 commented 3 months ago

Tried but seems the issues still persist image

anaconda875 commented 3 months ago

Update: @DavideD This JPQL is translated to SQL correctly:

    SELECT id FROM (
        SELECT
          cc.id AS id,
          dense_rank() over (
            order by
              id asc
          ) AS ranking
        FROM Collection cc
        WHERE
          UPPER(name) LIKE ?1
          AND (
            createdBy = ?2
            OR EXISTS (
              SELECT 1 FROM CollectionAccess ca
              WHERE
                ca.collection.id = cc.id
                AND ca.accessType = : accessType
                AND ca.expirationAtUtc <= : expirationAtUtc
            )
          )
      ) pr
    WHERE
      ranking >= :offset
      AND ranking <= :until

Actually it is just a part of the whole/big query.
The translated:

    select
        pr1_0.id 
    from
        (select
            c1_0.id id,
            dense_rank() over(
        order by
            c1_0.id) ranking 
        from
            collection c1_0 
        where
            upper(c1_0.name) like replace(?, '\\', '\\\\') 
            and (
                c1_0.created_by=? 
                or exists(select
                    1 id 
                from
                    collection_access ca1_0 
                where
                    ca1_0.collection_id=c1_0.id 
                    and ca1_0.access_type=? 
                    and ca1_0.expiration_at_utc<=?)
            )) pr1_0 
    where
        pr1_0.ranking>=? 
        and pr1_0.ranking<=?
anaconda875 commented 1 month ago

@DavideD any update on that?###

DavideD commented 1 month ago

I've created this test case for Hibernate Reactive 2.4.2.Final and it seems to work fine.

select
        c1_0.id,
        c1_0.createdAtUtc,
        c1_0.createdBy,
        c1_0.lastModifiedAtUtc,
        c1_0.lastModifiedBy,
        c1_0.name,
        v1_0.belongsTo_id,
        v1_0.id 
    from
        Collection c1_0 
    left join
        Vocabulary v1_0 
            on c1_0.id=v1_0.belongsTo_id 
    where
        c1_0.id in (select
            pr1_0.id 
        from
            (select
                c2_0.id, dense_rank() over(
            order by
                c2_0.id) 
            from
                Collection c2_0 
            where
                upper(c2_0.name) like $1 escape '' 
                and (c2_0.createdBy=$2 
                or exists(select
                    1 
                from
                    CollectionAccess ca1_0 
                where
                    ca1_0.collection_id=c2_0.id 
                    and ca1_0.accessType=$3 
                    and ca1_0.expirationAtUtc<=$4))) pr1_0(id, ranking) 
        where
            pr1_0.ranking>=$5 
            and pr1_0.ranking<=$6) 
    order by
        c1_0.id,
        v1_0.id desc

So, I think this issues has been solved.

I'm going to close this issue but feel free to comment further if you have any doubts.