mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
NEQ does not work on Postgres with bool field. #5735
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 @dekey on GitHub (Oct 9, 2017).
Originally assigned to: @lcobucci on GitHub.
Hi. I have a table contact with bool field on
Postgres9.6When I try to create query builder for this table with condition
not equalto trueGot next SQL:
SELECT i0_.id AS id_0 FROM contact i0_ WHERE i0_.unsubscribed <> true;The main problem that condition
<>does not work with boolean field. Instead of<>on Postgres is using conditionIS NOT TRUE.I know that I could use native query, but in some cases I can`t use it. I would like to know your comments about.
Thank you in advance.
@lcobucci commented on GitHub (Oct 9, 2017):
@dekey it sounds like a bug, could you please send us a failing test case that reproduces that behaviour? It would help us a lot to identify and fix the issue you're describing (also to ensure it works on different platforms).
You can find examples on
388afb46d0/tests/Doctrine/Tests/ORM/Functional/Ticket@dekey commented on GitHub (Oct 16, 2017):
Hi @lcobucci. Have added test
https://github.com/doctrine/doctrine2/pull/6775
@lcobucci commented on GitHub (Oct 16, 2017):
@dekey awesome, thanks!
I'll take a look on it ASAP =)
@mateuszsip commented on GitHub (Oct 22, 2017):
Hi guys,
I took a look at code to think how it could be handled, but I don't see any existing implementation handling query differences like this one.
Did I miss something?
Should
Doctrine\DBAL\Query\Expression\ExpressionBuilderget a platform-specific override support using injectedConnection? What about filed type? Issue is boolean specific.Is it worth potential complexity gain?
Would love to help, but don't know internals enough.
@lcobucci commented on GitHub (Nov 26, 2017):
As explained on #6775 this is a DBAL issue and so I'll be closing this ticket as
invalid. We should move the test and find a fix for it on https://github.com/doctrine/dbal instead.