Skip to content

Commit d001b6a

Browse files
committed
Fix pgsql tests
1 parent 7ae628a commit d001b6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/pgsql/tests/01createdb.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ PostgreSQL create db
99
include('config.inc');
1010

1111
$db = pg_connect($conn_str);
12-
if (!@pg_num_rows(@pg_query($db, "SELECT * FROM ".$table_name)))
12+
if (!($q = @pg_query($db, "SELECT * FROM ".$table_name)) || !@pg_num_rows($q))
1313
{
1414
pg_query($db,$table_def); // Create table here
1515
for ($i=0; $i < $num_test_record; $i++) {
@@ -21,7 +21,7 @@ else {
2121
}
2222

2323
$v = pg_version();
24-
if (version_compare($v['server'], '9.2', '>=') && !@pg_num_rows(@pg_query($db, "SELECT * FROM ".$table_name_92)))
24+
if (version_compare($v['server'], '9.2', '>=') && (!($q = @pg_query($db, "SELECT * FROM ".$table_name_92)) || !@pg_num_rows($q)))
2525
{
2626
pg_query($db,$table_def_92); // Create table here
2727
}

0 commit comments

Comments
 (0)