Skip to content

Wrong query for selecting IDs for pagination #490

@StanislavUngr

Description

@StanislavUngr

There is a bug in query selecting IDs that are passed for query selecting paged items.

1st query = selecting count;
2nd query = selecting IDs that are selected in 3rd query ( using LIMIT ... OFFSET... )
3rd query = selecting items that are displayed

How to get to bug:

Lets say I have this query:

image

Entity\Gallery = media__gallery
Entity\Media = media__media
Entity\GalleryHasMedia = media__gallery_media

So basically what Im doing is selecting 'm' (Media) for displaying in paginated results.

The 2nd query thus should select not u0_id but m1_.id so it can be used in 3rd query in WHERE statement.

2nd query
image

What it does now is instead of filling WHERE with (m1.)_Media IDs its using (u0.)_UserGallery IDs...

3rd query
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions