From 2e0b98f08bbca77cba504301e3943cc7af1f3442 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 3 Mar 2020 11:29:41 -0500 Subject: [PATCH] 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 --- medmysql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/medmysql.c b/medmysql.c index 1e7e253..126a7c5 100644 --- a/medmysql.c +++ b/medmysql.c @@ -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;