You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
some clean up
This commit is contained in:
@@ -12,17 +12,21 @@ SET(CPACK_PACKAGE_VERSION_PATCH 0)
|
|||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
|
||||||
IF(COMMAND CMAKE_POLICY)
|
IF(COMMAND CMAKE_POLICY)
|
||||||
CMAKE_POLICY(SET CMP0003 NEW)
|
CMAKE_POLICY(SET CMP0003 NEW)
|
||||||
ENDIF(COMMAND CMAKE_POLICY)
|
ENDIF()
|
||||||
|
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
# Speedup system tests
|
# Speedup system tests
|
||||||
INCLUDE(${CMAKE_SOURCE_DIR}/WindowsCache.cmake)
|
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/WindowsCache.cmake)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(UNIX)
|
IF(UNIX)
|
||||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||||
ENDIF()
|
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 the build type isn't specified, set to Relwithdebinfo as default.
|
||||||
IF(NOT CMAKE_BUILD_TYPE)
|
IF(NOT CMAKE_BUILD_TYPE)
|
||||||
SET(CMAKE_BUILD_TYPE "Relwithdebinfo")
|
SET(CMAKE_BUILD_TYPE "Relwithdebinfo")
|
||||||
@@ -40,10 +44,10 @@ MATH(EXPR MYSQL_VERSION_ID "${MYSQL_CLIENT_VERSION_MAJOR} * 10000 +
|
|||||||
${MYSQL_CLIENT_VERSION_PATCH}")
|
${MYSQL_CLIENT_VERSION_PATCH}")
|
||||||
IF (NOT MYSQL_PORT)
|
IF (NOT MYSQL_PORT)
|
||||||
SET(MYSQL_PORT 3306)
|
SET(MYSQL_PORT 3306)
|
||||||
ENDIF (NOT MYSQL_PORT)
|
ENDIF ()
|
||||||
IF(NOT MYSQL_UNIX_ADDR)
|
IF(NOT MYSQL_UNIX_ADDR)
|
||||||
SET(MYSQL_UNIX_ADDR "/tmp/mysql.sock")
|
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
|
# todo: we don't character sets in share - all is compiled in
|
||||||
SET(SHAREDIR "share")
|
SET(SHAREDIR "share")
|
||||||
@@ -59,7 +63,7 @@ IF(WIN32)
|
|||||||
SET(HAVE_THREADS 1)
|
SET(HAVE_THREADS 1)
|
||||||
ADD_DEFINITIONS(-DHAVE_DLOPEN)
|
ADD_DEFINITIONS(-DHAVE_DLOPEN)
|
||||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
|
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()
|
ELSEIF()
|
||||||
SET(HAVE_THREADS ${CMAKE_USE_PTHREADS})
|
SET(HAVE_THREADS ${CMAKE_USE_PTHREADS})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@@ -72,13 +76,11 @@ ENDIF()
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# check for various include files
|
# check for various include files
|
||||||
INCLUDE(LibmysqlIncludeFiles.cmake)
|
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/CheckIncludeFiles.cmake)
|
||||||
# check for various functions
|
# check for various functions
|
||||||
INCLUDE(LibmysqlFunctions.cmake)
|
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/CheckFunctions.cmake)
|
||||||
# check for various types
|
# check for various types
|
||||||
INCLUDE(LibmysqlTypes.cmake)
|
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/CheckTypes.cmake)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Check for OpenSSL
|
# Check for OpenSSL
|
||||||
FIND_PACKAGE(OpenSSL)
|
FIND_PACKAGE(OpenSSL)
|
||||||
|
@@ -111,7 +111,7 @@ typedef uint rf_SetTimer;
|
|||||||
#define bool_defined
|
#define bool_defined
|
||||||
#define byte_defined
|
#define byte_defined
|
||||||
#define HUGE_PTR
|
#define HUGE_PTR
|
||||||
#define STDCALL __stdcall /* Used by libmysql.dll */
|
#define STDCALL __stdcall /* Used by libmariadb.dll */
|
||||||
|
|
||||||
#define VOID_SIGHANDLER
|
#define VOID_SIGHANDLER
|
||||||
#define SIZEOF_CHAR 1
|
#define SIZEOF_CHAR 1
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
/* 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
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
License as published by the Free Software Foundation; either
|
License as published by the Free Software Foundation; either
|
||||||
@@ -15,7 +16,7 @@
|
|||||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||||
MA 02111-1307, USA */
|
MA 02111-1307, USA */
|
||||||
|
|
||||||
/* defines for the libmysql library */
|
/* defines for the libmariadb library */
|
||||||
|
|
||||||
#ifndef _mysql_h
|
#ifndef _mysql_h
|
||||||
#define _mysql_h
|
#define _mysql_h
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Authentication failed. Additionally, all other CR_xxx values
|
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
|
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
|
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 (client part) was successful. It does not mean that the
|
||||||
authentication as a whole was successful, usually it only means
|
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
|
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.
|
it to be one of OK, ERROR, or CHANGE_PLUGIN packets.
|
||||||
*/
|
*/
|
||||||
#define CR_OK -1
|
#define CR_OK -1
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
Authentication was successful.
|
Authentication was successful.
|
||||||
It means that the client has done its part successfully and also that
|
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).
|
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.
|
but it will use the data at mysql->net.read_pos.
|
||||||
|
|
||||||
A plugin may return this value if the number of roundtrips in the
|
A plugin may return this value if the number of roundtrips in the
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Authentication failed. Additionally, all other CR_xxx values
|
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
|
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
|
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 (client part) was successful. It does not mean that the
|
||||||
authentication as a whole was successful, usually it only means
|
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
|
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.
|
it to be one of OK, ERROR, or CHANGE_PLUGIN packets.
|
||||||
*/
|
*/
|
||||||
#define CR_OK -1
|
#define CR_OK -1
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
Authentication was successful.
|
Authentication was successful.
|
||||||
It means that the client has done its part successfully and also that
|
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).
|
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.
|
but it will use the data at mysql->net.read_pos.
|
||||||
|
|
||||||
A plugin may return this value if the number of roundtrips in the
|
A plugin may return this value if the number of roundtrips in the
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
/**
|
/**
|
||||||
@file
|
@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.
|
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));
|
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.
|
Initializes the client plugin layer.
|
||||||
|
@@ -711,13 +711,13 @@ mysql_debug(const char *debug __attribute__((unused)))
|
|||||||
DBUG_PUSH(env);
|
DBUG_PUSH(env);
|
||||||
#if !defined(_WINVER) && !defined(WINVER)
|
#if !defined(_WINVER) && !defined(WINVER)
|
||||||
puts("\n-------------------------------------------------------");
|
puts("\n-------------------------------------------------------");
|
||||||
puts("MYSQL_DEBUG found. libmysql started with the following:");
|
puts("MYSQL_DEBUG found. libmariadb started with the following:");
|
||||||
puts(env);
|
puts(env);
|
||||||
puts("-------------------------------------------------------\n");
|
puts("-------------------------------------------------------\n");
|
||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
char buff[80];
|
char buff[80];
|
||||||
strmov(strmov(buff,"libmysql: "),env);
|
strmov(strmov(buff,"libmariadb: "),env);
|
||||||
MessageBox((HWND) 0,"Debugging variable MYSQL_DEBUG used",buff,MB_OK);
|
MessageBox((HWND) 0,"Debugging variable MYSQL_DEBUG used",buff,MB_OK);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -53,7 +53,6 @@ void usage(void)
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int error;
|
|
||||||
int c;
|
int c;
|
||||||
my_progname= argv[0];
|
my_progname= argv[0];
|
||||||
|
|
||||||
|
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||||||
*/
|
*/
|
||||||
#include "my_test.h"
|
#include "my_test.h"
|
||||||
|
|
||||||
|
#ifdef ENABLE_IF_IN_USE
|
||||||
static int enable_general_log(MYSQL *mysql, int truncate)
|
static int enable_general_log(MYSQL *mysql, int truncate)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
@@ -51,7 +52,7 @@ static int restore_general_log(MYSQL *mysql)
|
|||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Test update/binary logs */
|
/* Test update/binary logs */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user