php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34677 pg_insert with a wrong field value crashes php
Submitted: 2005-09-29 10:41 UTC Modified: 2005-10-07 01:00 UTC
From: ciprian at zuavra dot net Assigned:
Status: No Feedback Package: PostgreSQL related
PHP Version: 4.4.0 OS: Linux 2.6.12
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ciprian at zuavra dot net
New email:
PHP Version: OS:

 

 [2005-09-29 10:41 UTC] ciprian at zuavra dot net
Description:
------------
Using pg_insert() with a data array that offers a long integer (1125522000) for a table field which was supposed to be of type 'date'. PHP crashes instantly.

However, I cannot seem to reproduce this except in a rather complex closed source application.

Reproduce code:
---------------
$data = array(
 'project_id'=>122,
 'transaction_model_id' => 2,
 'status' => 'FINAL',
 'date_created' => 1125522000, //should be string in "date" format
 'i18n_id' => 339451,
 'unique_id' => 497263,
);
$res = pg_insert(DB,'table_name',$data);
echo 'it never gets here';

Expected result:
----------------
pg_insert() apparently doesn't produce any log message of any kind, ever. But I at least expected it to return false instead of crashing.

It's worth noting that 5.0.5 doesn't have this problem. In 5.0.5, pg_insert() returns false and the error can be picked up by the rest of the code.

However, 4.4.0 and 4.3.11 do have the problem.

Actual result:
--------------
Crash. I will try to provide a backtrace.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-29 10:57 UTC] sniper@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


 [2005-10-07 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 10:01:29 2024 UTC