Skip to content

BUG: When changing SQLFilter parameter, resulting SQL query is not generated correctly#11694

Merged
greg0ire merged 1 commit intodoctrine:2.20.xfrom
dbannik:Bug-join-sql-when-change-sqlFilter-parameters
Oct 23, 2024
Merged

BUG: When changing SQLFilter parameter, resulting SQL query is not generated correctly#11694
greg0ire merged 1 commit intodoctrine:2.20.xfrom
dbannik:Bug-join-sql-when-change-sqlFilter-parameters

Conversation

@dbannik
Copy link
Copy Markdown
Contributor

@dbannik dbannik commented Oct 22, 2024

Is not correctly generated sql when changed/switched sqlFilter parameters

CachedPersisterContext::$selectJoinSql should be clear or regenerated when sqlFilter changed

The problem reproduce when in use fetch=EAGER and use additional sql filter on this property

@dbannik dbannik force-pushed the Bug-join-sql-when-change-sqlFilter-parameters branch from 6d81376 to b3735ef Compare October 22, 2024 16:22
@dbannik dbannik marked this pull request as ready for review October 22, 2024 16:28
@greg0ire
Copy link
Copy Markdown
Member

Please improve your commit message according to the contributing guide.

Most notably, please describe the bug, and explain how your changes address the issue.

@dbannik dbannik force-pushed the Bug-join-sql-when-change-sqlFilter-parameters branch 2 times, most recently from daad5e4 to 3717654 Compare October 22, 2024 19:32
@dbannik dbannik requested a review from greg0ire October 22, 2024 19:36
greg0ire
greg0ire previously approved these changes Oct 22, 2024
@dbannik dbannik force-pushed the Bug-join-sql-when-change-sqlFilter-parameters branch from 3717654 to 210ba6e Compare October 22, 2024 19:46
@dbannik dbannik requested a review from greg0ire October 22, 2024 20:19
SenseException
SenseException previously approved these changes Oct 22, 2024
@greg0ire
Copy link
Copy Markdown
Member

🤔 why is this targeting 2.21.x?

@dbannik
Copy link
Copy Markdown
Contributor Author

dbannik commented Oct 23, 2024

@greg0ire I don't know which branch to merge into
in my case, in version 2.19 and higher, this problem is present

@greg0ire
Copy link
Copy Markdown
Member

Take a look at #11208

…ters

CachedPersisterContext::$selectJoinSql should be clear or regenerated when sqlFilter changed
The problem reproduce when in use fetch=EAGER and use additional sql filter on this property
@dbannik dbannik force-pushed the Bug-join-sql-when-change-sqlFilter-parameters branch from 210ba6e to 439b4da Compare October 23, 2024 09:05
@dbannik dbannik changed the base branch from 2.21.x to 2.20.x October 23, 2024 09:05
@dbannik dbannik dismissed SenseException’s stale review October 23, 2024 09:05

The base branch was changed.

dbannik added a commit to dbannik/orm that referenced this pull request Oct 23, 2024
dbannik added a commit to dbannik/orm that referenced this pull request Oct 23, 2024
@dbannik dbannik mentioned this pull request Oct 23, 2024
@dbannik
Copy link
Copy Markdown
Contributor Author

dbannik commented Oct 23, 2024

@greg0ire I sent it to 2.20 and prepared fixes #11695 for 3.3 and higher

dbannik added a commit to dbannik/orm that referenced this pull request Oct 23, 2024
dbannik added a commit to dbannik/orm that referenced this pull request Oct 23, 2024
dbannik pushed a commit to dbannik/orm that referenced this pull request Jan 21, 2025
The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
dbannik pushed a commit to dbannik/orm that referenced this pull request Jan 27, 2025
The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
dbannik added a commit to dbannik/orm that referenced this pull request May 5, 2025
This fix takes into account the invalidation of the filter sql for SingleTablePersister and JoinedSubclassPersister
dbannik added a commit to dbannik/orm that referenced this pull request May 5, 2025
This fix takes into account the invalidation of the filter sql for SingleTablePersister and JoinedSubclassPersister
dbannik added a commit to dbannik/orm that referenced this pull request May 5, 2025
This fix takes into account the invalidation of the filter sql for SingleTablePersister and JoinedSubclassPersister
dbannik added a commit to dbannik/orm that referenced this pull request May 5, 2025
This fix takes into account the invalidation of the filter sql for SingleTablePersister and JoinedSubclassPersister
greg0ire added a commit that referenced this pull request May 6, 2025
#11931 Bug when change sql filter [Related issue #11694]
rotdrop added a commit to rotdrop/orm that referenced this pull request May 15, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request May 31, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Jun 24, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Jul 1, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Jul 5, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Jul 27, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Aug 27, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Aug 29, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Sep 10, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Oct 12, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Oct 23, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Nov 11, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Nov 19, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Nov 25, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Nov 29, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Dec 3, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Dec 16, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Dec 22, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Dec 31, 2025
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Jan 9, 2026
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
rotdrop added a commit to rotdrop/orm that referenced this pull request Feb 28, 2026
Previously, new aliases were allocated for each association, but the
index-by cache would just pick the first alias ever used. Fix this but
not allocating a new alias for an already used join-column. See also:

commit 6755bb0
Author: Bob van de Vijver <bobvandevijver@hotmail.com>
Date:   Wed Jan 8 10:38:23 2025 +0100

    Fix Hydration when use ManyToMany[indexBy]

    The bug related (doctrine#11694) and fixed mapping of sql column alias to field in entity (doctrine#11783) and
    invalidate cache [cache/persisted/entity|cache/persisted/collection] when sql filter changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants