-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Need Help] Testing boolean comparison using ParameterType #6526
base: 4.2.x
Are you sure you want to change the base?
[Need Help] Testing boolean comparison using ParameterType #6526
Conversation
a06ad45
to
acfc0d2
Compare
There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
I still need help on this 🫠 |
@nickvergessen I don't understand what problem you are trying to solve. The tests you added look correct at a glance and all pass in my local setup on Oracle. The CI logs you're referring to are expired. Could you force-push your branch to have the CI run them again? |
Signed-off-by: Joas Schilling <[email protected]>
d4541e4
to
0fe6104
Compare
When you have a where condition with a OCI8 passes
PDO Oracle fails
There were 2 failures:
1) Doctrine\DBAL\Tests\Functional\Query\QueryBuilderBoolTest::testDeleteBooleanFalse
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
- 0 => 1
+ 0 => '1'
+ 1 => '2'
)
/home/runner/work/dbal/dbal/tests/Functional/Query/QueryBuilderBoolTest.php:94
2) Doctrine\DBAL\Tests\Functional\Query\QueryBuilderBoolTest::testDeleteBooleanFalseWithWrongType
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
- 0 => 1
+ 0 => '1'
+ 1 => '2'
)
/home/runner/work/dbal/dbal/tests/Functional/Query/QueryBuilderBoolTest.php:114
FAILURES!
Tests: 3233, Assertions: 4497, Failures: 2, Skipped: 594, Incomplete: 5. |
This is probably due to the bug in PDO_OCI (php/php-src#15182). I reopened it as php/pecl-database-pdo_oci#12. |
Thanks for checking, I guess there is not a lot we can do then atm. |
Summary
In Nextcloud we started to experience strange behaviour with Oracle when using boolean
FALSE
in WHERE-clauses with parameters.The behaviour works as expected, when as parameter type we pass
Doctrine\DBAL\Types\Types::BOOLEAN
instead ofDoctrine\DBAL\ParameterType::BOOLEAN
in our code base, but I think from the doc blocks and declarations this is not what should be done.This fix can also not be confirmed here using the 4.1.x branch as a base, but my test at least is failing with the same problem/bug: Using
false
in a where condition seems to not be possible?false
=> https://github.com/doctrine/dbal/actions/runs/12902066473/job/35975109513?pr=6526#step:6:750
=> https://github.com/doctrine/dbal/actions/runs/11011277241/job/30575035189?pr=6526#step:6:73