From:             jeremy at jongsma dot org
Operating system: Debian testing/unstable
PHP version:      5.1.2
PHP Bug Type:     PostgreSQL related
Bug description:  pg_query_params not converting boolean false values correctly

Description:
------------
pg_query_params seems to be converting boolean "false" parameters to an
empty string before sending the query to Postgres, resulting in the
following error:

ERROR: invalid input syntax for type boolean: ""

Reproduce code:
---------------
Create a table:

CREATE TABLE test (id serial8, flag boolean);

Execute this php script:

<?php
$conn = pg_connect('host=localhost dbname=test user=user password=pass');
pg_query_params($conn, 'INSERT INTO test (flag) VALUES ($1)',
array(false));
?>



Expected result:
----------------
A new row should be inserted with the correct boolean field value.

Actual result:
--------------
ERROR: invalid input syntax for type boolean: ""

-- 
Edit bug report at http://bugs.php.net/?id=37031&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37031&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=37031&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37031&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37031&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37031&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37031&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37031&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37031&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37031&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37031&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37031&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37031&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37031&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37031&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37031&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37031&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37031&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37031&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37031&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37031&r=mysqlcfg

Reply via email to