|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2014-07-24 10:21 UTC] rahulpriyadarshi@php.net
  [2014-07-25 08:38 UTC] b0kn16z at gmail dot com
  [2016-12-20 10:51 UTC] geisterpiraten at gmail dot com
 | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 17:00:02 2025 UTC | 
Description: ------------ Zend Server version: 6.3.0 (basic, build: 80622) PHP version: 5.5.7 PDO_IBM driver version: 1.3.3 Inserting a null value in a column with type date (also timestamp) with a prepared statement cause a PDOException with the following message: SQLSTATE[HY009]: Invalid use of null pointer: -99999 Fehler bei SQL Call Level Interface aufgetreten. (SQLBindParameter[-99999] at /patched-php-src-5.5.7/php-5.5.7/ext/pdo_ibm/ibm_statement.c:609) Same problem with the bindParam method. Inserting a null value in a character column with prepared statements works fine. Source code blow works properly with PHP 5.3.8 (Zend Sever 5.5.0) and PDO_IBM driver 1.3.2. "Direct" insert a null like $db->exec("INSERT INTO DUMMY(foo) VALUES(NULL)"); works fine. SQL-Trace: 00000018:236584 SQL CLI: SQLAllocHandle ( <Allocate Handle Type> , <Associated Handle> , <Generated Handle> ) 00000018:236584 SQL CLI: SQLAllocHandle INPUT: Allocate Handle Type: SQL_HANDLE_STMT 00000018:236592 SQL CLI: SQLAllocHandle INPUT: Associated Handle (CONN): 2 00000018:236592 SQL CLI: SQLAllocHandle OUTPUT: Generated Handle: 3 00000018:236592 SQL CLI: SQLAllocHandle DEBUG: MESSAGE: HANDLE ALLOCATED 00000018:236616 SQL CLI: SQLPrepare ( 3 , <SQL statement> , <statement len> ) 00000018:236616 SQL CLI: SQLPrepare INPUT: SQL statement: INSERT INTO xxxxxxx.DUMMY(foo) VALUES(?) 00000018:236616 SQL CLI: SQLPrepare INPUT: Statement len: 40 00000018:248976 SQL CLI: SQLNumResultCols ( 3 , SQLSMALLINT* ) 00000018:248976 SQL CLI: SQLGetInfo ( 2 , 18 , <Buffer val> , 30 , <Buffer len> ) 00000018:248992 SQL CLI: SQLGetInfo OUTPUT: Buffer val: 07010 00000018:248992 SQL CLI: SQLGetInfo OUTPUT: Buffer len: 6 00000018:249056 SQL CLI: SQLDescribeParam ( 3 , 1 , SQLSMALLINT* , SQLINTEGER* , SQLSMALLINT* , SQLSMALLINT* ) 00000018:249064 SQL CLI: SQLBindParameter ( 3 , 1 , 1 , 1 , 91 , 0 , 0 , SQLPOINTER, 0 , SQLINTEGER* ) 00000018:249208 SQL CLI: SQLGetDiagRec ( 3 , 3 , 1 , SQLCHAR* , SQLINTEGER* , SQLCHAR* , 512 , SQLSMALLINT* ) 00000018:249240 SQL CLI: SQLGetDiagField ( 3 , 3 , 1 , 13 , SQLPOINTER , 518 , SQLSMALLINT* ) 00000018:280520 SQL CLI: SQLFreeStmt ( 3 , 1 ) 00000018:280560 SQL CLI: SQLDisconnect ( 2 ) 00000018:280608 SQL CLI: SQLFreeHandle ( 2 , 2 ) 00000018:280808 SQL CLI: SQLFreeHandle ( 1 , 1 ) Test script: --------------- <?php error_reporting(-1); // CREATE TABLE DUMMY ( // id INT PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1 CYCLE), // foo DATE) $db = new PDO('ibm:SERVER', 'USER', 'PASS', array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::ATTR_EMULATE_PREPARES => false)); $stmt = $db->prepare("INSERT INTO xxxxxxx.DUMMY(foo) VALUES(:foo)"); $stmt->bindValue(':foo', null); $stmt->execute();