PHP  
 PHP_5_6
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/pgsql/tests/80_bug27597.phpt ('Bug #27597 (pg_fetch_array not returning false)')

Script

1: <?php
2:
3:
require_once(dirname(__FILE__) . '/config.inc');
4:     
5:
$dbh = @pg_connect($conn_str);
6: if (!
$dbh) {
7:     die (
"Could not connect to the server");
8: }
9:
10: @
pg_query("DROP TABLE id");
11:
pg_query("CREATE TABLE id (id INT)");
12:
13: for (
$i=0$i<4$i++) {
14:     
pg_query("INSERT INTO id (id) VALUES ($i)");
15: }
16:
17: function 
xi_fetch_array($res$type PGSQL_ASSOC) {
18:     
$a pg_fetch_array($resNULL$type) ;
19:     return 
$a ;    
20: }
21:
22:
$res pg_query("SELECT * FROM id");
23:
$i 0// endless-loop protection
24:
while($row xi_fetch_array($res)) {
25:     
print_r($row);
26:     if (
$i++ > 4) {
27:         echo 
"ENDLESS-LOOP";
28:         exit(
1);
29:     }
30: }
31:
32:
pg_close($dbh);
33:
34:
?>
35:
===DONE===
36:

Expected

Array
(
    [id] => 0
)
Array
(
    [id] => 1
)
Array
(
    [id] => 2
)
Array
(
    [id] => 3
)
===DONE===

Output

Warning: pg_query(): Query failed: ERROR:  relation "id" already exists in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug27597.php on line 11

Warning: pg_query(): Query failed: ERROR:  permission denied for relation id in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug27597.php on line 14

Warning: pg_query(): Query failed: ERROR:  permission denied for relation id in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug27597.php on line 14

Warning: pg_query(): Query failed: ERROR:  permission denied for relation id in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug27597.php on line 14

Warning: pg_query(): Query failed: ERROR:  permission denied for relation id in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug27597.php on line 14

Warning: pg_query(): Query failed: ERROR:  permission denied for relation id in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug27597.php on line 22

Warning: pg_fetch_array() expects parameter 1 to be resource, boolean given in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug27597.php on line 18
===DONE===

Diff

001+ Warning: pg_query(): Query failed: ERROR:  relation "id" already exists in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug27597.php on line 11
002+ 
003+ Warning: pg_query(): Query failed: ERROR:  permission denied for relation id in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug27597.php on line 14
004+ 
005+ Warning: pg_query(): Query failed: ERROR:  permission denied for relation id in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug27597.php on line 14
006+ 
007+ Warning: pg_query(): Query failed: ERROR:  permission denied for relation id in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug27597.php on line 14
008+ 
009+ Warning: pg_query(): Query failed: ERROR:  permission denied for relation id in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug27597.php on line 14
010+ 
011+ Warning: pg_query(): Query failed: ERROR:  permission denied for relation id in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug27597.php on line 22
012+ 
013+ Warning: pg_fetch_array() expects parameter 1 to be resource, boolean given in /var/php_gcov/PHP_5_6/ext/pgsql/tests/80_bug27597.php on line 18
001- Array
002- (
003-     [id] => 0
004- )
005- Array
006- (
007-     [id] => 1
008- )
009- Array
010- (
011-     [id] => 2
012- )
013- Array
014- (
015-     [id] => 3
016- )

 

Generated at Mon, 27 Nov 2017 05:04:32 +0000 (18 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.