Commit 96d90250 authored by Arun Kuruvila's avatar Arun Kuruvila

Bug#23035296: MAIN.MYSQLDUMP FAILS BECUASE OF UNEXPECTED

              ERROR MESSAGE

Post push patch to fix test case failure.
parent 5dc6a77b
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
/* Global Thread counter */ /* Global Thread counter */
uint counter; uint counter;
pthread_mutex_t init_mutex;
pthread_mutex_t counter_mutex; pthread_mutex_t counter_mutex;
pthread_cond_t count_threshhold; pthread_cond_t count_threshhold;
...@@ -417,8 +418,13 @@ static MYSQL *db_connect(char *host, char *database, ...@@ -417,8 +418,13 @@ static MYSQL *db_connect(char *host, char *database,
MYSQL *mysql; MYSQL *mysql;
if (verbose) if (verbose)
fprintf(stdout, "Connecting to %s\n", host ? host : "localhost"); fprintf(stdout, "Connecting to %s\n", host ? host : "localhost");
pthread_mutex_lock(&init_mutex);
if (!(mysql= mysql_init(NULL))) if (!(mysql= mysql_init(NULL)))
{
pthread_mutex_unlock(&init_mutex);
return 0; return 0;
}
pthread_mutex_unlock(&init_mutex);
if (opt_compress) if (opt_compress)
mysql_options(mysql,MYSQL_OPT_COMPRESS,NullS); mysql_options(mysql,MYSQL_OPT_COMPRESS,NullS);
if (opt_local_file) if (opt_local_file)
...@@ -623,6 +629,7 @@ int main(int argc, char **argv) ...@@ -623,6 +629,7 @@ int main(int argc, char **argv)
pthread_attr_setdetachstate(&attr, pthread_attr_setdetachstate(&attr,
PTHREAD_CREATE_JOINABLE); PTHREAD_CREATE_JOINABLE);
pthread_mutex_init(&init_mutex, NULL);
pthread_mutex_init(&counter_mutex, NULL); pthread_mutex_init(&counter_mutex, NULL);
pthread_cond_init(&count_threshhold, NULL); pthread_cond_init(&count_threshhold, NULL);
...@@ -677,6 +684,7 @@ int main(int argc, char **argv) ...@@ -677,6 +684,7 @@ int main(int argc, char **argv)
pthread_cond_timedwait(&count_threshhold, &counter_mutex, &abstime); pthread_cond_timedwait(&count_threshhold, &counter_mutex, &abstime);
} }
pthread_mutex_unlock(&counter_mutex); pthread_mutex_unlock(&counter_mutex);
pthread_mutex_destroy(&init_mutex);
pthread_mutex_destroy(&counter_mutex); pthread_mutex_destroy(&counter_mutex);
pthread_cond_destroy(&count_threshhold); pthread_cond_destroy(&count_threshhold);
pthread_attr_destroy(&attr); pthread_attr_destroy(&attr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment