ID:               35168
 User updated by:  mdv at inyourpocket dot com
 Reported By:      mdv at inyourpocket dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         PostgreSQL related
 Operating System: Debian
 PHP Version:      5.0.5
 New Comment:

tested and OK

but when suplied optional arguments (3rd - delimiter, 4th -  null_as)
there aren't substitued to default values (delimiter = "\t", null_as =
'\N') - is right behavior ?

thank you


Previous Comments:
------------------------------------------------------------------------

[2005-11-09 11:41:31] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip



------------------------------------------------------------------------

[2005-11-09 11:17:17] mdv at inyourpocket dot com

Description:
------------
pg_copy_to($db, 'x', "\t", NULL) causes SIGSEGV

NULL should be default values ???

Reproduce code:
---------------
$db = pg_connect('host=localhost dbname=template1 user=postgres');

pg_copy_to($db, 'x', "\t", NULL);

Expected result:
----------------
should be rewrited to pg_copy_to($db, 'x', "\t", '\N');

read data from table

Actual result:
--------------
Starting program: /usr/local/php/bin/php -f x.php

Program received signal SIGSEGV, Segmentation fault.
0x08196665 in _efree (ptr=0x82b6564) at
/root/src/php-5.0.5/Zend/zend_alloc.c:282
282             REMOVE_POINTER_FROM_LIST(p);
(gdb) bt
#0  0x08196665 in _efree (ptr=0x82b6564) at
/root/src/php-5.0.5/Zend/zend_alloc.c:282
#1  0x080f4b42 in zif_pg_copy_to (ht=4, return_value=0x83c8e44,
this_ptr=0x0, return_value_used=0) at
/root/src/php-5.0.5/ext/pgsql/pgsql.c:2674
#2  0x081cad32 in zend_do_fcall_common_helper (execute_data=0xbfffd974,
opline=0x83c325c, op_array=0x83bedc4) at
/root/src/php-5.0.5/Zend/zend_execute.c:2760
#3  0x081d8c57 in zend_do_fcall_handler (execute_data=0xbfffd974,
opline=0x83c325c, op_array=0x83bedc4) at
/root/src/php-5.0.5/Zend/zend_execute.c:2894
#4  0x081c8662 in execute (op_array=0x83bedc4) at
/root/src/php-5.0.5/Zend/zend_execute.c:1437
#5  0x081aab93 in zend_execute_scripts (type=8, retval=Variable
"retval" is not available.
) at /root/src/php-5.0.5/Zend/zend.c:1064
#6  0x08175ecb in php_execute_script (primary_file=0xbffffd10) at
/root/src/php-5.0.5/main/main.c:1643
#7  0x081df4aa in main (argc=3, argv=0xbffffdc4) at
/root/src/php-5.0.5/sapi/cli/php_cli.c:946



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=35168&edit=1

Reply via email to