php.net |  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: -
Votes:4
Avg. Score:4.2 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:3 (100.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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-07-19 13:33 UTC] ravisen at mail dot ru
Description:
------------
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: ""

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 07:01:24 2019 UTC