Skip to content

Commit df0d8ef

Browse files
author
Arun Kuruvila
committed
Bug#23035296: MAIN.MYSQLDUMP FAILS BECUASE OF UNEXPECTED
ERROR MESSAGE Post push patch to fix test case failure.
1 parent 07e50c4 commit df0d8ef

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

client/mysqlimport.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,13 +418,19 @@ static MYSQL *db_connect(char *host, char *database,
418418
MYSQL *mysql;
419419
if (verbose)
420420
fprintf(stdout, "Connecting to %s\n", host ? host : "localhost");
421-
pthread_mutex_lock(&init_mutex);
422-
if (!(mysql= mysql_init(NULL)))
421+
if (opt_use_threads && !lock_tables)
423422
{
423+
pthread_mutex_lock(&init_mutex);
424+
if (!(mysql= mysql_init(NULL)))
425+
{
426+
pthread_mutex_unlock(&init_mutex);
427+
return 0;
428+
}
424429
pthread_mutex_unlock(&init_mutex);
425-
return 0;
426430
}
427-
pthread_mutex_unlock(&init_mutex);
431+
else
432+
if (!(mysql= mysql_init(NULL)))
433+
return 0;
428434
if (opt_compress)
429435
mysql_options(mysql,MYSQL_OPT_COMPRESS,NullS);
430436
if (opt_local_file)

0 commit comments

Comments
 (0)