DDC-3672: After update to 2.5.0 we need left join to order correctly with pagination #4512

Open
opened 2026-01-22 14:43:36 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Apr 7, 2015).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user xguiga:

Before update to 2.5.0 I had follow code working:

$qb = $this->_em->createQueryBuilder()->select('customer')->from('Test\Entity\Customer', 'customer');
$qb->addOrderBy('customer.person', 'ASC');
$paginator = new Paginator($query);
var_dump($paginator->getIterator());

As workaround I had to add:

$qb->leftJoin('customer.person', 'person');
// and update orderBy to
$qb->addOrderBy('person.id', 'ASC');
Originally created by @doctrinebot on GitHub (Apr 7, 2015). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user xguiga: Before update to 2.5.0 I had follow code working: ``` $qb = $this->_em->createQueryBuilder()->select('customer')->from('Test\Entity\Customer', 'customer'); $qb->addOrderBy('customer.person', 'ASC'); $paginator = new Paginator($query); var_dump($paginator->getIterator()); ``` As workaround I had to add: ``` $qb->leftJoin('customer.person', 'person'); // and update orderBy to $qb->addOrderBy('person.id', 'ASC'); ```
admin added the Bug label 2026-01-22 14:43:36 +01:00
Author
Owner

@doctrinebot commented on GitHub (Apr 7, 2015):

Comment created by @ocramius:

Does ORDER BY IDENTITY(customer.person) work?

@doctrinebot commented on GitHub (Apr 7, 2015): Comment created by @ocramius: Does `ORDER BY IDENTITY(customer.person)` work?
Author
Owner

@doctrinebot commented on GitHub (Apr 7, 2015):

Comment created by xguiga:

Nop, same error..
Sorry, I don't tell you the error

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'c0*.person*id' in 'order clause'
@doctrinebot commented on GitHub (Apr 7, 2015): Comment created by xguiga: Nop, same error.. Sorry, I don't tell you the error ``` SQLSTATE[42S22]: Column not found: 1054 Unknown column 'c0*.person*id' in 'order clause' ```
Author
Owner

@doctrinebot commented on GitHub (Apr 7, 2015):

Comment created by stof:

[~ocramius] Looks like we are still missing a bunch of functional tests for the pagination

@doctrinebot commented on GitHub (Apr 7, 2015): Comment created by stof: [~ocramius] Looks like we are still missing a bunch of functional tests for the pagination
Author
Owner

@doctrinebot commented on GitHub (Apr 7, 2015):

Comment created by @ocramius:

[~stof] yeah, a whole lot of them :-\

@doctrinebot commented on GitHub (Apr 7, 2015): Comment created by @ocramius: [~stof] yeah, a whole lot of them :-\
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4512