summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorArun Kuruvila <arun.kuruvila@oracle.com>2016-06-02 15:02:46 +0530
committerArun Kuruvila <arun.kuruvila@oracle.com>2016-06-02 15:02:46 +0530
commit96d90250c66d9159522582a541c87e3c9d8b8d08 (patch)
treed139c7a964be9b8386a2836e73dfb7195ea890eb /client
parent5dc6a77b409291140e072470673589982a6623a2 (diff)
downloadmariadb-git-96d90250c66d9159522582a541c87e3c9d8b8d08.tar.gz
Bug#23035296: MAIN.MYSQLDUMP FAILS BECUASE OF UNEXPECTED
ERROR MESSAGE Post push patch to fix test case failure.
Diffstat (limited to 'client')
-rw-r--r--client/mysqlimport.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 3e8f694d96d..81eb5a37fde 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -30,6 +30,7 @@
/* Global Thread counter */
uint counter;
+pthread_mutex_t init_mutex;
pthread_mutex_t counter_mutex;
pthread_cond_t count_threshhold;
@@ -417,8 +418,13 @@ static MYSQL *db_connect(char *host, char *database,
MYSQL *mysql;
if (verbose)
fprintf(stdout, "Connecting to %s\n", host ? host : "localhost");
+ pthread_mutex_lock(&init_mutex);
if (!(mysql= mysql_init(NULL)))
+ {
+ pthread_mutex_unlock(&init_mutex);
return 0;
+ }
+ pthread_mutex_unlock(&init_mutex);
if (opt_compress)
mysql_options(mysql,MYSQL_OPT_COMPRESS,NullS);
if (opt_local_file)
@@ -623,6 +629,7 @@ int main(int argc, char **argv)
pthread_attr_setdetachstate(&attr,
PTHREAD_CREATE_JOINABLE);
+ pthread_mutex_init(&init_mutex, NULL);
pthread_mutex_init(&counter_mutex, NULL);
pthread_cond_init(&count_threshhold, NULL);
@@ -677,6 +684,7 @@ int main(int argc, char **argv)
pthread_cond_timedwait(&count_threshhold, &counter_mutex, &abstime);
}
pthread_mutex_unlock(&counter_mutex);
+ pthread_mutex_destroy(&init_mutex);
pthread_mutex_destroy(&counter_mutex);
pthread_cond_destroy(&count_threshhold);
pthread_attr_destroy(&attr);