Bug #81586 [NEW]: PDO OCI binds boolean false as NULL

From: Date: Tue, 02 Nov 2021 17:50:38 +0000
Subject: Bug #81586 [NEW]: PDO OCI binds boolean false as NULL
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237517@lists.php.net to get a copy of this message
From:             morozov at tut dot by
Operating system: Linux
PHP version:      8.0.12
Package:          PDO OCI
Bug Type:         Bug
Bug description:PDO OCI binds boolean false as NULL

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
}


-- 
Edit bug report at https://bugs.php.net/bug.php?id=81586&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=81586&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=81586&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=81586&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=81586&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=81586&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=81586&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=81586&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=81586&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=81586&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=81586&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81586&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=81586&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=81586&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=81586&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=81586&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=81586&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=81586&r=mysqlcfg


Thread (6 messages)

« previous php.bugs (#237517) next »