summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-11-27 17:50:08 +0100
committerSergei Golubchik <sergii@pisem.net>2011-11-27 17:50:08 +0100
commitdfc1901e806bdda129b8943585f2ccfc8c207322 (patch)
tree5f04d49beb42adafd5fb860d62831e5f3b3c643d
parenteffed09bd7d8081704eaa017060da84c32e3bf29 (diff)
downloadmariadb-git-dfc1901e806bdda129b8943585f2ccfc8c207322.tar.gz
compilation fixes
cmake/maintainer.cmake: don't do -Werror just yet config.h.cmake: according to MSDN PSAPI_VERSION should be 1 in a portable application mysys/my_thr_init.c: first, reset THR_KEY_mysys, and then free dbug data, because dbug data are automacially created on the next dbug call, unless THR_KEY_mysys is null.
-rw-r--r--cmake/maintainer.cmake2
-rw-r--r--config.h.cmake4
-rw-r--r--include/my_sys.h2
-rw-r--r--mysys/my_thr_init.c6
-rw-r--r--sql/create_options.cc2
-rw-r--r--sql/sql_show.cc2
6 files changed, 9 insertions, 9 deletions
diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake
index a91905a281b..357fbd97263 100644
--- a/cmake/maintainer.cmake
+++ b/cmake/maintainer.cmake
@@ -18,7 +18,7 @@ INCLUDE(CheckCCompilerFlag)
# Setup GCC (GNU C compiler) warning options.
MACRO(SET_MYSQL_MAINTAINER_GNU_C_OPTIONS)
SET(MY_MAINTAINER_WARNINGS
- "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror")
+ "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing")
CHECK_C_COMPILER_FLAG("-Wdeclaration-after-statement"
HAVE_DECLARATION_AFTER_STATEMENT)
IF(HAVE_DECLARATION_AFTER_STATEMENT)
diff --git a/config.h.cmake b/config.h.cmake
index 8da37135cc1..c3ff6be90e4 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -502,9 +502,7 @@
# define HAVE_SETENV
#define setenv(a,b,c) _putenv_s(a,b)
#endif
-
-
-
+#define PSAPI_VERSION 1 /* for GetProcessMemoryInfo() */
/*
MySQL features
diff --git a/include/my_sys.h b/include/my_sys.h
index 554ee487a4f..4330faa2fa9 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -194,7 +194,7 @@ extern void my_large_free(uchar *ptr);
#endif /* HAVE_ALLOCA */
#define my_safe_alloca(size, min_length) ((size <= min_length) ? my_alloca(size) : my_malloc(size,MYF(MY_FAE)))
-#define my_safe_afree(ptr, size, min_length) ((size <= min_length) ? (void)0 : my_free(ptr))
+#define my_safe_afree(ptr, size, min_length) ((size <= min_length) ? my_afree(ptr) : my_free(ptr))
#ifndef errno /* did we already get it? */
#ifdef HAVE_ERRNO_AS_DEFINE
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index ee9bc91e910..e2e03cc37a8 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -355,13 +355,16 @@ void my_thread_end(void)
PSI_server->delete_current_thread();
#endif
+ DBUG_POP();
+
+ pthread_setspecific(THR_KEY_mysys,0);
+
if (tmp && tmp->init)
{
#if !defined(DBUG_OFF)
/* tmp->dbug is allocated inside DBUG library */
if (tmp->dbug)
{
- DBUG_POP();
free(tmp->dbug);
tmp->dbug=0;
}
@@ -384,7 +387,6 @@ void my_thread_end(void)
TRASH(tmp, sizeof(*tmp));
free(tmp);
}
- pthread_setspecific(THR_KEY_mysys,0);
}
struct st_my_thread_var *_my_thread_var(void)
diff --git a/sql/create_options.cc b/sql/create_options.cc
index 8e46bb583a5..9a6f6b5cf7c 100644
--- a/sql/create_options.cc
+++ b/sql/create_options.cc
@@ -547,7 +547,7 @@ my_bool engine_table_options_frm_read(const uchar *buff, uint length,
TABLE_SHARE *share)
{
const uchar *buff_end= buff + length;
- engine_option_value *end;
+ engine_option_value *UNINIT_VAR(end);
MEM_ROOT *root= &share->mem_root;
uint count;
DBUG_ENTER("engine_table_options_frm_read");
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 5666225a9d1..d098bca4776 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -4620,7 +4620,7 @@ static void store_column_type(TABLE *table, Field *field, CHARSET_INFO *cs,
base_type [(dimension)] [unsigned] [zerofill].
For DATA_TYPE column we extract only base type.
*/
- tmp_buff= strchr(column_type.ptr(), '(');
+ tmp_buff= strchr(column_type.c_ptr_safe(), '(');
if (!tmp_buff)
/*
if there is no dimention part then check the presence of