summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2009-09-08 00:50:10 +0400
committerSergey Petrunya <psergey@askmonty.org>2009-09-08 00:50:10 +0400
commit29f0dcb56337a3e352ad7a70dcff6b25bb605325 (patch)
tree84935c21dc958724ae7dcbeeca0c0f08986fc430 /include
parent915a624cbcb58a10a2cfb2e2e4fd5029191fa86a (diff)
parent8a2454f8e9fce648272577fcf8006ae6e6806cf9 (diff)
downloadmariadb-git-29f0dcb56337a3e352ad7a70dcff6b25bb605325.tar.gz
Merge MySQL->MariaDB
* Finished Monty and Jani's merge * Some InnoDB tests still fail (because it's old xtradb code run against newer testsuite). They are expected to go after mergning with the latest xtradb.
Diffstat (limited to 'include')
-rw-r--r--include/config-netware.h2
-rw-r--r--include/config-win.h13
-rw-r--r--include/hash.h2
-rw-r--r--include/m_ctype.h6
-rw-r--r--include/my_base.h3
-rw-r--r--include/my_global.h100
-rw-r--r--include/my_sys.h10
-rw-r--r--include/myisamchk.h4
-rw-r--r--include/myisammrg.h4
-rw-r--r--include/mysql/plugin.h16
-rw-r--r--include/thr_lock.h4
-rw-r--r--include/violite.h10
12 files changed, 108 insertions, 66 deletions
diff --git a/include/config-netware.h b/include/config-netware.h
index e6bddee034e..4b9e1437170 100644
--- a/include/config-netware.h
+++ b/include/config-netware.h
@@ -131,7 +131,7 @@ extern "C" {
#define DEFAULT_BASEDIR "sys:/"
#define SHAREDIR "share/"
#define DEFAULT_CHARSET_HOME "sys:/mysql/"
-#define DATADIR "data/"
+#define MYSQL_DATADIR "data/"
/* 64-bit file system calls */
#define SIZEOF_OFF_T 8
diff --git a/include/config-win.h b/include/config-win.h
index bab774e9077..4fd00b38e1d 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -17,15 +17,6 @@
#define BIG_TABLES
-#ifdef __WIN2000__
-/* We have to do this define before including windows.h to get the AWE API
-functions */
-#define _WIN32_WINNT 0x0500
-#else
-/* Get NT 4.0 functions */
-#define _WIN32_WINNT 0x0400
-#endif
-
#if defined(_MSC_VER) && _MSC_VER >= 1400
/* Avoid endless warnings about sprintf() etc. being unsafe. */
#define _CRT_SECURE_NO_DEPRECATE 1
@@ -354,13 +345,15 @@ inline ulonglong double2ulonglong(double d)
#ifdef _CUSTOMCONFIG_
#include <custom_conf.h>
#else
+#ifndef CMAKE_CONFIGD
#define DEFAULT_MYSQL_HOME "c:\\mysql"
-#define DATADIR "c:\\mysql\\data"
+#define MYSQL_DATADIR "c:\\mysql\\data"
#define PACKAGE "mysql"
#define DEFAULT_BASEDIR "C:\\"
#define SHAREDIR "share"
#define DEFAULT_CHARSET_HOME "C:/mysql/"
#endif
+#endif
#ifndef DEFAULT_HOME_ENV
#define DEFAULT_HOME_ENV MYSQL_HOME
#endif
diff --git a/include/hash.h b/include/hash.h
index f649b39a3cb..85d8f18815f 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -108,7 +108,7 @@ my_bool my_hash_check(HASH *hash); /* Only in debug library */
my_bool my_hash_iterate(HASH *hash, my_hash_walk_action action, void *argument);
#define my_hash_clear(H) bzero((char*) (H), sizeof(*(H)))
-#define my_hash_inited(H) ((H)->array.buffer != 0)
+#define my_hash_inited(H) ((H)->blength != 0)
#define my_hash_init_opt(A,B,C,D,E,F,G,H) \
(!my_hash_inited(A) && _my_hash_init(A,0,B,C,D,E,F,G, H CALLER_INFO))
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 51ad052cd31..37e60af3e07 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -286,7 +286,7 @@ typedef struct charset_info_st
#define ILLEGAL_CHARSET_INFO_NUMBER (~0U)
-extern CHARSET_INFO my_charset_bin;
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin;
extern CHARSET_INFO my_charset_big5_chinese_ci;
extern CHARSET_INFO my_charset_big5_bin;
extern CHARSET_INFO my_charset_cp932_japanese_ci;
@@ -299,7 +299,7 @@ extern CHARSET_INFO my_charset_gb2312_chinese_ci;
extern CHARSET_INFO my_charset_gb2312_bin;
extern CHARSET_INFO my_charset_gbk_chinese_ci;
extern CHARSET_INFO my_charset_gbk_bin;
-extern CHARSET_INFO my_charset_latin1;
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1;
extern CHARSET_INFO my_charset_latin1_german2_ci;
extern CHARSET_INFO my_charset_latin1_bin;
extern CHARSET_INFO my_charset_latin2_czech_ci;
@@ -316,7 +316,7 @@ extern CHARSET_INFO my_charset_utf8_general_ci;
extern CHARSET_INFO my_charset_utf8_unicode_ci;
extern CHARSET_INFO my_charset_utf8_bin;
extern CHARSET_INFO my_charset_cp1250_czech_ci;
-extern CHARSET_INFO my_charset_filename;
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename;
/* declarations for simple charsets */
extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t,
diff --git a/include/my_base.h b/include/my_base.h
index a2079f6745c..59929fe4d49 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -450,7 +450,8 @@ enum ha_base_keytype {
#define HA_ERR_FILE_TOO_SHORT 175 /* File too short */
#define HA_ERR_WRONG_CRC 176 /* Wrong CRC on page */
#define HA_ERR_ROW_NOT_VISIBLE 177
-#define HA_ERR_LAST 177 /* Copy of last error nr */
+#define HA_ERR_TOO_MANY_CONCURRENT_TRXS 178 /*Too many active concurrent transactions */
+#define HA_ERR_LAST 178 /* Copy of last error nr */
/* Number of different errors */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
diff --git a/include/my_global.h b/include/my_global.h
index b350ece971b..e808ce04015 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -281,7 +281,7 @@
#endif
/* The client defines this to avoid all thread code */
-#if defined(UNDEF_THREADS_HACK)
+#if defined(MYSQL_CLIENT_NO_THREADS) || defined(UNDEF_THREADS_HACK)
#undef THREAD
#undef HAVE_LINUXTHREADS
#undef HAVE_NPTL
@@ -594,40 +594,6 @@ typedef unsigned short ushort;
#define test_all_bits(a,b) (((a) & (b)) == (b))
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
-#ifndef HAVE_RINT
-/**
- All integers up to this number can be represented exactly as double precision
- values (DBL_MANT_DIG == 53 for IEEE 754 hardware).
-*/
-#define MAX_EXACT_INTEGER ((1LL << DBL_MANT_DIG) - 1)
-
-/**
- rint(3) implementation for platforms that do not have it.
- Always rounds to the nearest integer with ties being rounded to the nearest
- even integer to mimic glibc's rint() behavior in the "round-to-nearest"
- FPU mode. Hardware-specific optimizations are possible (frndint on x86).
- Unlike this implementation, hardware will also honor the FPU rounding mode.
-*/
-
-static inline double rint(double x)
-{
- double f, i;
- f = modf(x, &i);
- /*
- All doubles with absolute values > MAX_EXACT_INTEGER are even anyway,
- no need to check it.
- */
- if (x > 0.0)
- i += (double) ((f > 0.5) || (f == 0.5 &&
- i <= (double) MAX_EXACT_INTEGER &&
- (longlong) i % 2));
- else
- i -= (double) ((f < -0.5) || (f == -0.5 &&
- i >= (double) -MAX_EXACT_INTEGER &&
- (longlong) i % 2));
- return i;
-}
-#endif /* HAVE_RINT */
/* Define some general constants */
#ifndef TRUE
@@ -920,10 +886,20 @@ typedef SOCKET_SIZE_TYPE size_socket;
#endif
#ifdef HAVE_ISINF
-/* isinf() can be used in both C and C++ code */
-#define my_isinf(X) isinf(X)
+/* Check if C compiler is affected by GCC bug #39228 */
+#if !defined(__cplusplus) && defined(HAVE_BROKEN_ISINF)
+/* Force store/reload of the argument to/from a 64-bit double */
+static inline double my_isinf(double x)
+{
+ volatile double t= x;
+ return isinf(t);
+}
#else
-#define my_isinf(X) (!isfinite(X) && !isnan(X))
+/* System-provided isinf() is available and safe to use */
+#define my_isinf(X) isinf(X)
+#endif
+#else /* !HAVE_ISINF */
+#define my_isinf(X) (!finite(X) && !isnan(X))
#endif
/* Define missing math constants. */
@@ -1583,6 +1559,54 @@ inline void operator delete[](void*, void*) { /* Do nothing */ }
#define bool In_C_you_should_use_my_bool_instead()
#endif
+#ifndef HAVE_RINT
+/**
+ All integers up to this number can be represented exactly as double precision
+ values (DBL_MANT_DIG == 53 for IEEE 754 hardware).
+*/
+#define MAX_EXACT_INTEGER ((1LL << DBL_MANT_DIG) - 1)
+
+/**
+ rint(3) implementation for platforms that do not have it.
+ Always rounds to the nearest integer with ties being rounded to the nearest
+ even integer to mimic glibc's rint() behavior in the "round-to-nearest"
+ FPU mode. Hardware-specific optimizations are possible (frndint on x86).
+ Unlike this implementation, hardware will also honor the FPU rounding mode.
+*/
+
+static inline double rint(double x)
+{
+ double f, i;
+ f = modf(x, &i);
+ /*
+ All doubles with absolute values > MAX_EXACT_INTEGER are even anyway,
+ no need to check it.
+ */
+ if (x > 0.0)
+ i += (double) ((f > 0.5) || (f == 0.5 &&
+ i <= (double) MAX_EXACT_INTEGER &&
+ (longlong) i % 2));
+ else
+ i -= (double) ((f < -0.5) || (f == -0.5 &&
+ i >= (double) -MAX_EXACT_INTEGER &&
+ (longlong) i % 2));
+ return i;
+}
+#endif /* HAVE_RINT */
+
+/*
+ MYSQL_PLUGIN_IMPORT macro is used to export mysqld data
+ (i.e variables) for usage in storage engine loadable plugins.
+ Outside of Windows, it is dummy.
+*/
+#ifndef MYSQL_PLUGIN_IMPORT
+#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN))
+#define MYSQL_PLUGIN_IMPORT __declspec(dllimport)
+#else
+#define MYSQL_PLUGIN_IMPORT
+#endif
+#endif
+
/* Provide __func__ macro definition for platforms that miss it. */
#if __STDC_VERSION__ < 199901L
# if __GNUC__ >= 2
diff --git a/include/my_sys.h b/include/my_sys.h
index ad23abafa0a..315454062f1 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -229,8 +229,8 @@ extern uint my_large_page_size;
#endif
/* charsets */
-extern CHARSET_INFO *default_charset_info;
-extern CHARSET_INFO *all_charsets[256];
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info;
+extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[256];
extern CHARSET_INFO compiled_charsets[];
/* statistics */
@@ -245,8 +245,8 @@ extern void (*my_sigtstp_cleanup)(void),
(*my_sigtstp_restart)(void),
(*my_abort_hook)(int);
/* Executed when comming from shell */
-extern int NEAR my_umask, /* Default creation mask */
- NEAR my_umask_dir,
+extern MYSQL_PLUGIN_IMPORT int NEAR my_umask; /* Default creation mask */
+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 */
@@ -525,7 +525,7 @@ typedef int (*qsort2_cmp)(const void *, const void *, const void *);
((info)->write_pos + (Count) <=(info)->write_end ?\
(memcpy((info)->write_pos, (Buffer), (size_t)(Count)),\
((info)->write_pos+=(Count)),0) : \
- (*(info)->write_function)((info),(Buffer),(Count)))
+ (*(info)->write_function)((info),(uchar *)(Buffer),(Count)))
#define my_b_get(info) \
((info)->read_pos != (info)->read_end ?\
diff --git a/include/myisamchk.h b/include/myisamchk.h
index f4651b81f8b..6d2d887cf68 100644
--- a/include/myisamchk.h
+++ b/include/myisamchk.h
@@ -138,8 +138,8 @@ typedef struct st_handler_check_param
/* Following is used to check if rows are visible */
ulonglong max_trid, max_found_trid;
ulonglong not_visible_rows_found;
-
- size_t use_buffers, read_buffer_length, write_buffer_length;
+ ulonglong use_buffers; /* Used as param to getopt() */
+ size_t read_buffer_length, write_buffer_length;
size_t sort_buffer_length, sort_key_blocks;
ulong rec_per_key_part[HA_MAX_KEY_SEG * HA_MAX_POSSIBLE_KEY];
double new_rec_per_key_part[HA_MAX_KEY_SEG * HA_MAX_POSSIBLE_KEY];
diff --git a/include/myisammrg.h b/include/myisammrg.h
index dafae157ee0..31ce3fa47b8 100644
--- a/include/myisammrg.h
+++ b/include/myisammrg.h
@@ -47,6 +47,7 @@ typedef struct st_mymerge_info /* Struct from h_info */
ulonglong deleted; /* Deleted records in database */
ulonglong recpos; /* Pos for last used record */
ulonglong data_file_length;
+ ulonglong dupp_key_pos; /* Offset of the Duplicate key in the merge table */
uint reclength; /* Recordlength */
int errkey; /* With key was dupplicated on err */
uint options; /* HA_OPTION_... used */
@@ -88,7 +89,8 @@ extern MYRG_INFO *myrg_parent_open(const char *parent_name,
void *callback_param);
extern int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
MI_INFO *(*callback)(void*),
- void *callback_param);
+ void *callback_param,
+ my_bool *need_compat_check);
extern int myrg_detach_children(MYRG_INFO *m_info);
extern int myrg_panic(enum ha_panic_function function);
extern int myrg_rfirst(MYRG_INFO *file,uchar *buf,int inx);
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index fa38b90046d..35af8a021f3 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -16,6 +16,16 @@
#ifndef _my_plugin_h
#define _my_plugin_h
+
+/*
+ On Windows, exports from DLL need to be declared
+*/
+#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN))
+#define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport)
+#else
+#define MYSQL_PLUGIN_EXPORT
+#endif
+
#ifdef __cplusplus
class THD;
class Item;
@@ -90,9 +100,9 @@ int PSIZE= sizeof(struct st_mysql_plugin); \
struct st_mysql_plugin DECLS[]= {
#else
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
-int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
-int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \
-struct st_mysql_plugin _mysql_plugin_declarations_[]= {
+MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
+MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \
+MYSQL_PLUGIN_EXPORT struct st_mysql_plugin _mysql_plugin_declarations_[]= {
#endif
#define mysql_declare_plugin(NAME) \
diff --git a/include/thr_lock.h b/include/thr_lock.h
index c523207638f..14d93a47e5a 100644
--- a/include/thr_lock.h
+++ b/include/thr_lock.h
@@ -27,6 +27,10 @@ extern "C" {
struct st_thr_lock;
extern ulong locks_immediate,locks_waited ;
+/*
+ Important: if a new lock type is added, a matching lock description
+ must be added to sql_test.cc's lock_descriptions array.
+*/
enum thr_lock_type { TL_IGNORE=-1,
TL_UNLOCK, /* UNLOCK ANY LOCK */
/*
diff --git a/include/violite.h b/include/violite.h
index ef073592afe..7f017635f31 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -110,6 +110,14 @@ typedef my_socket YASSL_SOCKET_T;
#include <openssl/ssl.h>
#include <openssl/err.h>
+enum enum_ssl_init_error
+{
+ SSL_INITERR_NOERROR= 0, SSL_INITERR_CERT, SSL_INITERR_KEY,
+ SSL_INITERR_NOMATCH, SSL_INITERR_BAD_PATHS, SSL_INITERR_CIPHERS,
+ SSL_INITERR_MEMFAIL, SSL_INITERR_LASTERR
+};
+const char* sslGetErrString(enum enum_ssl_init_error err);
+
struct st_VioSSLFd
{
SSL_CTX *ssl_context;
@@ -125,7 +133,7 @@ struct st_VioSSLFd
struct st_VioSSLFd
*new_VioSSLAcceptorFd(const char *key_file, const char *cert_file,
const char *ca_file,const char *ca_path,
- const char *cipher);
+ const char *cipher, enum enum_ssl_init_error* error);
void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd);
#endif /* HAVE_OPENSSL */