|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesdpoole-nowrap-for-mysqlnd-uint64-decrement-or-increment (last revision 2015-12-04 05:46 UTC by damian dot poole at netregistry dot com dot au)dpoole-nowrap-for-mysqlnd-uint64 (last revision 2015-12-04 05:41 UTC by damian dot poole at netregistry dot com dot au) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-08-05 13:35 UTC] cmb@php.net
-Status: Open
+Status: Verified
[2021-08-05 13:35 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 15:00:01 2025 UTC |
Description: ------------ Some of the connection statistics for the MySQL native driver (namely active_connections/ active persistent connections) can decrement past zero causing the statistic to wrap around to the max value of the type. The attached patch fixes it for us as it stops the macros which increment/decrement from wrapping around. Test script: --------------- <?php $mysqli = mysqli_init(); $mysqli->real_connect('1.2.3.4'); //non existant server $stats = mysqli_get_client_stats(); var_dump($stats['active_connections']); Expected result: ---------------- Warning: mysqli::real_connect(): (HY000/2002): Connection refused in /websites/ph/php70.damo.id.au/mysql.php on line 3 string(2) "0" --- next run --- Warning: mysqli::real_connect(): (HY000/2002): Connection refused in /websites/ph/php70.damo.id.au/mysql.php on line 3 string(2) "0" Actual result: -------------- Warning: mysqli::real_connect(): (HY000/2002): Connection refused in /websites/ph/php70.damo.id.au/mysql.php on line 3 string(20) "18446744073709551615" --- next run --- Warning: mysqli::real_connect(): (HY000/2002): Connection refused in /websites/ph/php70.damo.id.au/mysql.php on line 3 string(20) "18446744073709551614"