summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@sun.com>2010-06-06 13:19:29 +0200
committerJon Olav Hauglid <jon.hauglid@sun.com>2010-06-06 13:19:29 +0200
commit142a162c665704ce5b4d5b671d05a068661c088a (patch)
treedef1ebab09889a8f09a9fcd074c8a672689376af /include
parentcbf4019a1b3ec82bdcd9a65db114908a920fb01c (diff)
parent60a9d9bbb94ac03159bcc2d75b649abb1c9dc956 (diff)
downloadmariadb-git-142a162c665704ce5b4d5b671d05a068661c088a.tar.gz
manual merge from mysql-trunk-bugfixing
Conflicts: Text conflict in mysql-test/r/archive.result Contents conflict in mysql-test/r/innodb_bug38231.result Text conflict in mysql-test/r/mdl_sync.result Text conflict in mysql-test/suite/binlog/t/disabled.def Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result Text conflict in mysql-test/t/archive.test Contents conflict in mysql-test/t/innodb_bug38231.test Text conflict in mysql-test/t/mdl_sync.test Text conflict in sql/sp_head.cc Text conflict in sql/sql_show.cc Text conflict in sql/table.cc Text conflict in sql/table.h
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am3
-rw-r--r--include/m_string.h3
-rw-r--r--include/my_alloc.h9
-rw-r--r--include/my_base.h2
-rw-r--r--include/my_global.h18
-rw-r--r--include/my_pthread.h1
-rw-r--r--include/my_sys.h25
-rw-r--r--include/mysql/plugin.h39
-rw-r--r--include/mysql/plugin.h.pp3
-rw-r--r--include/mysql_com.h10
10 files changed, 81 insertions, 32 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index da50ecf2178..e610a8e325c 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -96,6 +96,3 @@ endif
probes_mysql_nodtrace.h: $(DTRACEPROVIDER)
@PERL@ $(top_srcdir)/scripts/dheadgen.pl -f $(DTRACEPROVIDER) > $@
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/include/m_string.h b/include/m_string.h
index 7bd39e7483f..1a2a508edfb 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -127,9 +127,6 @@ extern size_t bcmp(const uchar *s1,const uchar *s2,size_t len);
extern size_t my_bcmp(const uchar *s1,const uchar *s2,size_t len);
#undef bcmp
#define bcmp(A,B,C) my_bcmp((A),(B),(C))
-#define bzero_if_purify(A,B) bzero(A,B)
-#else
-#define bzero_if_purify(A,B)
#endif /* HAVE_purify */
#ifndef bmove512
diff --git a/include/my_alloc.h b/include/my_alloc.h
index 93b7438a1df..4b1ffd3d444 100644
--- a/include/my_alloc.h
+++ b/include/my_alloc.h
@@ -23,6 +23,10 @@
#define ALLOC_MAX_BLOCK_TO_DROP 4096
#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct st_used_mem
{ /* struct for once_alloc (block) */
struct st_used_mem *next; /* Next block in use */
@@ -48,4 +52,9 @@ typedef struct st_mem_root
void (*error_handler)(void);
} MEM_ROOT;
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/include/my_base.h b/include/my_base.h
index 7766d4165a2..28dc55b1b84 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -562,6 +562,8 @@ typedef ulong ha_rows;
#define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2)
/* invalidator function reference for Query Cache */
+C_MODE_START
typedef void (* invalidator_by_filename)(const char * filename);
+C_MODE_END
#endif /* _my_base_h */
diff --git a/include/my_global.h b/include/my_global.h
index 094853cb642..c21a8a1f9ea 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -73,6 +73,11 @@
#define C_MODE_END
#endif
+#ifdef __cplusplus
+#define CPP_UNNAMED_NS_START namespace {
+#define CPP_UNNAMED_NS_END }
+#endif
+
#if defined(_WIN32)
#include <my_config.h>
#elif defined(__NETWARE__)
@@ -863,7 +868,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#endif
#ifndef OS_FILE_LIMIT
-#define OS_FILE_LIMIT 65535
+#define OS_FILE_LIMIT UINT_MAX
#endif
/* #define EXT_IN_LIBNAME */
@@ -1070,6 +1075,17 @@ typedef long long my_ptrdiff_t;
#define MY_DIV_UP(A, B) (((A) + (B) - 1) / (B))
#define MY_ALIGNED_BYTE_ARRAY(N, S, T) T N[MY_DIV_UP(S, sizeof(T))]
+#ifdef __cplusplus
+template <size_t sz> struct Aligned_char_array
+{
+ union {
+ void *v; // Ensures alignment.
+ char arr[sz]; // The actual buffer.
+ } u;
+ void* arr() { return &u.arr[0]; }
+};
+#endif /* __cplusplus */
+
/*
Custom version of standard offsetof() macro which can be used to get
offsets of members in class for non-POD types (according to the current
diff --git a/include/my_pthread.h b/include/my_pthread.h
index e41abba950e..ea37f6e6b92 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -712,7 +712,6 @@ extern my_bool my_thread_init(void);
extern void my_thread_end(void);
extern const char *my_thread_name(void);
extern my_thread_id my_thread_dbug_id(void);
-extern int pthread_no_free(void *);
extern int pthread_dummy(int);
/* All thread specific variables are in the following struct */
diff --git a/include/my_sys.h b/include/my_sys.h
index ac10628f943..cca4d713ca6 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -28,6 +28,19 @@ typedef struct my_aio_result {
} my_aio_result;
#endif
+#ifdef HAVE_VALGRIND
+# include <valgrind/memcheck.h>
+# define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len)
+# define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len)
+# define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len)
+# define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len)
+#else /* HAVE_VALGRIND */
+# define MEM_UNDEFINED(a,len) ((void) 0)
+# define MEM_NOACCESS(a,len) ((void) 0)
+# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
+# define MEM_CHECK_DEFINED(a,len) ((void) 0)
+#endif /* HAVE_VALGRIND */
+
#ifndef THREAD
extern int NEAR my_errno; /* Last error in mysys */
#else
@@ -41,8 +54,6 @@ extern int NEAR my_errno; /* Last error in mysys */
#include <malloc.h> /*for alloca*/
#endif
-#define MYSYS_PROGRAM_USES_CURSES() { error_handler_hook = my_message_curses; mysys_uses_curses=1; }
-#define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses; mysys_uses_curses=0;}
#define MY_INIT(name); { my_progname= name; my_init(); }
/**
@@ -156,7 +167,7 @@ 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 TRASH(A,B) do { bfill(A, B, 0x8F); MEM_UNDEFINED(A, B); } while (0)
#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;
@@ -184,7 +195,7 @@ 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 */
+#define TRASH(A,B) do{MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while (0)
#endif
#if defined(ENABLED_DEBUG_SYNC)
@@ -272,7 +283,7 @@ extern int NEAR my_umask_dir,
NEAR my_recived_signals, /* Signals we have got */
NEAR my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */
NEAR my_dont_interrupt; /* call remember_intr when set */
-extern my_bool NEAR mysys_uses_curses, my_use_symdir;
+extern my_bool NEAR my_use_symdir;
extern size_t sf_malloc_cur_memory, sf_malloc_max_memory;
extern ulong my_default_record_cache_size;
@@ -669,7 +680,6 @@ extern int nt_share_delete(const char *name,myf MyFlags);
#ifdef _WIN32
/* Windows-only functions (CRT equivalents)*/
-extern File my_sopen(const char *path, int oflag, int shflag, int pmode);
extern HANDLE my_get_osfhandle(File fd);
extern void my_osmaperr(unsigned long last_error);
#endif
@@ -698,8 +708,7 @@ extern int my_error_register(const char** (*get_errmsgs) (),
int first, int last);
extern const char **my_error_unregister(int first, int last);
extern void my_message(uint my_err, const char *str,myf MyFlags);
-extern void my_message_no_curses(uint my_err, const char *str,myf MyFlags);
-extern void my_message_curses(uint my_err, const char *str,myf MyFlags);
+extern void my_message_stderr(uint my_err, const char *str, myf MyFlags);
extern my_bool my_basic_init(void);
extern my_bool my_init(void);
extern void my_end(int infoflag);
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 567734c1d5c..19cf0ed050d 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -593,30 +593,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.h.pp b/include/mysql/plugin.h.pp
index 5dad31bd008..3a1b03742da 100644
--- a/include/mysql/plugin.h.pp
+++ b/include/mysql/plugin.h.pp
@@ -165,3 +165,6 @@ 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);
diff --git a/include/mysql_com.h b/include/mysql_com.h
index c510c12dbf7..90fe4ac1995 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -307,6 +307,16 @@ typedef struct st_net {
/** Client library sqlstate buffer. Set along with the error message. */
char sqlstate[SQLSTATE_LENGTH+1];
void *extension;
+#if defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY)
+ /*
+ Controls whether a big packet should be skipped.
+
+ Initially set to FALSE by default. Unauthenticated sessions must have
+ this set to FALSE so that the server can't be tricked to read packets
+ indefinitely.
+ */
+ my_bool skip_big_packet;
+#endif
} NET;