From cc9be1fc9055d73c835918ee15fc052bc6992397 Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Fri, 25 Sep 2015 15:39:23 +0200 Subject: [PATCH] MT#15397 - stats_handler uses autocommit=1 Change-Id: I48c791238fe2f6e482d0a9f8552f4e8c07f76d5a (cherry picked from commit 9df32db47e82e9634d83e191ed875b562f014da6) --- medmysql.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/medmysql.c b/medmysql.c index 2b84eb0..94b967e 100644 --- a/medmysql.c +++ b/medmysql.c @@ -111,6 +111,11 @@ int medmysql_init() syslog(LOG_CRIT, "Error setting reconnect-option for STATS db: %s", mysql_error(stats_handler)); goto err; } + if(mysql_autocommit(stats_handler, 1) != 0) + { + syslog(LOG_CRIT, "Error setting autocommit=1 for STATS db: %s", mysql_error(stats_handler)); + goto err; + } return 0; @@ -657,8 +662,6 @@ int medmysql_batch_start(struct medmysql_batches *batches) { return -1; if (mysql_query_wrapper(med_handler, "start transaction", 17)) return -1; - if (mysql_query_wrapper(stats_handler, "start transaction", 17)) - return -1; if (!med_call_stat_info_table) med_call_stat_info_table = g_hash_table_new_full(g_str_hash, g_str_equal, free, free); @@ -795,8 +798,6 @@ int medmysql_batch_end(struct medmysql_batches *batches) { return -1; if (mysql_query_wrapper(med_handler, "commit", 6)) return -1; - if (mysql_query_wrapper(stats_handler, "commit", 6)) - return -1; return 0; }