mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
findAll doesn't return all the records #6401
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @secit-pl on GitHub (Feb 13, 2020).
Bug Report
I have strange problem. In one of my projects where I'm connecting with SQL Server findAll doesn't return all the records.
I have 4002 records in table.
count($repository->findAll()); // returns 3931
count($this->createQueryBuilder('duration')
->getEntityManager()
->getConnection()
->executeQuery('SELECT * FROM [TEST_DB].[dbo].[Test Journey Duration]')
->fetchAll()); // returns 4002
count($this->createQueryBuilder('duration')
->getEntityManager()
->createQuery('SELECT jd FROM App:Journey\Duration jd')
->getResult()); // returns 3931
The table is very simple, has no relations and contains only 5 columns: 3 x int, 2 x string
The stranger thing is that when I'm querying directly for the record which is not included in findAll using DQL
the record is returned with all data. The $repository->find(12915) also finds the entity.
@SenseException commented on GitHub (Feb 13, 2020):
What does the SQL query look like when you call
$repository->findAll()?@beberlei commented on GitHub (Feb 13, 2020):
@secit-pl did you maybe define the ID field on a column that is not actually unique?
@beberlei commented on GitHub (Sep 25, 2020):
No feedback here, closing for now.