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

 ID:               51609
 Updated by:       fel...@php.net
 Reported by:      cbandy at jbandy dot com
 Summary:          pg_copy_to: Invalid results when using fourth
                   parameter
-Status:           Open
+Status:           Closed
 Type:             Bug
 Package:          PostgreSQL related
 Operating System: Linux
 PHP Version:      5.3.2
-Assigned To:      
+Assigned To:      felipe

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:
------------------------------------------------------------------------
[2010-04-20 16:11:55] fel...@php.net

Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=298218
Log: - Fixed bug #51609 (pg_copy_to: Invalid results when using fourth
parameter)

------------------------------------------------------------------------
[2010-04-20 02:41:27] cbandy at jbandy dot com

Description:
------------
When passing four arguments to pg_copy_to(), the resulting data is
corrupted.



My guess is that pg_null_as is being freed improperly. A similar pointer
is freed conditionally within pg_copy_from().



Could be related to segfault in bug 35168.

Test script:
---------------
// setup

pg_query($db, 'CREATE TEMP TABLE temp_test_table (a INT)');

pg_query($db, 'INSERT INTO temp_test_table VALUES (1)');



// success

var_dump(pg_copy_to($db, 'temp_test_table'));



// success

var_dump(pg_copy_to($db, 'temp_test_table', "\t"));



// failure

var_dump(pg_copy_to($db, 'temp_test_table', "\t", "\\\\N"));





Expected result:
----------------
Three identical arrays:



array(1) {

  [0]=>

  string(2) "1

"

}

array(1) {

  [0]=>

  string(2) "1

"

}

array(1) {

  [0]=>

  string(2) "1

"

}

Actual result:
--------------
The third array is corrupted:



array(1) {

  [0]=>

  string(2) "1

"

}

array(1) {

  [0]=>

  string(2) "1

"

}

array(1) {

  [0]=>

  string(2) "@�"

}


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



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

Reply via email to