DDC-949: strange behavior with boolean types when using findOneBy() in a CLI phpunit test #5478

Closed
doctrinebot opened this Issue Dec 25, 2010 · 9 comments

2 participants

@doctrinebot

Jira issue originally created by user @lsmith77:

I do not see this behavior when running findByOne() calls via the Apache SAPI. No clue really what could possibly cause this. Not sure how to get the error logger to output something in a phpunit test (never really figured out how phpunit supports debugging). Essentially if I run the tests with SQLite the case with 'false' fails and when I run with PostgreSQL the case with 0 fails. Essentially in the fail case I get an instance of $this, just like when I pass: false.

Tell me if this report is useless in the current state and then I will work on separating it out into a standalone CLI script without Symfony2 and phpunit. But I dont want to spend more time on this if it isnt necessary.

@doctrinebot

Comment created by @beberlei:

Cannot reproduce.

@doctrinebot

Comment created by @beberlei:

Attached simpler testcase for reproduce.

@doctrinebot

Comment created by @lsmith77:

further testing shows this issue only exists with false and there I can reproduce it on the CLI and via apache. it seems I am hitting: http://bugs.php.net/bug.php?id=33876
however the issue also happens with sqlite for the same reason false gets casted to an empty string when not telling PDO explicitly to handle the parameter as a boolean.

@doctrinebot

Comment created by @lsmith77:

as explained in the previous comment, the issue is caused by "false" and not by "true" as in the test case.

@doctrinebot

Comment created by @beberlei:

Fixed.

This issue occured, because BasicEntityPersister did not pass the PARAM: typehints to the DBAL connection.

Adding this fixes the issue with Booleans on PostgreSQL, however I just realized it also exists for Oracle OCI and needs an adjustment in DBAL to be fixable.

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot

Comment created by @lsmith77:

I am also seeing the issue with SQLite.

@doctrinebot

Comment created by @lsmith77:

ok .. i can confirm the issue is fixed on sqlite and postgresql

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.0.1 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment