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

Closed
opened 2026-01-22 14:34:03 +01:00 by admin · 2 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:03 +01:00
admin closed this issue 2026-01-22 14:34:03 +01:00
Author
Owner

@doctrinebot commented on GitHub (Aug 18, 2014):

Comment created by @ocramius:

This is a type-conversion issue that depends on how you are dealing with your data. The ORM has nothing to do with it.

@doctrinebot commented on GitHub (Aug 18, 2014): Comment created by @ocramius: This is a type-conversion issue that depends on how you are dealing with your data. The ORM has nothing to do with it.
Author
Owner

@doctrinebot commented on GitHub (Aug 18, 2014):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Aug 18, 2014): Issue was closed with resolution "Invalid"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4030