Skip to content
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

Open
wants to merge 2 commits into
base: 4.2.x
Choose a base branch
from

Conversation

nickvergessen
Copy link
Contributor

@nickvergessen nickvergessen commented Sep 24, 2024

Q A
Type bug
Fixed issues To-Be-Raised-If-Needed

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 of Doctrine\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?

@nickvergessen nickvergessen force-pushed the bugfix/noid/boolean-comparison-with-oracle branch from a06ad45 to acfc0d2 Compare September 24, 2024 09:23
@nickvergessen nickvergessen changed the title [WIP] Try testing boolean comparison using ParameterType [Need Help] Try testing boolean comparison using ParameterType Sep 24, 2024
@nickvergessen nickvergessen changed the title [Need Help] Try testing boolean comparison using ParameterType [Need Help] Testing boolean comparison using ParameterType Sep 24, 2024
@derrabus derrabus changed the base branch from 4.1.x to 4.2.x October 10, 2024 13:12
Copy link

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.
If you want to continue working on it, please leave a comment.

@github-actions github-actions bot added the Stale label Jan 21, 2025
@nickvergessen
Copy link
Contributor Author

I still need help on this 🫠

@nickvergessen
Copy link
Contributor Author

@morozov @greg0ire could one of you maybe help me with this?

@morozov
Copy link
Member

morozov commented Jan 21, 2025

@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?

@github-actions github-actions bot removed the Stale label Jan 22, 2025
@nickvergessen nickvergessen force-pushed the bugfix/noid/boolean-comparison-with-oracle branch from d4541e4 to 0fe6104 Compare January 22, 2025 05:48
@nickvergessen
Copy link
Contributor Author

I don't understand what problem you are trying to solve.

When you have a where condition with a columnA = false kind of check, the condition is not working correctly on PDO Oracle in our tests.

OCI8 passes

OK, but there were issues!
Tests: 3241, Assertions: 4573, Skipped: 566, Incomplete: 5.

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.

@morozov
Copy link
Member

morozov commented Jan 22, 2025

This is probably due to the bug in PDO_OCI (php/php-src#15182). I reopened it as php/pecl-database-pdo_oci#12.

@nickvergessen
Copy link
Contributor Author

Thanks for checking, I guess there is not a lot we can do then atm.
Would you want to merge the PR afterwards (or now with skipping it on PDO?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants