Skip to content

Commit 8934bbd

Browse files
author
Arun Kuruvila
committed
Merge branch 'mysql-5.5' into mysql-5.6
2 parents 28de3b6 + df0d8ef commit 8934bbd

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
@@ -426,13 +426,19 @@ static MYSQL *db_connect(char *host, char *database,
426426
MYSQL *mysql;
427427
if (verbose)
428428
fprintf(stdout, "Connecting to %s\n", host ? host : "localhost");
429-
pthread_mutex_lock(&init_mutex);
430-
if (!(mysql= mysql_init(NULL)))
429+
if (opt_use_threads && !lock_tables)
431430
{
431+
pthread_mutex_lock(&init_mutex);
432+
if (!(mysql= mysql_init(NULL)))
433+
{
434+
pthread_mutex_unlock(&init_mutex);
435+
return 0;
436+
}
432437
pthread_mutex_unlock(&init_mutex);
433-
return 0;
434438
}
435-
pthread_mutex_unlock(&init_mutex);
439+
else
440+
if (!(mysql= mysql_init(NULL)))
441+
return 0;
436442
if (opt_compress)
437443
mysql_options(mysql,MYSQL_OPT_COMPRESS,NullS);
438444
if (opt_local_file)

0 commit comments

Comments
 (0)