summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorJoerg Bruehe <joerg@mysql.com>2009-09-17 18:34:24 +0200
committerJoerg Bruehe <joerg@mysql.com>2009-09-17 18:34:24 +0200
commitdb890516564ebe4856e5cc100e689f33eae6c1eb (patch)
treefbc4db7ebc1f7f433063d6b32bd4f8a13ba07292 /client
parentd42364c6300b6547b45f9664808e6ab5c54d9379 (diff)
downloadmariadb-git-db890516564ebe4856e5cc100e689f33eae6c1eb.tar.gz
Fix bug#46980
Option "--without-server" still not working in 5.1 The general approach is to make sure that source files which require thread support are only compiled if the build really needs thread support, which means when the server is built or a thread-safe client library. This required several changes: - Make sure the subdirectories "storage/" and "plugin/" are only processed if the server is built, not ifclient-only. - Make the compilation of some modules which inherently require threading depend on thread supportin the build. - Separate the handling of threading in "configure.in" from that of server issues, threading is also needed in a non-server build of a thread-safe client library. Also, "libdbug" must get built even in a client-only build, so "dbug/" must be in the list of client directories. In addition, calls to thread functions in source files which can be built without thread support must use the wrapper functions which handle the non-threaded build. So the modules "client/mysqlimport.c" and "client/mysqlslap.c" must call "my_thread_end()" only via "mysql_thread_end()". Makefile.am: The directories "storage/" and "plugin/" contain files which are needed for the server only, so their contents is to be built only if a server is built. They must not be named unconditionally, because building their contents will fail unless threads are enabled. These directories are now listed in the "configure" variable "sql_server_dirs" which becomes part of "sql_union_dirs" if the server is to be built. client/mysqlimport.c: Use the wrapper function "mysql_thread_end()" which correctly handles the case of a non-threaded build. client/mysqlslap.c: Use the wrapper function "mysql_thread_end()" which correctly handles the case of a non-threaded build. configure.in: Various changes to support builds "--without-server": 1) For the unit tests, we need "libdbug". 2) Separate the treatment of the server from that of the thread-safe client library. 3) Introduce an "automake conditional" "NEED_THREAD" which can be checked in some "Makefile.am". 4) Include "storage/" and "plugin/" in the list of "sql_server_dirs" so that they are handled in the top "Makefile.am" only if the server is to be built (see the change in that file). mysys/Makefile.am: The code of "mf_keycache.c" in 5.1 is no longer safe to be built without thread support. (In 5.0, this was possible.) Rather than fix these issues, which is tedious and risky, avoid the need to ever build it without thread support: It is needed in the server only, which needs thread support. The only case where we build a "libmysys" without thread support is for a non-threaded client, where "mf_keycache" is not neded. So its inclusion in the list of source files can depend on the new conditional "NEED_THREAD". unittest/mysys/Makefile.am: Test program "my_atomic-t" is to verify the correct handling of threads only, it cannot be built without thread support and is not needed in such cases either. Let its build depend on the new conditional "NEED_THREAD".
Diffstat (limited to 'client')
-rw-r--r--client/mysqlimport.c4
-rw-r--r--client/mysqlslap.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 92e9702aea0..ef38d760e5d 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000-2006 MySQL AB
+/* Copyright (C) 2000-2006 MySQL AB, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -583,7 +583,7 @@ error:
counter--;
pthread_cond_signal(&count_threshhold);
pthread_mutex_unlock(&counter_mutex);
- my_thread_end();
+ mysql_thread_end();
return 0;
}
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 70abfbb7136..2e4797e8930 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 MySQL AB
+/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1918,7 +1918,7 @@ end:
if (!opt_only_print)
mysql_close(mysql);
- my_thread_end();
+ mysql_thread_end();
pthread_mutex_lock(&counter_mutex);
thread_counter--;