From 16c4b3c68b06653592a9500050ad977a38f4ebae Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 9 Oct 2015 16:43:59 +0200 Subject: fixes for buildbot: * OSX (mysqlimport freeing unallocated memory) * Windows (didn't compile MSI) * fulltest2 (innodb crashes in --embedded --big) --- client/mysqlimport.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'client/mysqlimport.c') diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 1f047fdf4b3..a22774bc684 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -36,7 +36,7 @@ /* Global Thread counter */ -uint counter; +uint counter= 0; pthread_mutex_t counter_mutex; pthread_cond_t count_threshhold; @@ -482,6 +482,11 @@ static void safe_exit(int error, MYSQL *mysql) { if (error && ignore_errors) return; + + /* in multi-threaded mode protect from concurrent safe_exit's */ + if (counter) + pthread_mutex_lock(&counter_mutex); + if (mysql) mysql_close(mysql); -- cgit v1.2.1