helly Mon Mar 13 22:56:20 2006 UTC
Added files: (Branch: PHP_5_1)
/php-src/ext/pgsql/tests 80_bug36625.phpt
Modified files:
/php-src/ext/pgsql pgsql.c
Log:
- bug #36625 fix
http://cvs.php.net/viewcvs.cgi/php-src/ext/pgsql/pgsql.c?r1=1.331.2.9&r2=1.331.2.10&diff_format=u
Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.331.2.9 php-src/ext/pgsql/pgsql.c:1.331.2.10
--- php-src/ext/pgsql/pgsql.c:1.331.2.9 Sun Mar 5 13:35:52 2006
+++ php-src/ext/pgsql/pgsql.c Mon Mar 13 22:56:20 2006
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql.c,v 1.331.2.9 2006/03/05 13:35:52 tony2001 Exp $ */
+/* $Id: pgsql.c,v 1.331.2.10 2006/03/13 22:56:20 helly Exp $ */
#include <stdlib.h>
@@ -2360,7 +2360,7 @@
RETURN_FALSE;
}
- if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void**)fp,
REPORT_ERRORS)) {
+ if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO,
(void**)&fp, REPORT_ERRORS)) {
php_stream_close(stream);
RETURN_FALSE;
}
http://cvs.php.net/viewcvs.cgi/php-src/ext/pgsql/tests/80_bug36625.phpt?view=markup&rev=1.1
Index: php-src/ext/pgsql/tests/80_bug36625.phpt
+++ php-src/ext/pgsql/tests/80_bug36625.phpt
--TEST--
Bug #36625 (pg_trace() does not work)
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
require_once('config.inc');
$dbh = @pg_connect($conn_str);
if (!$dbh) {
die ('Could not connect to the server');
}
$tracefile = dirname(__FILE__) . '/trace.tmp';
@unlink($tracefile);
var_dump(file_exists($tracefile));
pg_trace($tracefile, 'w', $dbh);
$res = pg_query($dbh, 'select 1');
var_dump($res);
pg_close($dbh);
$found = 0;
function search_trace_file($line)
{
if (strpos($line, '"select 1"') !== false || strpos($line, "'select
1'") !== false) {
$GLOBALS['found']++;
}
}
$trace = file($tracefile);
array_walk($trace, 'search_trace_file');
var_dump($found > 0);
var_dump(file_exists($tracefile));
?>
===DONE===
--CLEAN--
<?php unlink($tracefile); ?>
--EXPECTF--
bool(false)
resource(%d) of type (pgsql result)
bool(true)
bool(true)
===DONE===
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php