Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: PHPDriver
-
Labels:None
-
Environment:
CUBRID 8.4.1.6004, Windows 7 64 bit, PHP 8.4.1.0006
Description
Create the following test table in demodb database:
CREATE TABLE Teste(Coloana NUMERIC(18,2));
Here is the test.php code:
<?php
$conn = cubrid_connect("localhost", 33000, "demodb", "dba", "");
if ($conn) {
$sql = "INSERT INTO Teste(Coloana) VALUES(?)";
$req = cubrid_prepare($conn, $sql);
cubrid_bind($req, 1, null, "null");
cubrid_execute($req);
}
?>
Here it says for NULL to put NULL:
http://php.net/manual/en/function.cubrid-bind.php
The error obtained is:
Warning: cubrid_bind(): Bind value type unknown : null in C:\Users\user\Desktop\Bug\test.php on line 7
Same issue happens with either value "null","NULL" or NULL. It works only if you put cubrid_bind($req, 1, null, "string") or cubrid_bind($req, 1, null, "numeric"). If this is the correct behaviour the documentation needs to be fixed as from it users understand to put NULL or "NULL".

Analysis:
In CCI, CCI_U_TYPE_UNKNOWN == CCI_U_TYPE_NULL == 0, so when the type is 0, php driver consider it as a unknown type and failed.
Fix in Trunk, revision: 1347
Fix in RB-8.4.1, revision: 1348
Fix in RB-8.4.3, revision: 1349
Fix in RB-8.4.4, revision: 1350