DDC-3255: findOneBy return null even sql returns result #4028

Open
opened 2026-01-22 14:34:01 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Aug 15, 2014).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user nexik:

I have some nasty tables from some engineer project.
In tables there is temperature column with type varchar(255). Values in this column are from "0.000" to "99.000"

I try to get one object with findOneBy method but always get null

$repository->findOneBy(['temp' => 43]); will return null
$repository->findOneBy(['temp' => '43.000']) will return proper object

both option generate sql that return object (tested with symfony2 profiler an mysql server)

currently I'm using number_format function as workaround

Originally created by @doctrinebot on GitHub (Aug 15, 2014). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user nexik: I have some nasty tables from some engineer project. In tables there is temperature column with type varchar(255). Values in this column are from "0.000" to "99.000" I try to get one object with findOneBy method but always get null $repository->findOneBy(['temp' => 43]); will return null $repository->findOneBy(['temp' => '43.000']) will return proper object both option generate sql that return object (tested with symfony2 profiler an mysql server) currently I'm using number_format function as workaround
admin added the Bug label 2026-01-22 14:34:01 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4028