Open mvorisek opened 9 months ago
I haven't tried it yet so I could be wrong, but this probably applies to pdo_odbc
, pdo_firebird
as well. The behavior when specifying PDO::PARAM_STR
in pdo_pgsql
is also a little uneasy.
It's midnight in Japan, so I'll check it tomorrow if I have time.
There is an RFC that is currently being voted on, if it is passed, pdo_oci
will no longer be bundled, so I would like to wait for the results of the RFC first.
I belive this issue is a bug thus it should be fixed in PHP 8.1+. The fix should be not long as oci8
is working correctly, probably a missed case/typo when converting an integer type when binding the param using the native driver.
I agree that it's probably a bug. However, I think the impact is too large for a change made in a patch version.
The current pdo_oci is designed to ignore all PARAM_TYPE
specifications. Fixing only the INT
case is half-hearted, and fixing everything will have too much of an impact.
Description
The following code:
Expected output:
As you can see,
oci8
binds the parameter with correct type, butpdo_oci
has a bug.pdo_oci
needs to be fixed as binding with incorrect type have implications as shown in the example ('04' = 4
is true, but'04' = '4'
is not).In other DBs (I tested MySQL, PostgreSQL, T-SQL/MSSQL) PDO seems to be honoring the bind type correctly.
Can be tested localy using Dockerized Oracle Database:
PHP Version
any
Operating System
any