php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81586 PDO OCI binds boolean false as NULL
Submitted: 2021-11-02 17:50 UTC Modified: 2024-07-31 15:34 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: morozov at tut dot by Assigned: cmb (profile)
Status: Duplicate Package: PDO OCI
PHP Version: 8.0.12 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: morozov at tut dot by
New email:
PHP Version: OS:

 

 [2021-11-02 17:50 UTC] morozov at tut dot by
Description:
------------
It looks like the extension doesn't implement any special handling of the PDO::PARAM_BOOL binding type which makes the logic of binding boolean values inconsistent with the rest of the PDO extensions.

Test script:
---------------
$conn = new PDO('oci:dbname=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=XE)))', 'system', 'oracle');
$stmt = $conn->prepare('SELECT ?, ? FROM DUAL');
$stmt->bindValue(1, true, PDO::PARAM_BOOL);
$stmt->bindValue(2, false, PDO::PARAM_BOOL);
$stmt->execute();


Expected result:
----------------
array(2) {
  [0] =>
  string(1) "1"
  [1] =>
  string(1) "0"
}


Actual result:
--------------
array(2) {
  [0] =>
  string(1) "1"
  [1] =>
  NULL
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2024-07-19 21:46 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2024-07-19 21:46 UTC] cmb@php.net
Is that still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions>
 [2024-07-24 23:57 UTC] morozov at tut dot by
-Status: Feedback +Status: Assigned
 [2024-07-24 23:57 UTC] morozov at tut dot by
Yes, it's reproducible on PHP 8.3.8.
 [2024-07-25 09:30 UTC] cmb@php.net
Then I suggest to report this at <https://github.com/php/php-src/issues>;
this old bug tracker might not get the best attention.
 [2024-07-31 15:21 UTC] morozov at tut dot by
Thank you. I reported it as https://github.com/php/php-src/issues/15182
 [2024-07-31 15:34 UTC] cmb@php.net
-Status: Assigned +Status: Duplicate
 [2024-07-31 15:34 UTC] cmb@php.net
Great.  Thank you!

I'm closing this as duplicate.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC