com php-src: Try to make 17result.php more robust: ext/pgsql/tests/08escape.phpt ext/pgsql/tests/17result.phpt
| From: | Nikita Popov | Date: | Tue, 04 Jun 2019 10:18:21 +0000 |
| Subject: | com php-src: Try to make 17result.php more robust: ext/pgsql/tests/08escape.phpt ext/pgsql/tests/17result.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106546@lists.php.net to get a copy of this message | ||
Commit: 3f7210efa83dab59a49c582c850d5c541c9cd869
Author: Nikita Popov <nikita.ppv@gmail.com> Tue, 4 Jun 2019 12:18:21 +0200
Parents: 40f2cfe25852f7dba726801315c3ef43f3fde899
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3f7210efa83dab59a49c582c850d5c541c9cd869
Log:
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...
Changed paths:
M ext/pgsql/tests/08escape.phpt
M ext/pgsql/tests/17result.phpt
Diff:
diff --git a/ext/pgsql/tests/08escape.phpt b/ext/pgsql/tests/08escape.phpt
index 9120b45..6b0d189 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 4e321ca..e5e630d 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);