|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72621 pg_execute(): NULL Date converts to empty string
Submitted: 2016-07-19 13:33 UTC Modified: -
Avg. Score:4.4 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:3 (75.0%)
From: ravisen at mail dot ru Assigned:
Status: Open Package: PostgreSQL related
PHP Version: 7.0.8 OS: Centos 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ravisen at mail dot ru
New email:
PHP Version: OS:


 [2016-07-19 13:33 UTC] ravisen at mail dot ru
NULL Date converts to empty string

Test script:
/* SQL Table
CREATE TABLE t_lot_steps
  n_id_lot integer NOT NULL, 
  d_start date

$sql = 'INSERT INTO t_lot_steps( n_id_lot,  d_start )  VALUES ( $1, $2 ) ';
$bindsData = [ 1, null ];

$conn = pg_connect(...);
pg_prepare($conn, '', $sql);
pg_execute($conn, '', $bindsData);

Expected result:
Record added to the table

Actual result:
E_WARNING pg_execute(): Query failed: ERROR: invalid input syntax for type date: ""


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Oct 22 12:01:25 2020 UTC