Code

mysql plugin: Use `strlen ("Table_locks_")' rather than `12'.
authorFlorian Forster <octo@huhu.verplant.org>
Thu, 23 Apr 2009 07:35:46 +0000 (09:35 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Thu, 23 Apr 2009 07:35:46 +0000 (09:35 +0200)
src/mysql.c

index ca364b6c5f2fc67af4c24dcd265cf5c1c6ef4074..b700ff02edc1596e41f5015d93397b284c2c2d70 100644 (file)
@@ -794,12 +794,12 @@ static int mysql_read (user_data_t *ud)
                        else if (strcmp (key, "Threads_created") == 0)
                                threads_created = val;
                }
-               else if (strncmp (key, "Table_locks_", 12) == 0)
+               else if (strncmp (key, "Table_locks_",
+                                       strlen ("Table_locks_")) == 0)
                {
-                       if (val == 0ULL)
-                               continue;
-
-                       counter_submit ("mysql_locks", key + 12, val, db);
+                       counter_submit ("mysql_locks",
+                                       key + strlen ("Table_locks_"),
+                                       val, db);
                }
        }
        mysql_free_result (res); res = NULL;