php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #71023
Patch dpoole-nowrap-for-mysqlnd-uint64-decrement-or-increment revision 2015-12-04 05:46 UTC by damian dot poole at netregistry dot com dot au
Patch dpoole-nowrap-for-mysqlnd-uint64 revision 2015-12-04 05:41 UTC by damian dot poole at netregistry dot com dot au

Patch dpoole-nowrap-for-mysqlnd-uint64-decrement-or-increment for MySQL related Bug #71023

Patch version 2015-12-04 05:46 UTC

Return to Bug #71023 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

Developer: damian.poole@netregistry.com.au

--- mysqlnd_statistics.h.old	2015-12-04 15:59:55.000000000 +1100
+++ mysqlnd_statistics.h	2015-12-04 16:00:38.000000000 +1100
@@ -61,22 +61,25 @@
 
 #define MYSQLND_DEC_STATISTIC(enabler, stats, statistic) \
  { \
-	enum_mysqlnd_collected_stats _s = (statistic);\
-	MYSQLND_STATS * _p_s = (MYSQLND_STATS *) (stats); \
-	if ((enabler) && _p_s && _s != _p_s->count) { \
-		MYSQLND_UPDATE_VALUE_AND_CALL_TRIGGER(_p_s, _s, -1); \
-	}\
+        enum_mysqlnd_collected_stats _s = (statistic);\
+        MYSQLND_STATS * _p_s = (MYSQLND_STATS *) (stats); \
+        if ((enabler) && _p_s && _s != _p_s->count && (_p_s)->values[(_s)] != 0) { \
+                MYSQLND_UPDATE_VALUE_AND_CALL_TRIGGER(_p_s, _s, -1); \
+        }\
  }
 
+
+
 #define MYSQLND_INC_STATISTIC(enabler, stats, statistic) \
  { \
-	enum_mysqlnd_collected_stats _s = (statistic);\
-	MYSQLND_STATS * _p_s = (MYSQLND_STATS *) (stats); \
-	if ((enabler) && _p_s && _s != _p_s->count) { \
-		MYSQLND_UPDATE_VALUE_AND_CALL_TRIGGER(_p_s, _s, 1); \
-	}\
+        enum_mysqlnd_collected_stats _s = (statistic);\
+        MYSQLND_STATS * _p_s = (MYSQLND_STATS *) (stats); \
+        if ((enabler) && _p_s && _s != _p_s->count && (_p_s)->values[(_s)] != UINT64_MAX) { \
+                MYSQLND_UPDATE_VALUE_AND_CALL_TRIGGER(_p_s, _s, 1); \
+        }\
  }
 
+
 #define MYSQLND_INC_STATISTIC_W_VALUE(enabler, stats, statistic, value) \
  { \
 	enum_mysqlnd_collected_stats _s = (statistic);\
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 04:01:28 2024 UTC