summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-10-09 16:43:59 +0200
committerSergei Golubchik <serg@mariadb.org>2015-10-09 16:43:59 +0200
commit16c4b3c68b06653592a9500050ad977a38f4ebae (patch)
tree9c26da00fe119d92efd3792987c3790d7d0fb409 /client
parentf41a41fd912af97bc2703d3fcec8d1a294bef023 (diff)
downloadmariadb-git-16c4b3c68b06653592a9500050ad977a38f4ebae.tar.gz
fixes for buildbot:mariadb-5.5.46
* OSX (mysqlimport freeing unallocated memory) * Windows (didn't compile MSI) * fulltest2 (innodb crashes in --embedded --big)
Diffstat (limited to 'client')
-rw-r--r--client/mysqlimport.c7
1 files changed, 6 insertions, 1 deletions
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);