]> granicus.if.org Git - php/commitdiff
Add explicit double cast
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 1 Sep 2020 09:42:05 +0000 (11:42 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 1 Sep 2020 10:25:38 +0000 (12:25 +0200)
Avoid precision warning.

ext/mysqlnd/mysqlnd_ps_codec.c

index c0b3d1d6ff2809fed25f4ea3beccf703407eed8e..e942f10faca299dbd9725fd8af2e447560748481 100644 (file)
@@ -636,7 +636,7 @@ mysqlnd_stmt_execute_prepare_param_types(MYSQLND_STMT_DATA * stmt, zval ** copie
                                  Check bug #52891 : Wrong data inserted with mysqli/mysqlnd when using bind_param, value > LONG_MAX
                                  We do transformation here, which will be used later when sending types. The code later relies on this.
                                */
-                               if (d > ZEND_LONG_MAX || d < ZEND_LONG_MIN) {
+                               if (d >= (double) ZEND_LONG_MAX || d < (double) ZEND_LONG_MIN) {
                                        stmt->send_types_to_server = *resend_types_next_time = 1;
                                        convert_to_string_ex(tmp_data);
                                } else {