TT#76900 use the appropriate SQL handler

Since medmysql_flush_med_str() takes the handler from the
_medmysql_batch_definition structure, the last retrieved insert ID must
also be taken from the same handler.

Change-Id: Ieaee3313d94cf41d8953591dd88a12e42be601d5
changes/30/38230/1
Richard Fuchs 5 years ago
parent 6b2f7411a7
commit 2e0b98f08b

@ -1521,7 +1521,7 @@ static int medmysql_flush_cdr_batch(struct medmysql_cdr_batch *batch) {
return -1;
}
unsigned long long auto_id = mysql_insert_id(cdr_handler->m);
unsigned long long auto_id = mysql_insert_id((*batch->cdrs.def->handler_ptr)->m);
if (!auto_id) {
L_CRITICAL("Received zero auto-ID from SQL");
return -1;

Loading…
Cancel
Save