summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am2
-rw-r--r--include/my_global.h10
-rw-r--r--include/my_sys.h4
-rw-r--r--include/my_valgrind.h38
-rw-r--r--include/mysql/plugin.h45
-rw-r--r--include/mysql/plugin_auth.h.pp3
6 files changed, 72 insertions, 30 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index bb364586ac1..8a0b4610a90 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -26,7 +26,7 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
my_pthread.h my_no_pthread.h \
mysql/plugin_auth.h mysql/client_plugin.h \
mysql/plugin_auth_common.h \
- decimal.h errmsg.h my_global.h my_net.h \
+ decimal.h errmsg.h my_global.h my_valgrind.h my_net.h \
my_getopt.h sslopt-longopts.h my_dir.h \
sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
m_ctype.h my_attribute.h $(HEADERS_GEN_CONFIGURE) \
diff --git a/include/my_global.h b/include/my_global.h
index 4f318988330..8940c453573 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -566,18 +566,14 @@ int __void__;
#define LINT_INIT(var)
#endif
+#include <my_valgrind.h>
+
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(HAVE_valgrind)
#define VALGRIND_OR_LINT_INIT(var) var=0
#else
#define VALGRIND_OR_LINT_INIT(var)
#endif
-#ifdef HAVE_valgrind
-#define IF_VALGRIND(A,B) (A)
-#else
-#define IF_VALGRIND(A,B) (B)
-#endif
-
#ifdef _WIN32
#define SO_EXT ".dll"
#elif defined(__APPLE__)
@@ -780,7 +776,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#endif
#define MY_NFILE 64 /* This is only used to save filenames */
#ifndef OS_FILE_LIMIT
-#define OS_FILE_LIMIT 65535
+#define OS_FILE_LIMIT UINT_MAX
#endif
/* #define EXT_IN_LIBNAME */
diff --git a/include/my_sys.h b/include/my_sys.h
index 749b6a3bc78..3c492e661d3 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -145,7 +145,6 @@ extern int NEAR my_errno; /* Last error in mysys */
#define my_memdup(A,B,C) _my_memdup((A),(B), __FILE__,__LINE__,C)
#define my_strdup(A,C) _my_strdup((A), __FILE__,__LINE__,C)
#define my_strndup(A,B,C) _my_strndup((A),(B),__FILE__,__LINE__,C)
-#define TRASH(A,B) bfill(A, B, 0x8F)
#define QUICK_SAFEMALLOC sf_malloc_quick=1
#define NORMAL_SAFEMALLOC sf_malloc_quick=0
extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick;
@@ -173,7 +172,6 @@ extern char *my_strndup(const char *from, size_t length,
#define CALLER_INFO_PROTO /* nothing */
#define CALLER_INFO /* nothing */
#define ORIG_CALLER_INFO /* nothing */
-#define TRASH(A,B) /* nothing */
#endif
#if defined(ENABLED_DEBUG_SYNC)
@@ -1007,7 +1005,7 @@ extern my_bool resolve_charset(const char *cs_name,
extern my_bool resolve_collation(const char *cl_name,
CHARSET_INFO *default_cl,
CHARSET_INFO **cl);
-
+extern void free_charsets(void);
extern char *get_charsets_dir(char *buf);
extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
extern my_bool init_compiled_charsets(myf flags);
diff --git a/include/my_valgrind.h b/include/my_valgrind.h
new file mode 100644
index 00000000000..301f9f85464
--- /dev/null
+++ b/include/my_valgrind.h
@@ -0,0 +1,38 @@
+/* Copyright (C) 2010 Monty Program Ab
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+
+/* Some defines to make it easier to use valgrind */
+
+#ifdef HAVE_valgrind
+#define IF_VALGRIND(A,B) (A)
+#else
+#define IF_VALGRIND(A,B) (B)
+#endif
+
+#if defined(HAVE_valgrind)&& defined(HAVE_VALGRIND_MEMCHECK_H)
+#include <valgrind/memcheck.h>
+#else
+#define VALGRIND_MAKE_MEM_DEFINED(addr, size) do { } while(0)
+#define VALGRIND_MAKE_MEM_NOACCESS(addr, size) do { } while(0)
+#ifdef SAFEMALLOC
+#define VALGRIND_MAKE_MEM_UNDEFINED(addr, size) bfill(addr, size, 0x8F)
+#else
+#define VALGRIND_MAKE_MEM_UNDEFINED(addr, size) do { } while(0)
+#endif /* SAFEMALLOC */
+#endif /* HAVE_valgrind */
+
+/* Compatibility with old source */
+#define TRASH(A,B) VALGRIND_MAKE_MEM_UNDEFINED(A, B)
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 144d7547100..835e691daf3 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -423,12 +423,12 @@ struct st_mysql_plugin
int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */
void *info; /* pointer to type-specific plugin descriptor */
const char *name; /* plugin name */
- const char *author; /* plugin author (for SHOW PLUGINS) */
- const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
+ const char *author; /* plugin author (for I_S.PLUGINS) */
+ const char *descr; /* general descriptive text (for I_S.PLUGINS) */
int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
int (*init)(void *); /* the function to invoke when plugin is loaded */
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
- unsigned int version; /* plugin version (for SHOW PLUGINS) */
+ unsigned int version; /* plugin version (for I_S.PLUGINS) */
struct st_mysql_show_var *status_vars;
struct st_mysql_sys_var **system_vars;
void * __reserved1; /* reserved for dependency checking */
@@ -810,30 +810,37 @@ void mysql_query_cache_invalidate4(MYSQL_THD thd,
const char *key, unsigned int key_length,
int using_trx);
-#ifdef __cplusplus
-}
-#endif
-#ifdef __cplusplus
/**
Provide a handler data getter to simplify coding
*/
-inline
-void *
-thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton)
-{
- return *thd_ha_data(thd, hton);
-}
+void *thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton);
+
/**
Provide a handler data setter to simplify coding
+
+ @details
+ Set ha_data pointer (storage engine per-connection information).
+
+ To avoid unclean deactivation (uninstall) of storage engine plugin
+ in the middle of transaction, additional storage engine plugin
+ lock is acquired.
+
+ If ha_data is not null and storage engine plugin was not locked
+ by thd_set_ha_data() in this connection before, storage engine
+ plugin gets locked.
+
+ If ha_data is null and storage engine plugin was locked by
+ thd_set_ha_data() in this connection before, storage engine
+ plugin lock gets released.
+
+ If handlerton::close_connection() didn't reset ha_data, server does
+ it immediately after calling handlerton::close_connection().
*/
-inline
-void
-thd_set_ha_data(const MYSQL_THD thd, const struct handlerton *hton,
- const void *ha_data)
-{
- *thd_ha_data(thd, hton)= (void*) ha_data;
+void thd_set_ha_data(MYSQL_THD thd, const struct handlerton *hton,
+ const void *ha_data);
+#ifdef __cplusplus
}
#endif
diff --git a/include/mysql/plugin_auth.h.pp b/include/mysql/plugin_auth.h.pp
index 93faae35f43..7db3dbb4715 100644
--- a/include/mysql/plugin_auth.h.pp
+++ b/include/mysql/plugin_auth.h.pp
@@ -178,6 +178,9 @@ void thd_get_xid(const void* thd, MYSQL_XID *xid);
void mysql_query_cache_invalidate4(void* thd,
const char *key, unsigned int key_length,
int using_trx);
+void *thd_get_ha_data(const void* thd, const struct handlerton *hton);
+void thd_set_ha_data(void* thd, const struct handlerton *hton,
+ const void *ha_data);
#include <mysql/plugin_auth_common.h>
typedef struct st_plugin_vio_info
{