X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmysql.c;h=029796e6c5045852f56a9fd60c39f36a517ce5d0;hb=2facdd7eef91949c1594f06703afeb6dd87e51cc;hp=db38a4b00cde26057aed301b3a22a67b1e144237;hpb=b66d5b90a0e59e943a61acb4b68ce55e88f08ade;p=collectd.git diff --git a/src/mysql.c b/src/mysql.c index db38a4b0..029796e6 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -65,9 +65,6 @@ typedef struct mysql_database_s mysql_database_t; /* }}} */ static int mysql_read (user_data_t *ud); -void mysql_read_default_options(struct st_mysql_options *options, - const char *filename, const char *group); - static void mysql_database_free (void *arg) /* {{{ */ { mysql_database_t *db; @@ -116,7 +113,7 @@ static int mysql_config_database (oconfig_item_t *ci) /* {{{ */ return (-1); } - db = (mysql_database_t *) malloc (sizeof (*db)); + db = malloc (sizeof (*db)); if (db == NULL) { ERROR ("mysql plugin: malloc failed."); @@ -898,8 +895,15 @@ static int mysql_read (user_data_t *ud) } else if (strncmp (key, "Sort_", strlen ("Sort_")) == 0) { - counter_submit ("mysql_sort", key + strlen ("Sort_"), - val, db); + if (strcmp (key, "Sort_merge_passes") == 0) + counter_submit ("mysql_sort_merge_passes", NULL, val, db); + else if (strcmp (key, "Sort_rows") == 0) + counter_submit ("mysql_sort_rows", NULL, val, db); + else if (strcmp (key, "Sort_range") == 0) + counter_submit ("mysql_sort", "range", val, db); + else if (strcmp (key, "Sort_scan") == 0) + counter_submit ("mysql_sort", "scan", val, db); + } } mysql_free_result (res); res = NULL;