diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2018-09-19 11:31:42 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-09-19 12:27:31 +0200 |
commit | c614dd677c99e14ac6afb25d7bfe02cfa8cf1981 (patch) | |
tree | aa8687558c2e1876f5a52b0f5af7b15648e86a9c /ext/mysqli/tests | |
parent | 294fb83ee84b76479a62e4ed37d5523c1208ad7c (diff) | |
download | php-git-c614dd677c99e14ac6afb25d7bfe02cfa8cf1981.tar.gz |
Fix intermittent failures in mysqli_stmt_bind_result_format.phpt
There were two distinct issues here:
* $trend was compared against 'NULL' using !=, which does not work
as intended in the case where $trend==0.0.
* current_targets was declared as double(17,0), which means that
the fractional part was rounded, so that the same comparison in
SQL (rounded) and in PHP (not rounded) did not necessarily
match.
Please don't write mt_rand based tests, it takes ages to debug this
crap...
Diffstat (limited to 'ext/mysqli/tests')
-rw-r--r-- | ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt b/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt index dee5a7e0f0..8a1e9b16c0 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_result_format.phpt @@ -208,11 +208,11 @@ memory_limit=83886080 if (mysqli_query($link, "CREATE TABLE `test` ( `targetport` int(11) NOT NULL default '0', `sources` double(17,4) default NULL, - `current_sources` double(17,0) default NULL, + `current_sources` double(17,4) default NULL, `reports` double(17,4) default NULL, - `current_reports` double(17,0) default NULL, + `current_reports` double(17,4) default NULL, `targets` double(17,4) default NULL, - `current_targets` double(17,0) default NULL, + `current_targets` double(17,4) default NULL, `maxsources` int(11) default NULL, `maxtargets` int(11) default NULL, `maxreports` int(11) default NULL, @@ -237,7 +237,7 @@ memory_limit=83886080 printf("[301] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); break 2; } - if ($current_targets > 0 && $trend != 'NULL') + if ($current_targets > 0 && $trend !== 'NULL') $values[$trend] = $i; } krsort($values); |