com php-src: Don't use random mode in mysqli_query test: ext/mysqli/tests/mysqli_query.phpt

From: Date: Mon, 18 Mar 2019 15:58:49 +0000
Subject: com php-src: Don't use random mode in mysqli_query test: ext/mysqli/tests/mysqli_query.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-105219@lists.php.net to get a copy of this message
Commit: 967037bb8d52755b810b1c23403a93a6c3069251 Author: Nikita Popov <nikita.ppv@gmail.com> Mon, 18 Mar 2019 16:55:25 +0100 Parents: 2b9acd37f0a13572684dde80e3e56d5c1b2ec045 Branches: PHP-7.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=967037bb8d52755b810b1c23403a93a6c3069251 Log: Don't use random mode in mysqli_query test MYSQLI_ASYNC is also valid here, at least with mysqlnd.. Rather than using a random mode that is prone to failing once in a blue moon, use a fixed invalid value. Changed paths: M ext/mysqli/tests/mysqli_query.phpt Diff: diff --git a/ext/mysqli/tests/mysqli_query.phpt b/ext/mysqli/tests/mysqli_query.phpt index bfa703b..08145cd 100644 --- a/ext/mysqli/tests/mysqli_query.phpt +++ b/ext/mysqli/tests/mysqli_query.phpt @@ -94,12 +94,7 @@ require_once('skipifconnectfailure.inc'); printf("[012] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_free_result($res); - $valid = array(MYSQLI_USE_RESULT, MYSQLI_STORE_RESULT); - do { - $mode = mt_rand(-1000, 1000); - } while (in_array($mode, $valid)); - - if (false !== ($res = @mysqli_query($link, "SELECT id FROM test ORDER BY id", $mode))) + if (false !== ($res = @mysqli_query($link, "SELECT id FROM test ORDER BY id", 1234))) printf("[013] Invalid mode should return false got %s/%s, [%d] %s\n", gettype($res), (is_object($res)) ? 'object' : $res, mysqli_errno($link), mysqli_error($link));

« previous php.cvs (#105219) next »