From: Nikita Popov Date: Tue, 4 Jun 2019 10:18:21 +0000 (+0200) Subject: Try to make 17result.php more robust X-Git-Tag: php-7.4.0alpha1~96 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f7210efa83dab59a49c582c850d5c541c9cd869;p=php Try to make 17result.php more robust This is our most common intermittent failure. I don't understand why it happens and can't reproduce it, but defining an explicit sort order seems worth a shot... --- diff --git a/ext/pgsql/tests/08escape.phpt b/ext/pgsql/tests/08escape.phpt index 9120b455e7..6b0d1899d4 100644 --- a/ext/pgsql/tests/08escape.phpt +++ b/ext/pgsql/tests/08escape.phpt @@ -43,13 +43,13 @@ $db = pg_connect($conn_str); // Insert binary to DB $escaped_data = pg_escape_bytea($data); -pg_query("DELETE FROM ".$table_name." WHERE num = -9999;"); -$sql = "INSERT INTO ".$table_name." (num, bin) VALUES (-9999, CAST ('".$escaped_data."' AS BYTEA));"; +pg_query("DELETE FROM ".$table_name." WHERE num = 10000;"); +$sql = "INSERT INTO ".$table_name." (num, bin) VALUES (10000, CAST ('".$escaped_data."' AS BYTEA));"; pg_query($db, $sql); // Retrieve binary from DB for ($i = 0; $i < 2; $i++) { - $sql = "SELECT bin::bytea FROM ".$table_name." WHERE num = -9999"; + $sql = "SELECT bin::bytea FROM ".$table_name." WHERE num = 10000"; $result = pg_query($db, $sql); $row = pg_fetch_array($result, 0, PGSQL_ASSOC); diff --git a/ext/pgsql/tests/17result.phpt b/ext/pgsql/tests/17result.phpt index 4e321ca3f8..e5e630d0fd 100644 --- a/ext/pgsql/tests/17result.phpt +++ b/ext/pgsql/tests/17result.phpt @@ -10,7 +10,7 @@ include 'config.inc'; $db = pg_connect($conn_str); -$sql = "SELECT * FROM $table_name"; +$sql = "SELECT * FROM $table_name ORDER BY num"; $result = pg_query($db, $sql) or die('Cannot query db'); $rows = pg_num_rows($result);