diff --git a/CMakeLists.txt b/CMakeLists.txt index 5926d255..571887bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,17 +12,21 @@ SET(CPACK_PACKAGE_VERSION_PATCH 0) CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR) IF(COMMAND CMAKE_POLICY) CMAKE_POLICY(SET CMP0003 NEW) -ENDIF(COMMAND CMAKE_POLICY) +ENDIF() IF(WIN32) # Speedup system tests - INCLUDE(${CMAKE_SOURCE_DIR}/WindowsCache.cmake) + INCLUDE(${CMAKE_SOURCE_DIR}/cmake/WindowsCache.cmake) ENDIF() IF(UNIX) SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") ENDIF() +IF(CMAKE_COMPILER_IS_GNUCC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused -Wno-uninitialized") +ENDIF() + # If the build type isn't specified, set to Relwithdebinfo as default. IF(NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE "Relwithdebinfo") @@ -40,10 +44,10 @@ MATH(EXPR MYSQL_VERSION_ID "${MYSQL_CLIENT_VERSION_MAJOR} * 10000 + ${MYSQL_CLIENT_VERSION_PATCH}") IF (NOT MYSQL_PORT) SET(MYSQL_PORT 3306) -ENDIF (NOT MYSQL_PORT) +ENDIF () IF(NOT MYSQL_UNIX_ADDR) SET(MYSQL_UNIX_ADDR "/tmp/mysql.sock") -ENDIF(NOT MYSQL_UNIX_ADDR) +ENDIF() # todo: we don't character sets in share - all is compiled in SET(SHAREDIR "share") @@ -59,7 +63,7 @@ IF(WIN32) SET(HAVE_THREADS 1) ADD_DEFINITIONS(-DHAVE_DLOPEN) ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996" ) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996 /W4 /Wall" ) ELSEIF() SET(HAVE_THREADS ${CMAKE_USE_PTHREADS}) ENDIF() @@ -72,13 +76,11 @@ ENDIF() ENDIF() # check for various include files -INCLUDE(LibmysqlIncludeFiles.cmake) +INCLUDE(${CMAKE_SOURCE_DIR}/cmake/CheckIncludeFiles.cmake) # check for various functions -INCLUDE(LibmysqlFunctions.cmake) +INCLUDE(${CMAKE_SOURCE_DIR}/cmake/CheckFunctions.cmake) # check for various types -INCLUDE(LibmysqlTypes.cmake) - - +INCLUDE(${CMAKE_SOURCE_DIR}/cmake/CheckTypes.cmake) # Check for OpenSSL FIND_PACKAGE(OpenSSL) diff --git a/LibmysqlFunctions.cmake b/cmake/CheckFunctions.cmake similarity index 100% rename from LibmysqlFunctions.cmake rename to cmake/CheckFunctions.cmake diff --git a/LibmysqlIncludeFiles.cmake b/cmake/CheckIncludeFiles.cmake similarity index 100% rename from LibmysqlIncludeFiles.cmake rename to cmake/CheckIncludeFiles.cmake diff --git a/LibmysqlTypes.cmake b/cmake/CheckTypes.cmake similarity index 100% rename from LibmysqlTypes.cmake rename to cmake/CheckTypes.cmake diff --git a/WindowsCache.cmake b/cmake/WindowsCache.cmake similarity index 100% rename from WindowsCache.cmake rename to cmake/WindowsCache.cmake diff --git a/include/config-win.h b/include/config-win.h index cefadc94..702feba1 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -111,7 +111,7 @@ typedef uint rf_SetTimer; #define bool_defined #define byte_defined #define HUGE_PTR -#define STDCALL __stdcall /* Used by libmysql.dll */ +#define STDCALL __stdcall /* Used by libmariadb.dll */ #define VOID_SIGHANDLER #define SIZEOF_CHAR 1 diff --git a/include/mysql.h b/include/mysql.h index d457d5e7..62f30127 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -1,5 +1,6 @@ /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB - + 2012 by MontyProgram AB + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either @@ -15,7 +16,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -/* defines for the libmysql library */ +/* defines for the libmariadb library */ #ifndef _mysql_h #define _mysql_h diff --git a/include/mysql/plugin_auth.h b/include/mysql/plugin_auth.h index 6a43d14f..a16c764d 100644 --- a/include/mysql/plugin_auth.h +++ b/include/mysql/plugin_auth.h @@ -33,7 +33,7 @@ /** Authentication failed. Additionally, all other CR_xxx values - (libmysql error code) can be used too. + (libmariadb error code) can be used too. The client plugin may set the error code and the error message directly in the MYSQL structure and return CR_ERROR. If a CR_xxx specific error @@ -46,7 +46,7 @@ Authentication (client part) was successful. It does not mean that the authentication as a whole was successful, usually it only means that the client was able to send the user name and the password to the - server. If CR_OK is returned, the libmysql reads the next packet expecting + server. If CR_OK is returned, the libmariadb reads the next packet expecting it to be one of OK, ERROR, or CHANGE_PLUGIN packets. */ #define CR_OK -1 @@ -54,7 +54,7 @@ Authentication was successful. It means that the client has done its part successfully and also that a plugin has read the last packet (one of OK, ERROR, CHANGE_PLUGIN). - In this case, libmysql will not read a packet from the server, + In this case, libmariadb will not read a packet from the server, but it will use the data at mysql->net.read_pos. A plugin may return this value if the number of roundtrips in the diff --git a/include/mysql/plugin_auth_common.h b/include/mysql/plugin_auth_common.h index 6a43d14f..a16c764d 100644 --- a/include/mysql/plugin_auth_common.h +++ b/include/mysql/plugin_auth_common.h @@ -33,7 +33,7 @@ /** Authentication failed. Additionally, all other CR_xxx values - (libmysql error code) can be used too. + (libmariadb error code) can be used too. The client plugin may set the error code and the error message directly in the MYSQL structure and return CR_ERROR. If a CR_xxx specific error @@ -46,7 +46,7 @@ Authentication (client part) was successful. It does not mean that the authentication as a whole was successful, usually it only means that the client was able to send the user name and the password to the - server. If CR_OK is returned, the libmysql reads the next packet expecting + server. If CR_OK is returned, the libmariadb reads the next packet expecting it to be one of OK, ERROR, or CHANGE_PLUGIN packets. */ #define CR_OK -1 @@ -54,7 +54,7 @@ Authentication was successful. It means that the client has done its part successfully and also that a plugin has read the last packet (one of OK, ERROR, CHANGE_PLUGIN). - In this case, libmysql will not read a packet from the server, + In this case, libmariadb will not read a packet from the server, but it will use the data at mysql->net.read_pos. A plugin may return this value if the number of roundtrips in the diff --git a/libmariadb/client_plugin.c b/libmariadb/client_plugin.c index 6031c319..a9abda65 100644 --- a/libmariadb/client_plugin.c +++ b/libmariadb/client_plugin.c @@ -18,7 +18,7 @@ /** @file - Support code for the client side (libmysql) plugins + Support code for the client side (libmariadb) plugins Client plugins are somewhat different from server plugins, they are simpler. @@ -230,7 +230,7 @@ static void load_env_plugins(MYSQL *mysql) my_free(free_env, MYF(0)); } -/********** extern functions to be used by libmysql *********************/ +/********** extern functions to be used by libmariadb *********************/ /** Initializes the client plugin layer. diff --git a/libmariadb/libmariadb.c b/libmariadb/libmariadb.c index d97bb6a6..71f23f6f 100644 --- a/libmariadb/libmariadb.c +++ b/libmariadb/libmariadb.c @@ -711,13 +711,13 @@ mysql_debug(const char *debug __attribute__((unused))) DBUG_PUSH(env); #if !defined(_WINVER) && !defined(WINVER) puts("\n-------------------------------------------------------"); - puts("MYSQL_DEBUG found. libmysql started with the following:"); + puts("MYSQL_DEBUG found. libmariadb started with the following:"); puts(env); puts("-------------------------------------------------------\n"); #else { char buff[80]; - strmov(strmov(buff,"libmysql: "),env); + strmov(strmov(buff,"libmariadb: "),env); MessageBox((HWND) 0,"Debugging variable MYSQL_DEBUG used",buff,MB_OK); } #endif diff --git a/mariadb_config/mariadb_config.c.in b/mariadb_config/mariadb_config.c.in index bed93d99..47e669e1 100644 --- a/mariadb_config/mariadb_config.c.in +++ b/mariadb_config/mariadb_config.c.in @@ -53,7 +53,6 @@ void usage(void) int main(int argc, char **argv) { - int error; int c; my_progname= argv[0]; diff --git a/unittest/libmariadb/logs.c b/unittest/libmariadb/logs.c index 7d60f644..982c0c40 100644 --- a/unittest/libmariadb/logs.c +++ b/unittest/libmariadb/logs.c @@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "my_test.h" +#ifdef ENABLE_IF_IN_USE static int enable_general_log(MYSQL *mysql, int truncate) { int rc; @@ -51,7 +52,7 @@ static int restore_general_log(MYSQL *mysql) return OK; } - +#endif /* Test update/binary logs */