Merge branch '2.2' into develop

This commit is contained in:
Johan Wikman
2018-05-02 10:45:59 +03:00
2 changed files with 8 additions and 6 deletions

View File

@ -329,7 +329,7 @@ namespace
struct EVENT_TIMES_CB_DATA struct EVENT_TIMES_CB_DATA
{ {
int rowno; int rowno;
Worker::STATISTICS* stats; Worker::STATISTICS stats;
}; };
} }
@ -372,10 +372,10 @@ eventTimesRowCallback(RESULTSET *set, void *v)
resultset_row_set(row, 0, buf); resultset_row_set(row, 0, buf);
} }
snprintf(buf, 39, "%u", data->stats->qtimes[data->rowno]); snprintf(buf, 39, "%u", data->stats.qtimes[data->rowno]);
buf[39] = '\0'; buf[39] = '\0';
resultset_row_set(row, 1, buf); resultset_row_set(row, 1, buf);
snprintf(buf, 39, "%u", data->stats->exectimes[data->rowno]); snprintf(buf, 39, "%u", data->stats.exectimes[data->rowno]);
buf[39] = '\0'; buf[39] = '\0';
resultset_row_set(row, 2, buf); resultset_row_set(row, 2, buf);
data->rowno++; data->rowno++;
@ -398,10 +398,8 @@ eventTimesGetList()
return NULL; return NULL;
} }
Worker::STATISTICS s = Worker::get_statistics();
data->rowno = 0; data->rowno = 0;
data->stats = &s; data->stats = Worker::get_statistics();
if ((set = resultset_create(eventTimesRowCallback, data)) == NULL) if ((set = resultset_create(eventTimesRowCallback, data)) == NULL)
{ {

View File

@ -834,6 +834,10 @@ sessionRowCallback(RESULTSET *set, void *data)
row = cbdata->row; row = cbdata->row;
cbdata->row = NULL; cbdata->row = NULL;
} }
else
{
MXS_FREE(cbdata);
}
return row; return row;
} }