1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

Fixed crash when trying to call mysql_close twice

Fixed mysql_config
Header changes
This commit is contained in:
Georg Richter
2012-11-27 09:57:10 +01:00
parent 4f800647f2
commit 44a2b3ccc5
13 changed files with 34 additions and 11 deletions

View File

@@ -535,10 +535,12 @@ extern double my_atof(const char*);
#if SIZEOF_LONG == 4
#define INT_MIN32 (long) 0x80000000L
#define INT_MAX32 (long) 0x7FFFFFFFL
#define UINT_MAX32 0xFFFFFFFFL
#define INT_MIN24 ((long) 0xff800000L)
#define INT_MAX24 0x007fffffL
#define INT_MIN16 ((short int) 0x8000)
#define INT_MAX16 0x7FFF
#define UINT_MAX16 0xFFFF
#define INT_MIN8 ((char) 0x80)
#define INT_MAX8 ((char) 0x7F)
#else /* Probably Alpha */
@@ -550,6 +552,14 @@ extern double my_atof(const char*);
#define INT_MAX16 ((short int) 0x00007FFF)
#endif
#ifndef ULL
#ifdef HAVE_LONG_LONG
#define ULL(A) A ## ULL
#else
#define ULL(A) A ## UL
#endif
#endif
/* From limits.h instead */
#ifndef DBL_MIN
#define DBL_MIN 4.94065645841246544e-324

View File

@@ -268,6 +268,10 @@ typedef struct st_mysql {
void *extension;
} MYSQL;
typedef struct st_mysql_lex_string {
char *str;
size_t length;
} MYSQL_LEX_STRING;
struct st_mysql_options_extention {
char *plugin_dir;

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2010, 2011 Sergei Golubchik and Monty Program Ab
/* Copyright (C) 2010 - 2012 Sergei Golubchik and Monty Program Ab
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public

View File

@@ -1,5 +1,5 @@
/************************************************************************************
Copyright (C) 2000, 2011 MySQL AB & MySQL Finland AB & TCX DataKonsult AB,
Copyright (C) 2000, 2012 MySQL AB & MySQL Finland AB & TCX DataKonsult AB,
Monty Program AB
This library is free software; you can redistribute it and/or

View File

@@ -1,5 +1,5 @@
/****************************************************************************
Copyright (C) 2011 Monty Program AB
Copyright (C) 2012 Monty Program AB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public

View File

@@ -30,13 +30,19 @@ SET(LIBMYSQL_SOURCES array.c bchange.c bmove.c bmove_upp.c my_charset.c
my_loaddata.c my_stmt_codec.c client_plugin.c my_auth.c my_secure.c)
ADD_LIBRARY(mysqlclient STATIC ${LIBMYSQL_SOURCES})
TARGET_LINK_LIBRARIES(mysqlclient ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} ${OPENSSL_LIBRARIES} zlib)
TARGET_LINK_LIBRARIES(mysqlclient ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} zlib)
IF(OPENSSL_LIBRARIES)
TARGET_LINK_LIBRARIES(mysqlclient ${OPENSSL_LIBRARIES} zlib)
ENDIF(OPENSSL_LIBRARIES)
IF(UNIX)
TARGET_LINK_LIBRARIES(mysqlclient m)
ENDIF(UNIX)
ADD_LIBRARY(libmysql SHARED ${LIBMYSQL_SOURCES})
TARGET_LINK_LIBRARIES(libmysql ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} ${OPENSSL_LIBRARIES} zlib)
TARGET_LINK_LIBRARIES(libmysql ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} zlib)
IF(OPENSSL_LIBRARIES)
TARGET_LINK_LIBRARIES(libmysql ${OPENSSL_LIBRARIES})
ENDIF(OPENSSL_LIBRARIES)
IF(WIN32)
TARGET_LINK_LIBRARIES(libmysql ws2_32)

View File

@@ -1,4 +1,4 @@
/* Copyright (C) 2010, 2011 Sergei Golubchik and Monty Program Ab
/* Copyright (C) 2010 - 2012 Sergei Golubchik and Monty Program Ab
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public

View File

@@ -1950,7 +1950,7 @@ static void mysql_close_memory(MYSQL *mysql)
my_free(mysql->passwd,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->server_version,MYF(MY_ALLOW_ZERO_PTR));
mysql->server_version=mysql->user=mysql->passwd=mysql->db=0;
mysql->host_info= mysql->server_version=mysql->user=mysql->passwd=mysql->db=0;
mysql_close_options(mysql);
}

View File

@@ -1,5 +1,5 @@
/****************************************************************************
Copyright (C) 2011 Monty Program AB
Copyright (C) 2012 Monty Program AB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public

View File

@@ -1,5 +1,5 @@
/****************************************************************************
Copyright (C) 2011 Monty Program AB
Copyright (C) 2012 Monty Program AB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public

View File

@@ -1,5 +1,5 @@
/****************************************************************************
Copyright (C) 2011 Monty Program AB
Copyright (C) 2012 Monty Program AB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public

View File

@@ -1,5 +1,5 @@
/****************************************************************************
Copyright (C) 2011 Monty Program AB
Copyright (C) 2012 Monty Program AB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public

View File

@@ -10,6 +10,9 @@ FOREACH (dep ${libmysql_LIB_DEPENDS})
ENDFOREACH(dep)
IF(UNIX)
IF(OPENSSL_LIBRARIES)
SET(extra_dynamic_LDFLAGS "${extra_dynamic_LDFLAGS} -lssl")
ENDIF(OPENSSL_LIBRARIES)
IF(DL_LIBRARY)
SET(extra_dynamic_LDFLAGS "${extra_dynamic_LDFLAGS} -ldl")
ENDIF(DL_LIBRARY)