TT#52964 suppress stray warning when no MySQL acc records are found

Change-Id: Ib795ee8d9b4c99d8abb09c09390d0bfac35c597d
(cherry picked from commit d6f58ed4ca)
changes/76/27376/1
Richard Fuchs 8 years ago
parent 9f08c66e3a
commit 2a311295b2

@ -305,7 +305,7 @@ int main(int argc, char **argv)
gettimeofday(&tv_start, NULL);
#endif
if(medmysql_fetch_records(&(mysql_callids[i]), &mysql_records, &mysql_rec_count) != 0)
if(medmysql_fetch_records(&(mysql_callids[i]), &mysql_records, &mysql_rec_count, 1) != 0)
goto out;
if(medredis_fetch_records(&(mysql_callids[i]), &redis_records, &redis_rec_count) == 0
@ -366,7 +366,7 @@ int main(int argc, char **argv)
if(medredis_fetch_records(&(redis_callids[i]), &redis_records, &redis_rec_count) != 0)
goto out;
if(medmysql_fetch_records(&(redis_callids[i]), &mysql_records, &mysql_rec_count) == 0
if(medmysql_fetch_records(&(redis_callids[i]), &mysql_records, &mysql_rec_count, 0) == 0
&& mysql_rec_count)
{
redis_records = realloc(redis_records, (mysql_rec_count + redis_rec_count) * sizeof(med_entry_t));

@ -543,7 +543,7 @@ out:
/**********************************************************************/
int medmysql_fetch_records(med_callid_t *callid,
med_entry_t **entries, uint64_t *count)
med_entry_t **entries, uint64_t *count, int warn_empty)
{
MYSQL_RES *res;
MYSQL_ROW row;
@ -575,8 +575,9 @@ int medmysql_fetch_records(med_callid_t *callid,
*count = mysql_num_rows(res);
if(*count == 0)
{
L_CRITICAL("No records found for callid '%s'!",
callid->value);
if (warn_empty)
L_CRITICAL("No records found for callid '%s'!",
callid->value);
ret = -1;
goto out;
}

@ -36,7 +36,7 @@ struct medmysql_call_stat_info_t {
int medmysql_init();
void medmysql_cleanup();
med_callid_t *medmysql_fetch_callids(uint64_t *count);
int medmysql_fetch_records(med_callid_t *callid, med_entry_t **entries, uint64_t *count);
int medmysql_fetch_records(med_callid_t *callid, med_entry_t **entries, uint64_t *count, int warn_empty);
int medmysql_trash_entries(const char *callid, struct medmysql_batches *);
int medmysql_backup_entries(const char *callid, struct medmysql_batches *);
int medmysql_delete_entries(const char *callid, struct medmysql_batches *);

Loading…
Cancel
Save