#34677 [NEW]: pg_insert with a wrong field value crashes php
| From: | ciprian at zuavra dot net | Date: | Thu, 29 Sep 2005 08:41:15 +0000 |
| Subject: | #34677 [NEW]: pg_insert with a wrong field value crashes php | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-85759@lists.php.net to get a copy of this message | ||
From: ciprian at zuavra dot net
Operating system: Linux 2.6.12
PHP version: 4.4.0
PHP Bug Type: Reproducible crash
Bug description: pg_insert with a wrong field value crashes php
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.
--
Edit bug report at http://bugs.php.net/?id=34677&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34677&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34677&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34677&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=34677&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=34677&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=34677&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=34677&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=34677&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=34677&r=support
Expected behavior: http://bugs.php.net/fix.php?id=34677&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=34677&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=34677&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=34677&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34677&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=34677&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=34677&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=34677&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=34677&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=34677&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=34677&r=mysqlcfg