Skip to content

Commit 90035bd

Browse files
author
Arun Kuruvila
committed
Merge branch 'mysql-5.5' into mysql-5.6
2 parents 31d6837 + 7c5d18e commit 90035bd

File tree

4 files changed

+59
-11
lines changed

4 files changed

+59
-11
lines changed

client/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -49,6 +49,7 @@ MYSQL_ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c)
4949
TARGET_LINK_LIBRARIES(mysqldump mysqlclient)
5050

5151
MYSQL_ADD_EXECUTABLE(mysqlimport mysqlimport.c)
52+
SET_SOURCE_FILES_PROPERTIES(mysqlimport.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
5253
TARGET_LINK_LIBRARIES(mysqlimport mysqlclient)
5354

5455
MYSQL_ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c)

client/mysqlimport.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -25,19 +25,14 @@
2525
#include "client_priv.h"
2626
#include "my_default.h"
2727
#include "mysql_version.h"
28-
#ifdef HAVE_LIBPTHREAD
29-
#include <my_pthread.h>
30-
#endif
3128

3229
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
3330

3431

3532
/* Global Thread counter */
3633
uint counter;
37-
#ifdef HAVE_LIBPTHREAD
3834
pthread_mutex_t counter_mutex;
3935
pthread_cond_t count_threshhold;
40-
#endif
4136

4237
static void db_error_with_table(MYSQL *mysql, char *table);
4338
static void db_error(MYSQL *mysql);
@@ -567,7 +562,6 @@ static char *field_escape(char *to,const char *from,uint length)
567562

568563
int exitcode= 0;
569564

570-
#ifdef HAVE_LIBPTHREAD
571565
pthread_handler_t worker_thread(void *arg)
572566
{
573567
int error;
@@ -607,7 +601,6 @@ pthread_handler_t worker_thread(void *arg)
607601

608602
return 0;
609603
}
610-
#endif
611604

612605

613606
int main(int argc, char **argv)
@@ -629,7 +622,6 @@ int main(int argc, char **argv)
629622
return(1);
630623
}
631624

632-
#ifdef HAVE_LIBPTHREAD
633625
if (opt_use_threads && !lock_tables)
634626
{
635627
pthread_t mainthread; /* Thread descriptor */
@@ -683,7 +675,6 @@ int main(int argc, char **argv)
683675
pthread_attr_destroy(&attr);
684676
}
685677
else
686-
#endif
687678
{
688679
MYSQL *mysql= 0;
689680
if (!(mysql= db_connect(current_host,current_db,current_user,opt_password)))

mysql-test/r/mysqldump.result

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5404,3 +5404,31 @@ HEX(a)
54045404
00000000010200000005000000000000000000F03F000000000000F03F0000000000000040000000000000F03F00000000000000400000000000000040000000000000F03F0000000000000040000000000000F03F000000000000F03F
54055405
INSERT INTO `t1` (`a`) VALUES (0x00000000010200000005000000000000000000F03F000000000000F03F0000000000000040000000000000F03F00000000000000400000000000000040000000000000F03F0000000000000040000000000000F03F000000000000F03F);
54065406
DROP DATABASE dump_gis;
5407+
#
5408+
# Bug #20772273 : MYSQLIMPORT --USE-THREADS DOESN'T USE MULTIPLE THREADS
5409+
#
5410+
CREATE DATABASE db_20772273;
5411+
USE db_20772273;
5412+
CREATE TABLE t1(a INT);
5413+
INSERT INTO t1 VALUES (1), (2);
5414+
CREATE TABLE t2(a INT);
5415+
INSERT INTO t2 VALUES (3), (4);
5416+
SELECT * FROM t1;
5417+
a
5418+
1
5419+
2
5420+
SELECT * FROM t2;
5421+
a
5422+
3
5423+
4
5424+
SELECT * FROM t1;
5425+
a
5426+
1
5427+
2
5428+
SELECT * FROM t2;
5429+
a
5430+
3
5431+
4
5432+
DROP TABLE t1;
5433+
DROP TABLE t2;
5434+
DROP DATABASE db_20772273;

mysql-test/t/mysqldump.test

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2500,3 +2500,31 @@ SELECT HEX(a) FROM t1;
25002500
--exec $MYSQL_DUMP -necqt --compact --hex-blob dump_gis
25012501
DROP DATABASE dump_gis;
25022502

2503+
--echo #
2504+
--echo # Bug #20772273 : MYSQLIMPORT --USE-THREADS DOESN'T USE MULTIPLE THREADS
2505+
--echo #
2506+
2507+
CREATE DATABASE db_20772273;
2508+
USE db_20772273;
2509+
CREATE TABLE t1(a INT);
2510+
INSERT INTO t1 VALUES (1), (2);
2511+
CREATE TABLE t2(a INT);
2512+
INSERT INTO t2 VALUES (3), (4);
2513+
2514+
SELECT * FROM t1;
2515+
SELECT * FROM t2;
2516+
2517+
--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ db_20772273
2518+
--exec $MYSQL db_20772273 < $MYSQLTEST_VARDIR/tmp/t1.sql
2519+
--exec $MYSQL db_20772273 < $MYSQLTEST_VARDIR/tmp/t2.sql
2520+
2521+
# Test mysqlimport with multiple threads
2522+
--exec $MYSQL_IMPORT --silent --use-threads=2 db_20772273 $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt
2523+
2524+
SELECT * FROM t1;
2525+
SELECT * FROM t2;
2526+
2527+
#Cleanup
2528+
DROP TABLE t1;
2529+
DROP TABLE t2;
2530+
DROP DATABASE db_20772273;

0 commit comments

Comments
 (0)