summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
Diffstat (limited to 'libmysql')
-rwxr-xr-xlibmysql/CMakeLists.txt17
-rw-r--r--libmysql/Makefile.am8
-rw-r--r--libmysql/Makefile.shared16
-rw-r--r--libmysql/conf_to_src.c3
-rw-r--r--libmysql/dll.c3
-rw-r--r--libmysql/errmsg.c3
-rw-r--r--libmysql/get_password.c3
-rw-r--r--libmysql/libmysql.c36
-rw-r--r--libmysql/libmysql.def1
-rw-r--r--libmysql/manager.c3
10 files changed, 63 insertions, 30 deletions
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index 129b923dd27..9e138cb5b81 100755
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -14,9 +14,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-
# Note that we don't link with the libraries "strings" or "mysys"
# here, instead we recompile the files needed and include them
# directly. This means we don't have to worry here about if these
@@ -71,10 +68,10 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
../strings/ctype-simple.c ../strings/ctype-sjis.c ../strings/ctype-tis620.c
../strings/ctype-uca.c ../strings/ctype-ucs2.c ../strings/ctype-ujis.c
../strings/ctype-utf8.c ../strings/ctype-win1250ch.c ../strings/ctype.c
- ../mysys/default.c errmsg.c ../mysys/errors.c
+ ../mysys/default.c errmsg.c ../mysys/errors.c ../mysys/my_sync.c
../mysys/hash.c ../mysys/my_sleep.c ../mysys/default_modify.c
get_password.c ../strings/int2str.c ../strings/is_prefix.c
- libmysql.c ../mysys/list.c ../strings/llstr.c
+ libmysql.c ../mysys/list.c ../strings/llstr.c ../mysys/my_rnd.c
../strings/longlong2str.c manager.c ../mysys/mf_arr_appstr.c ../mysys/mf_cache.c
../mysys/mf_dirname.c ../mysys/mf_fn_ext.c ../mysys/mf_format.c
../mysys/mf_iocache.c ../mysys/mf_iocache2.c ../mysys/mf_loadpath.c
@@ -94,7 +91,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
../mysys/safemalloc.c ../mysys/sha1.c ../strings/str2int.c
../strings/str_alloc.c ../strings/strcend.c ../strings/strcont.c ../strings/strend.c
../strings/strfill.c ../mysys/string.c ../strings/strinstr.c ../strings/strmake.c
- ../strings/strmov.c ../strings/strnlen.c ../strings/strnmov.c ../strings/strtod.c
+ ../strings/strmov.c ../strings/strmov_overlapp.c ../strings/strnlen.c ../strings/strnmov.c ../strings/strtod.c
../strings/strtoll.c ../strings/strtoull.c ../strings/strxmov.c ../strings/strxnmov.c
../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c
../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c ../mysys/mf_qsort.c
@@ -129,3 +126,11 @@ TARGET_LINK_LIBRARIES(libmysql wsock32)
IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
ENDIF(EMBED_MANIFESTS)
+
+# TODO: Install mysqlclient_notls?
+# TODO: Which component should these be part of, development?
+INSTALL(TARGETS mysqlclient DESTINATION lib/opt COMPONENT runtime)
+INSTALL(TARGETS libmysql DESTINATION lib/opt COMPONENT runtime)
+
+# Also install libmysql.dll to the bin dir
+INSTALL(TARGETS libmysql DESTINATION bin COMPONENT runtime)
diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am
index cb6b70b84d2..af10794f693 100644
--- a/libmysql/Makefile.am
+++ b/libmysql/Makefile.am
@@ -5,7 +5,8 @@
# published by the Free Software Foundation.
#
# There are special exceptions to the terms and conditions of the GPL as it
-# is applied to this software.
+# is applied to this software. View the full text of the exception in file
+# EXCEPTIONS-CLIENT in the directory of this software distribution.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -40,7 +41,7 @@ link_sources:
ms=`echo $(mysysobjects) | sed "s;\.lo;.c;g"`; \
vs=`echo $(vio_objects) | sed "s;\.lo;.c;g"`; \
scs=`echo $(sql_cmn_objects) | sed "s;\.lo;.c;g"`; \
- for f in $$ss; do \
+ for f in $$ss $(mystringsheaders); do \
rm -f $$f; \
@LN_CP_F@ $(top_srcdir)/strings/$$f $$f; \
done; \
@@ -110,6 +111,3 @@ do-lib-dist:
echo ' $$(AR) r $$@ $$?' >>$$dir/Makefile; \
gtar cvzf $$dir.tar.gz $$dir; \
cd $$dir; gmake
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared
index 7249bcab19a..c7d76f4185b 100644
--- a/libmysql/Makefile.shared
+++ b/libmysql/Makefile.shared
@@ -5,7 +5,8 @@
# published by the Free Software Foundation.
#
# There are special exceptions to the terms and conditions of the GPL as it
-# is applied to this software.
+# is applied to this software. View the full text of the exception in file
+# EXCEPTIONS-CLIENT in the directory of this software distribution.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -37,7 +38,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
strmake.lo strend.lo strtod.lo \
strnlen.lo strfill.lo is_prefix.lo \
int2str.lo str2int.lo strinstr.lo strcont.lo \
- strcend.lo ctype-latin1.lo \
+ strcend.lo bcmp.lo ctype-latin1.lo \
bchange.lo bmove.lo bmove_upp.lo longlong2str.lo \
strtoull.lo strtoll.lo llstr.lo my_vsnprintf.lo \
ctype.lo ctype-simple.lo ctype-bin.lo ctype-mb.lo \
@@ -45,9 +46,11 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
ctype-win1250ch.lo ctype-utf8.lo ctype-extra.lo \
ctype-ucs2.lo ctype-gb2312.lo ctype-gbk.lo \
ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo \
- ctype-uca.lo xml.lo my_strtoll10.lo str_alloc.lo
+ ctype-uca.lo xml.lo my_strtoll10.lo str_alloc.lo \
+ strmov_overlapp.lo
mystringsextra= strto.c
+mystringsheaders= strings_def.h
dbugobjects = dbug.lo # IT IS IN SAFEMALLOC.C sanity.lo
mysysheaders = mysys_priv.h my_static.h
vioheaders = vio_priv.h
@@ -65,8 +68,8 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
my_compress.lo array.lo my_once.lo list.lo my_net.lo \
charset.lo charset-def.lo hash.lo mf_iocache.lo \
mf_iocache2.lo my_seek.lo my_sleep.lo \
- my_pread.lo mf_cache.lo md5.lo sha1.lo \
- my_getopt.lo \
+ my_pread.lo mf_cache.lo md5.lo sha1.lo my_rnd.lo \
+ my_getopt.lo my_port.lo \
my_rename.lo my_chsize.lo my_sync.lo my_getsystime.lo
sqlobjects = net.lo
sql_cmn_objects = pack.lo client.lo my_time.lo
@@ -113,6 +116,3 @@ conf_to_src_LDADD=
#force static linking of conf_to_src - essential when linking against
#custom installation of libc
conf_to_src_LDFLAGS=@NOINST_LDFLAGS@
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/libmysql/conf_to_src.c b/libmysql/conf_to_src.c
index f39a2e1856f..785e3cad4c1 100644
--- a/libmysql/conf_to_src.c
+++ b/libmysql/conf_to_src.c
@@ -5,7 +5,8 @@
the Free Software Foundation.
There are special exceptions to the terms and conditions of the GPL as it
- is applied to this software.
+ is applied to this software. View the full text of the exception in file
+ EXCEPTIONS-CLIENT in the directory of this software distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/libmysql/dll.c b/libmysql/dll.c
index 8654c035c63..8fcf41c792c 100644
--- a/libmysql/dll.c
+++ b/libmysql/dll.c
@@ -5,7 +5,8 @@
the Free Software Foundation.
There are special exceptions to the terms and conditions of the GPL as it
- is applied to this software.
+ is applied to this software. View the full text of the exception in file
+ EXCEPTIONS-CLIENT in the directory of this software distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c
index 163632127c3..95ee6862aa8 100644
--- a/libmysql/errmsg.c
+++ b/libmysql/errmsg.c
@@ -5,7 +5,8 @@
the Free Software Foundation.
There are special exceptions to the terms and conditions of the GPL as it
- is applied to this software.
+ is applied to this software. View the full text of the exception in file
+ EXCEPTIONS-CLIENT in the directory of this software distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/libmysql/get_password.c b/libmysql/get_password.c
index 63d4e68541f..cbe5fce6949 100644
--- a/libmysql/get_password.c
+++ b/libmysql/get_password.c
@@ -5,7 +5,8 @@
the Free Software Foundation.
There are special exceptions to the terms and conditions of the GPL as it
- is applied to this software.
+ is applied to this software. View the full text of the exception in file
+ EXCEPTIONS-CLIENT in the directory of this software distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index 91225128a1c..02285ef1caa 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -5,7 +5,8 @@
the Free Software Foundation.
There are special exceptions to the terms and conditions of the GPL as it
- is applied to this software.
+ is applied to this software. View the full text of the exception in file
+ EXCEPTIONS-CLIENT in the directory of this software distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -130,8 +131,7 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
mysql_port = MYSQL_PORT;
#ifndef MSDOS
{
- char *env;
- struct servent *serv_ptr __attribute__((unused));
+ char *env;
/*
if builder specifically requested a default port, use that
@@ -144,8 +144,11 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
*/
#if MYSQL_PORT_DEFAULT == 0
- if ((serv_ptr = getservbyname("mysql", "tcp")))
- mysql_port = (uint) ntohs((ushort) serv_ptr->s_port);
+ {
+ struct servent *serv_ptr;
+ if ((serv_ptr = getservbyname("mysql", "tcp")))
+ mysql_port = (uint) ntohs((ushort) serv_ptr->s_port);
+ }
#endif
if ((env = getenv("MYSQL_TCP_PORT")))
mysql_port =(uint) atoi(env);
@@ -208,11 +211,19 @@ void STDCALL mysql_server_end()
{
my_end(0);
}
+#ifdef NOT_NEEDED
+ /*
+ The following is not needed as if the program explicitely called
+ my_init() then we can assume it will also call my_end().
+ The reason to not also do it here is in that case we can't get
+ statistics from my_end() to debug log.
+ */
else
{
free_charsets();
mysql_thread_end();
}
+#endif
mysql_client_init= org_my_init_done= 0;
#ifdef EMBEDDED_SERVER
@@ -1432,6 +1443,19 @@ mysql_get_server_info(MYSQL *mysql)
}
+my_bool STDCALL mariadb_connection(MYSQL *mysql)
+{
+ return (strinstr(mysql->server_version, "MariaDB") != 0 ||
+ strinstr(mysql->server_version, "-maria-") != 0);
+}
+
+const char * STDCALL
+mysql_get_server_name(MYSQL *mysql)
+{
+ return mariadb_connection(mysql) ? "MariaDB" : "MySQL";
+}
+
+
const char * STDCALL
mysql_get_host_info(MYSQL *mysql)
{
@@ -4653,7 +4677,7 @@ int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *my_bind,
if ((int) stmt->state < (int) MYSQL_STMT_FETCH_DONE)
{
set_stmt_error(stmt, CR_NO_DATA, unknown_sqlstate, NULL);
- return 1;
+ DBUG_RETURN(1);
}
if (column >= stmt->field_count)
{
diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def
index 81f86dc8726..45e85b15120 100644
--- a/libmysql/libmysql.def
+++ b/libmysql/libmysql.def
@@ -151,3 +151,4 @@ EXPORTS
mysql_get_character_set_info
get_defaults_options
modify_defaults_file
+ mysql_get_server_name
diff --git a/libmysql/manager.c b/libmysql/manager.c
index ef28f1bd323..53ffffa55c0 100644
--- a/libmysql/manager.c
+++ b/libmysql/manager.c
@@ -5,7 +5,8 @@
the Free Software Foundation.
There are special exceptions to the terms and conditions of the GPL as it
- is applied to this software.
+ is applied to this software. View the full text of the exception in file
+ EXCEPTIONS-CLIENT in the directory of this software distribution.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of