summaryrefslogtreecommitdiff
path: root/ext/pgsql
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-06-04 12:18:21 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-06-04 12:18:21 +0200
commit3f7210efa83dab59a49c582c850d5c541c9cd869 (patch)
treec1fc92d5e1d0af4ec98e825efc32f3020d0d30bc /ext/pgsql
parent40f2cfe25852f7dba726801315c3ef43f3fde899 (diff)
downloadphp-git-3f7210efa83dab59a49c582c850d5c541c9cd869.tar.gz
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...
Diffstat (limited to 'ext/pgsql')
-rw-r--r--ext/pgsql/tests/08escape.phpt6
-rw-r--r--ext/pgsql/tests/17result.phpt2
2 files changed, 4 insertions, 4 deletions
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);