Skip to content

where-query with multi-level assocication restriction produces wrong result in simple unit spec #14622

Closed

Description

@zyro23

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. check sample app
  2. run unit tests

Expected Behaviour

QuerySpec should pass just like HibernateQuerySpec does

Actual Behaviour

Condition not satisfied:

words.size() == 4
|     |      |
|     2      false
[querytest.Word : 1, querytest.Word : 2]

Expected :4

Actual   :2

at querytest.QuerySpec.test where query with multi-level association restriction(QuerySpec.groovy:49)

Environment Information

  • Grails Version: 3.2.6
  • GORM Version: 6.0.7

Example Application

  • sample app will be referenced in a minute

Activity

  1. jamesfredley commented on Feb 26, 2026

    @jamesfredley
    Contributor

    This was reported against GORM 6.0.7 / Grails 3.2.6. The where-query association handling has been significantly reworked in Grails 7.x, including:

    • Alias creation for joined associations is now automatic (ddae6ee)
    • DetachedCriteria join handling has been fixed (03747c5)
    • The DetachedCriteriaTransformer has received multiple fixes for nested property resolution

    If you are still experiencing this issue on Grails 7.x, please reopen with a minimal reproducer against the current version.

  2. jamesfredley commented on Jul 24, 2026

    @jamesfredley
    Contributor

    Thanks for the original multilevel-association reproducer. The exact sentence, phrase, and word where query is now covered by WhereQueryIssueVerificationSpec. The regression landed through PR #15460, shipped in Grails 7.0.8, and remains in current 8.0.x. Closing this as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions