summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2008-04-28 19:24:05 +0300
committerunknown <monty@narttu.mysql.fi>2008-04-28 19:24:05 +0300
commit50ceea65cf18a64db017f06d2be5197807927588 (patch)
treeff5ab0c71ce5a2792c4f169a880e0174f8e194ad /include
parented5fe6d3eb5d702e2fe27de3c65c550ea0dbf17f (diff)
parentc481f6b3cf80f471321d2ef4e7c68fe9e6e5d0ca (diff)
downloadmariadb-git-50ceea65cf18a64db017f06d2be5197807927588.tar.gz
Merge mysql.com:/home/my/mysql-5.1
into mysql.com:/home/my/mysql-new BitKeeper/etc/ignore: auto-union BUILD/SETUP.sh: Auto merged CMakeLists.txt: Auto merged client/get_password.c: Auto merged client/mysqldump.c: Auto merged client/mysqltest.c: Auto merged cmd-line-utils/readline/bind.c: Auto merged cmd-line-utils/readline/display.c: Auto merged cmd-line-utils/readline/histexpand.c: Auto merged cmd-line-utils/readline/history.c: Auto merged cmd-line-utils/readline/readline.c: Auto merged cmd-line-utils/readline/text.c: Auto merged dbug/user.r: Auto merged extra/yassl/src/handshake.cpp: Auto merged include/config-win.h: Auto merged include/m_string.h: Auto merged include/my_global.h: Auto merged include/my_pthread.h: Auto merged include/mysql/plugin.h: Auto merged include/mysql_com.h: Auto merged include/thr_alarm.h: Auto merged libmysql/CMakeLists.txt: Auto merged libmysql/Makefile.shared: Auto merged libmysql/dll.c: Auto merged libmysql/get_password.c: Auto merged libmysql/libmysql.c: Auto merged libmysqld/Makefile.am: Auto merged mysql-test/lib/mtr_cases.pl: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/alter_table.result: Auto merged mysql-test/r/change_user.result: Auto merged mysql-test/r/create.result: Auto merged mysql-test/r/innodb.result: Auto merged mysql-test/r/merge.result: Auto merged mysql-test/r/mix2_myisam.result: Auto merged mysql-test/r/mysqldump.result: Auto merged mysql-test/r/query_cache.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/valgrind.supp: Auto merged mysql-test/r/view.result: Auto merged mysql-test/suite/rpl/r/rpl_events.result: Auto merged mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test: Auto merged mysql-test/t/create.test: Auto merged mysql-test/t/mysqldump.test: Auto merged mysql-test/t/query_cache.test: Auto merged mysql-test/t/subselect.test: Auto merged mysql-test/t/variables.test: Auto merged mysql-test/t/view.test: Auto merged mysys/mf_iocache.c: Auto merged mysys/mf_tempfile.c: Auto merged mysys/my_atomic.c: Auto merged mysys/my_bit.c: Auto merged mysys/my_bitmap.c: Auto merged mysys/my_compress.c: Auto merged mysys/my_create.c: Auto merged mysys/my_delete.c: Auto merged mysys/my_error.c: Auto merged mysys/my_init.c: Auto merged mysys/my_open.c: Auto merged mysys/my_realloc.c: Auto merged mysys/my_rename.c: Auto merged mysys/my_symlink.c: Auto merged mysys/my_sync.c: Auto merged mysys/my_thr_init.c: Auto merged mysys/thr_alarm.c: Auto merged mysys/thr_lock.c: Auto merged scripts/make_binary_distribution.sh: Auto merged server-tools/instance-manager/mysql_connection.cc: Auto merged sql/CMakeLists.txt: Auto merged sql/Makefile.am: Auto merged sql/events.cc: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/filesort.cc: Auto merged sql/gen_lex_hash.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/ha_partition.h: Auto merged sql/handler.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged sql/item_subselect.cc: Auto merged sql/lock.cc: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/net_serv.cc: Auto merged sql/opt_range.cc: Auto merged sql/partition_info.cc: Auto merged sql/rpl_injector.cc: Auto merged sql/set_var.cc: Auto merged sql/slave.cc: Auto merged sql/slave.h: Auto merged sql/sp_head.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_plugin.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_test.cc: Auto merged sql/sql_union.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.cc: Auto merged sql/table.h: Auto merged sql/unireg.cc: Auto merged sql/share/errmsg.txt: Auto merged storage/csv/ha_tina.cc: Auto merged storage/csv/ha_tina.h: Auto merged storage/myisam/CMakeLists.txt: Auto merged storage/myisam/ft_boolean_search.c: Auto merged storage/myisam/ft_eval.c: Auto merged storage/myisam/ft_nlq_search.c: Auto merged storage/myisam/ft_parser.c: Auto merged storage/myisam/ft_static.c: Auto merged storage/myisam/ft_stopwords.c: Auto merged storage/myisam/ft_test1.c: Auto merged storage/myisam/ft_update.c: Auto merged storage/myisam/ha_myisam.cc: Auto merged storage/myisam/mi_check.c: Auto merged storage/myisam/mi_create.c: Auto merged storage/myisam/mi_delete.c: Auto merged storage/myisam/mi_delete_all.c: Auto merged storage/myisam/mi_dynrec.c: Auto merged storage/myisam/mi_key.c: Auto merged storage/myisam/mi_packrec.c: Auto merged storage/myisam/mi_range.c: Auto merged storage/myisam/mi_search.c: Auto merged storage/myisam/mi_test1.c: Auto merged storage/myisam/mi_test2.c: Auto merged storage/myisam/mi_test3.c: Auto merged storage/myisam/mi_unique.c: Auto merged storage/myisam/mi_write.c: Auto merged storage/myisam/myisamchk.c: Auto merged storage/myisam/myisamdef.h: Auto merged storage/myisam/myisampack.c: Auto merged storage/myisam/sort.c: Auto merged storage/myisam/sp_test.c: Auto merged support-files/mysql.spec.sh: Auto merged tests/mysql_client_test.c: Auto merged configure.in: Manual merge dbug/dbug.c: Restore to original state in Maria tree The big diff comes from a wrong pull from 5.0 -> 5.1 after backporting dbug to 5.0 from 5.1 include/Makefile.am: Manual merge include/my_atomic.h: Ignore changes include/my_base.h: Manual merge include/my_dbug.h: Use orginal my_dbug.h from maria tree include/my_handler.h: Manual merge include/my_sys.h: Manual merge include/myisam.h: Manual merge mysql-test/lib/mtr_report.pl: Manual merge mysql-test/r/myisam.result: Manual merge mysql-test/suite/binlog/r/binlog_unsafe.result: Manual merge mysql-test/suite/binlog/t/binlog_unsafe.test: Manual merge mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result: Manual merge mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result: No changes mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test: Manual merge mysql-test/t/change_user.test: Manual merge mysql-test/t/disabled.def: Manual merge mysql-test/t/merge.test: No changes mysql-test/t/myisam.test: Manual merge mysys/Makefile.am: Manual merge mysys/array.c: Manual merge mysys/mf_keycache.c: Manual merge mysys/my_getsystime.c: Manual merge mysys/my_handler.c: Manual merge mysys/my_pread.c: Manual merge mysys/safemalloc.c: Manual merge sql/ha_partition.cc: Manual merge sql/handler.cc: Manual merge sql/lex.h: Manual merge sql/mysql_priv.h: Manual merge sql/mysqld.cc: Manual merge sql/set_var.h: Manual merge sql/sql_class.cc: Manual merge sql/sql_insert.cc: Manual merge sql/sql_parse.cc: Manual merge sql/sql_select.cc: Manual merge sql/sql_show.cc: Manual merge sql/sql_table.cc: Manual merge storage/myisam/mi_checksum.c: No changes storage/myisam/mi_extra.c: Manual merge storage/myisam/mi_open.c: Manual merge storage/myisammrg/ha_myisammrg.cc: Manual merge strings/strmake.c: No changes
Diffstat (limited to 'include')
-rw-r--r--include/config-win.h71
-rw-r--r--include/hash.h7
-rw-r--r--include/m_ctype.h1
-rw-r--r--include/my_base.h27
-rw-r--r--include/my_global.h26
-rw-r--r--include/my_handler.h7
-rw-r--r--include/my_pthread.h8
-rw-r--r--include/my_sys.h8
-rw-r--r--include/myisam.h2
-rw-r--r--include/mysql/plugin.h10
-rw-r--r--include/mysql_com.h35
-rw-r--r--include/mysql_h.ic84
-rw-r--r--include/sql_common.h1
13 files changed, 140 insertions, 147 deletions
diff --git a/include/config-win.h b/include/config-win.h
index 7a50f28c932..aab401346da 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -168,14 +168,12 @@ typedef uint rf_SetTimer;
#define Socket_defined
#define my_socket SOCKET
-#define bool BOOL
#define SIGPIPE SIGINT
#define RETQSORTTYPE void
#define QSORT_TYPE_IS_VOID
#define RETSIGTYPE void
#define SOCKET_SIZE_TYPE int
#define my_socket_defined
-#define bool_defined
#define byte_defined
#define HUGE_PTR
#define STDCALL __stdcall /* Used by libmysql.dll */
@@ -267,73 +265,10 @@ inline double ulonglong2double(ulonglong value)
#define tell(A) _telli64(A)
#endif
-
#define STACK_DIRECTION -1
-/* Optimized store functions for Intel x86 */
-
-#ifndef _WIN64
-#define sint2korr(A) (*((int16 *) (A)))
-#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
- (((uint32) 255L << 24) | \
- (((uint32) (uchar) (A)[2]) << 16) |\
- (((uint32) (uchar) (A)[1]) << 8) | \
- ((uint32) (uchar) (A)[0])) : \
- (((uint32) (uchar) (A)[2]) << 16) |\
- (((uint32) (uchar) (A)[1]) << 8) | \
- ((uint32) (uchar) (A)[0])))
-#define sint4korr(A) (*((long *) (A)))
-#define uint2korr(A) (*((uint16 *) (A)))
-/*
- ATTENTION !
-
- Please, note, uint3korr reads 4 bytes (not 3) !
- It means, that you have to provide enough allocated space !
-*/
-#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF)
-#define uint4korr(A) (*((unsigned long *) (A)))
-#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
- (((uint32) ((uchar) (A)[1])) << 8) +\
- (((uint32) ((uchar) (A)[2])) << 16) +\
- (((uint32) ((uchar) (A)[3])) << 24)) +\
- (((ulonglong) ((uchar) (A)[4])) << 32))
-#define uint6korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) + \
- (((uint32) ((uchar) (A)[1])) << 8) + \
- (((uint32) ((uchar) (A)[2])) << 16) + \
- (((uint32) ((uchar) (A)[3])) << 24)) + \
- (((ulonglong) ((uchar) (A)[4])) << 32) + \
- (((ulonglong) ((uchar) (A)[5])) << 40))
-#define uint8korr(A) (*((ulonglong *) (A)))
-#define sint8korr(A) (*((longlong *) (A)))
-#define int2store(T,A) *((uint16*) (T))= (uint16) (A)
-#define int3store(T,A) { *(T)= (uchar) ((A));\
- *(T+1)=(uchar) (((uint) (A) >> 8));\
- *(T+2)=(uchar) (((A) >> 16)); }
-#define int4store(T,A) *((long *) (T))= (long) (A)
-#define int5store(T,A) { *(T)= (uchar)((A));\
- *((T)+1)=(uchar) (((A) >> 8));\
- *((T)+2)=(uchar) (((A) >> 16));\
- *((T)+3)=(uchar) (((A) >> 24)); \
- *((T)+4)=(uchar) (((A) >> 32)); }
-#define int6store(T,A) { *(T) =(uchar)((A)); \
- *((T)+1)=(uchar) (((A) >> 8)); \
- *((T)+2)=(uchar) (((A) >> 16)); \
- *((T)+3)=(uchar) (((A) >> 24)); \
- *((T)+4)=(uchar) (((A) >> 32)); \
- *((T)+5)=(uchar) (((A) >> 40)); }
-#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A)
-
-#define doubleget(V,M) do { *((long *) &V) = *((long*) M); \
- *(((long *) &V)+1) = *(((long*) M)+1); } while(0)
-#define doublestore(T,V) do { *((long *) T) = *((long*) &V); \
- *(((long *) T)+1) = *(((long*) &V)+1); } while(0)
-#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); }
-#define floatstore(T,V) memcpy((uchar*)(T), (uchar*)(&V), sizeof(float))
-#define floatget(V,M) memcpy((uchar*)(&V), (uchar*)(M), sizeof(float))
-#define float8get(V,M) doubleget((V),(M))
-#define float4store(V,M) memcpy((uchar*) V,(uchar*) (&M),sizeof(float))
-#define float8store(V,M) doublestore((V),(M))
-#endif /* _WIN64 */
+/* Difference between GetSystemTimeAsFileTime() and now() */
+#define OFFSET_TO_EPOCH ULL(116444736000000000)
#define HAVE_PERROR
#define HAVE_VFPRINT
@@ -482,4 +417,4 @@ inline double ulonglong2double(ulonglong value)
#define HAVE_CHARSET_ujis 1
#define HAVE_CHARSET_utf8 1
#define HAVE_UCA_COLLATIONS 1
-
+#define HAVE_BOOL 1
diff --git a/include/hash.h b/include/hash.h
index d924e62a0ec..4ca8dc0e8bf 100644
--- a/include/hash.h
+++ b/include/hash.h
@@ -47,8 +47,9 @@ typedef struct st_hash {
/* A search iterator state */
typedef uint HASH_SEARCH_STATE;
-#define hash_init(A,B,C,D,E,F,G,H) _hash_init(A,B,C,D,E,F,G, H CALLER_INFO)
-my_bool _hash_init(HASH *hash, CHARSET_INFO *charset,
+#define hash_init(A,B,C,D,E,F,G,H) _hash_init(A,0,B,C,D,E,F,G,H CALLER_INFO)
+#define hash_init2(A,B,C,D,E,F,G,H,I) _hash_init(A,B,C,D,E,F,G,H,I CALLER_INFO)
+my_bool _hash_init(HASH *hash, uint growth_size,CHARSET_INFO *charset,
ulong default_array_elements, size_t key_offset,
size_t key_length, hash_get_key get_key,
void (*free_element)(void*), uint flags CALLER_INFO_PROTO);
@@ -69,7 +70,7 @@ my_bool hash_check(HASH *hash); /* Only in debug library */
#define hash_clear(H) bzero((char*) (H),sizeof(*(H)))
#define hash_inited(H) ((H)->array.buffer != 0)
#define hash_init_opt(A,B,C,D,E,F,G,H) \
- (!hash_inited(A) && _hash_init(A,B,C,D,E,F,G, H CALLER_INFO))
+ (!hash_inited(A) && _hash_init(A,0,B,C,D,E,F,G, H CALLER_INFO))
#ifdef __cplusplus
}
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 9025507ce15..b85894e94f5 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -282,6 +282,7 @@ typedef struct charset_info_st
MY_COLLATION_HANDLER *coll;
} CHARSET_INFO;
+#define ILLEGAL_CHARSET_INFO_NUMBER (~0U)
extern CHARSET_INFO my_charset_bin;
diff --git a/include/my_base.h b/include/my_base.h
index ddefb5be7b4..ca9b875ebfa 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -188,16 +188,19 @@ enum ha_extra_function {
executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY.
*/
HA_EXTRA_INSERT_WITH_UPDATE,
+ /* Inform handler that we will do a rename */
+ HA_EXTRA_PREPARE_FOR_RENAME,
/*
Orders MERGE handler to attach or detach its child tables. Used at
begin and end of a statement.
*/
HA_EXTRA_ATTACH_CHILDREN,
- HA_EXTRA_DETACH_CHILDREN,
- /* Inform handler that we will do a rename */
- HA_EXTRA_PREPARE_FOR_RENAME
+ HA_EXTRA_DETACH_CHILDREN
};
+/* Compatible option, to be deleted in 6.0 */
+#define HA_EXTRA_PREPARE_FOR_DELETE HA_EXTRA_PREPARE_FOR_DROP
+
/* The following is parameter to ha_panic() */
enum ha_panic_function {
@@ -414,8 +417,8 @@ enum ha_base_keytype {
/* NULLs are not supported in spatial index */
#define HA_ERR_NULL_IN_SPATIAL 158
#define HA_ERR_TABLE_DEF_CHANGED 159 /* The table changed in storage engine */
-#define HA_ERR_NO_PARTITION_FOUND 160 /* There's no partition in table for
- given value */
+/* There's no partition in table for given value */
+#define HA_ERR_NO_PARTITION_FOUND 160
#define HA_ERR_RBR_LOGGING_FAILED 161 /* Row-based binlogging of row failed */
#define HA_ERR_DROP_INDEX_FK 162 /* Index needed in foreign key constr */
/*
@@ -434,14 +437,14 @@ enum ha_base_keytype {
#define HA_ERR_RECORD_IS_THE_SAME 169
/* It is not possible to log this statement */
#define HA_ERR_LOGGING_IMPOSSIBLE 170
-#define HA_ERR_CORRUPT_EVENT 171 /* The event was corrupt, leading to */
- /* illegal data being read */
+/* The event was corrupt, leading to illegal data being read */
+#define HA_ERR_CORRUPT_EVENT 171
#define HA_ERR_NEW_FILE 172 /* New file format */
-#define HA_ERR_INITIALIZATION 173 /* Error during initialization */
-#define HA_ERR_FILE_TOO_SHORT 174 /* File too short */
-#define HA_ERR_WRONG_CRC 175 /* Wrong CRC on page */
-#define HA_ERR_ROWS_EVENT_APPLY 176 /* The event could not be processed */
- /* no other hanlder error happened */
+/* The event could not be processed no other handler error happened */
+#define HA_ERR_ROWS_EVENT_APPLY 173
+#define HA_ERR_INITIALIZATION 174 /* Error during initialization */
+#define HA_ERR_FILE_TOO_SHORT 175 /* File too short */
+#define HA_ERR_WRONG_CRC 176 /* Wrong CRC on page */
#define HA_ERR_LAST 176 /* Copy of last error nr */
/* Number of different errors */
diff --git a/include/my_global.h b/include/my_global.h
index 6e44f88e340..47f7243e481 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -492,9 +492,6 @@ C_MODE_END
#include <sys/stream.h> /* HPUX 10.20 defines ulong here. UGLY !!! */
#define HAVE_ULONG
#endif
-#ifdef DONT_USE_FINITE /* HPUX 11.x has is_finite() */
-#undef HAVE_FINITE
-#endif
#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) && defined(THREAD)
/* Fix bug in setrlimit */
#undef setrlimit
@@ -865,9 +862,13 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define SIZE_T_MAX ~((size_t) 0)
#endif
-#ifndef HAVE_FINITE
+#ifndef isfinite
+#ifdef HAVE_FINITE
+#define isfinite(x) finite(x)
+#else
#define finite(x) (1.0 / fabs(x) > 0.0)
-#endif
+#endif /* HAVE_FINITE */
+#endif /* isfinite */
#ifndef HAVE_ISNAN
#define isnan(x) ((x) != (x))
@@ -877,7 +878,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
/* isinf() can be used in both C and C++ code */
#define my_isinf(X) isinf(X)
#else
-#define my_isinf(X) (!finite(X) && !isnan(X))
+#define my_isinf(X) (!isfinite(X) && !isnan(X))
#endif
/* Define missing math constants. */
@@ -1074,7 +1075,7 @@ typedef off_t os_off_t;
typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */
typedef short int15; /* Most effective integer 0 <= x <= 32767 */
typedef int myf; /* Type of MyFlags in my_funcs */
-#if !defined(bool) && !defined(bool_defined) && (!defined(HAVE_BOOL) || !defined(__cplusplus))
+#if !defined(bool) && (!defined(HAVE_BOOL) || !defined(__cplusplus))
typedef char bool; /* Ordinary boolean values 0 1 */
#endif
/* Macros for converting *constants* to the right type */
@@ -1145,7 +1146,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
*/
/* Optimized store functions for Intel x86 */
-#if defined(__i386__) && !defined(_WIN64)
+#if defined(__i386__) || defined(_WIN32)
#define sint2korr(A) (*((const int16 *) (A)))
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
(((uint32) 255L << 24) | \
@@ -1157,7 +1158,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
((uint32) (uchar) (A)[0])))
#define sint4korr(A) (*((const long *) (A)))
#define uint2korr(A) (*((const uint16 *) (A)))
-#ifdef HAVE_purify
+#if defined(HAVE_purify) && !defined(_WIN32)
#define uint3korr(A) (uint32) (((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\
(((uint32) ((uchar) (A)[2])) << 16))
@@ -1169,7 +1170,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
It means, that you have to provide enough allocated space !
*/
#define uint3korr(A) (long) (*((const unsigned int *) (A)) & 0xFFFFFF)
-#endif
+#endif /* HAVE_purify && !_WIN32 */
#define uint4korr(A) (*((const uint32 *) (A)))
#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
(((uint32) ((uchar) (A)[1])) << 8) +\
@@ -1220,9 +1221,8 @@ do { doubleget_union _tmp; \
#define floatstore(T,V) memcpy((uchar*)(T), (const uchar*)(&V),sizeof(float))
#define floatget(V,M) memcpy((uchar*) &V,(const uchar*) (M),sizeof(float))
#define float8store(V,M) doublestore((V),(M))
-#endif /* __i386__ */
+#else
-#ifndef sint2korr
/*
We're here if it's not a IA-32 architecture (Win32 and UNIX IA-32 defines
were done before)
@@ -1361,7 +1361,7 @@ do { doubleget_union _tmp; \
#define float8store(V,M) doublestore((V),(M))
#endif /* WORDS_BIGENDIAN */
-#endif /* sint2korr */
+#endif /* __i386__ OR _WIN32 */
/*
Macro for reading 32-bit integer from network byte order (big-endian)
diff --git a/include/my_handler.h b/include/my_handler.h
index bb885a2b493..c98ed0fd17f 100644
--- a/include/my_handler.h
+++ b/include/my_handler.h
@@ -20,6 +20,10 @@
#include "myisampack.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
There is a hard limit for the maximum number of keys as there are only
8 bits in the index file header for the number of keys in a table.
@@ -118,5 +122,8 @@ extern void my_handler_error_unregister(void);
this amount of bytes.
*/
#define portable_sizeof_char_ptr 8
+#ifdef __cplusplus
+}
+#endif
#endif /* _my_handler_h */
diff --git a/include/my_pthread.h b/include/my_pthread.h
index 1841d91d8c5..f1ae75b516e 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -163,7 +163,7 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#define pthread_mutex_unlock(A) (LeaveCriticalSection(A),0)
#define pthread_mutex_destroy(A) DeleteCriticalSection(A)
#define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B))
-#define pthread_kill(A,B) pthread_dummy(ESRCH)
+#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#define pthread_join(A,B) (WaitForSingleObject((A), INFINITE) != WAIT_OBJECT_0)
@@ -346,14 +346,14 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D))
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
-#define pthread_kill(A,B) pthread_dummy(ESRCH)
+#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
#endif
#ifdef HAVE_DARWIN5_THREADS
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
-#define pthread_kill(A,B) pthread_dummy(ESRCH)
+#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#define pthread_condattr_init(A) pthread_dummy(0)
#define pthread_condattr_destroy(A) pthread_dummy(0)
#undef pthread_detach_this_thread
@@ -373,7 +373,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
#ifndef pthread_sigmask
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#endif
-#define pthread_kill(A,B) pthread_dummy(ESRCH)
+#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
#elif !defined(__NETWARE__) /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */
diff --git a/include/my_sys.h b/include/my_sys.h
index aa923f47d4c..1d009ab5508 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -286,9 +286,11 @@ enum flush_type
FLUSH_KEEP, /* flush block and keep it in the cache */
FLUSH_RELEASE, /* flush block and remove it from the cache */
FLUSH_IGNORE_CHANGED, /* remove block from the cache */
- /* as my_disable_flush_pagecache_blocks is always 0, it is
- strictly equivalent to FLUSH_KEEP */
- FLUSH_FORCE_WRITE,
+ /*
+ As my_disable_flush_pagecache_blocks is always 0, the following option
+ is strictly equivalent to FLUSH_KEEP
+ */
+ FLUSH_FORCE_WRITE
/**
@brief like FLUSH_KEEP but return immediately if file is already being
flushed (even partially) by another thread; only for page cache,
diff --git a/include/myisam.h b/include/myisam.h
index 8452b25098a..3f756abdbee 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -44,6 +44,8 @@ extern "C" {
#define MI_MAX_KEY MAX_INDEXES /* Max allowed keys */
#endif
+#define MI_MAX_POSSIBLE_KEY_BUFF HA_MAX_POSSIBLE_KEY_BUFF
+
#define MI_MAX_MSG_BUF 1024 /* used in CHECK TABLE, REPAIR TABLE */
#define MI_NAME_IEXT ".MYI"
#define MI_NAME_DEXT ".MYD"
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 9ad4e499c55..fa38b90046d 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -717,6 +717,16 @@ int mysql_tmpfile(const char *prefix);
*/
int thd_killed(const MYSQL_THD thd);
+
+/**
+ Return the thread id of a user thread
+
+ @param thd user thread connection handle
+ @return thread id
+*/
+unsigned long thd_get_thread_id(const MYSQL_THD thd);
+
+
/**
Allocate memory in the connection's local memory pool
diff --git a/include/mysql_com.h b/include/mysql_com.h
index 3ac9f8283b6..e6e1a470469 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -148,6 +148,37 @@ enum enum_server_command
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
#define CLIENT_REMEMBER_OPTIONS (1UL << 31)
+/* Gather all possible capabilites (flags) supported by the server */
+#define CLIENT_ALL_FLAGS (CLIENT_LONG_PASSWORD | \
+ CLIENT_FOUND_ROWS | \
+ CLIENT_LONG_FLAG | \
+ CLIENT_CONNECT_WITH_DB | \
+ CLIENT_NO_SCHEMA | \
+ CLIENT_COMPRESS | \
+ CLIENT_ODBC | \
+ CLIENT_LOCAL_FILES | \
+ CLIENT_IGNORE_SPACE | \
+ CLIENT_PROTOCOL_41 | \
+ CLIENT_INTERACTIVE | \
+ CLIENT_SSL | \
+ CLIENT_IGNORE_SIGPIPE | \
+ CLIENT_TRANSACTIONS | \
+ CLIENT_RESERVED | \
+ CLIENT_SECURE_CONNECTION | \
+ CLIENT_MULTI_STATEMENTS | \
+ CLIENT_MULTI_RESULTS | \
+ CLIENT_SSL_VERIFY_SERVER_CERT | \
+ CLIENT_REMEMBER_OPTIONS)
+
+/*
+ Switch off the flags that are optional and depending on build flags
+ If any of the optional flags is supported by the build it will be switched
+ on before sending to the client during the connection handshake.
+*/
+#define CLIENT_BASIC_FLAGS (((CLIENT_ALL_FLAGS & ~CLIENT_SSL) \
+ & ~CLIENT_COMPRESS) \
+ & ~CLIENT_SSL_VERIFY_SERVER_CERT)
+
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
#define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */
@@ -217,12 +248,12 @@ typedef struct st_net {
functions and methods to maintain proper locking.
*/
unsigned char *query_cache_query;
- unsigned int client_last_errno;
+ unsigned int last_errno;
unsigned char error;
my_bool unused2; /* Please remove with the next incompatible ABI change. */
my_bool return_errno;
/** Client library error message buffer. Actually belongs to struct MYSQL. */
- char client_last_error[MYSQL_ERRMSG_SIZE];
+ char last_error[MYSQL_ERRMSG_SIZE];
/** Client library sqlstate buffer. Set along with the error message. */
char sqlstate[SQLSTATE_LENGTH+1];
void *extension;
diff --git a/include/mysql_h.ic b/include/mysql_h.ic
index 4f138d9a229..832678a106b 100644
--- a/include/mysql_h.ic
+++ b/include/mysql_h.ic
@@ -106,9 +106,9 @@ typedef struct st_mysql_ftparser_param MYSQL_FTPARSER_PARAM;
typedef struct st_mysql_methods MYSQL_METHODS;
# 47 "mysql_time.h"
typedef struct st_mysql_time MYSQL_TIME;
-# 384 "mysql_com.h"
+# 383 "mysql_com.h"
typedef struct st_udf_args UDF_ARGS;
-# 398 "mysql_com.h"
+# 397 "mysql_com.h"
typedef struct st_udf_init UDF_INIT;
# 26 "my_alloc.h"
typedef struct st_used_mem USED_MEM;
@@ -130,7 +130,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo
unsigned int mbminlen;
unsigned int mbmaxlen;
};
-# 370 "mysql_com.h"
+# 369 "mysql_com.h"
struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(double)))) rand_struct
{
unsigned long int seed1;
@@ -542,11 +542,11 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
my_bool compress;
my_bool unused1;
unsigned char * query_cache_query;
- unsigned int client_last_errno;
+ unsigned int last_errno;
unsigned char error;
my_bool unused2;
my_bool return_errno;
- char client_last_error[512];
+ char last_error[512];
char sqlstate[(5 + 1)];
void * extension;
};
@@ -558,7 +558,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo
char const * * type_names;
unsigned int * type_lengths;
};
-# 384 "mysql_com.h"
+# 383 "mysql_com.h"
struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) st_udf_args
{
unsigned int arg_count;
@@ -570,7 +570,7 @@ struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(vo
unsigned long int * attribute_lengths;
void * extension;
};
-# 398 "mysql_com.h"
+# 397 "mysql_com.h"
struct __attribute__((aligned(__alignof__(unsigned long int)), aligned(__alignof__(void *)))) st_udf_init
{
my_bool maybe_null;
@@ -587,7 +587,7 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
unsigned int left;
unsigned int size;
};
-# 381 "mysql_com.h"
+# 380 "mysql_com.h"
enum Item_result
{
STRING_RESULT = 0,
@@ -596,7 +596,7 @@ enum Item_result
ROW_RESULT = 3,
DECIMAL_RESULT = 4,
};
-# 322 "mysql_com.h"
+# 321 "mysql_com.h"
enum enum_cursor_type
{
CURSOR_TYPE_NO_CURSOR = 0,
@@ -604,7 +604,7 @@ enum enum_cursor_type
CURSOR_TYPE_FOR_UPDATE = 2,
CURSOR_TYPE_SCROLLABLE = 4,
};
-# 235 "mysql_com.h"
+# 234 "mysql_com.h"
enum enum_field_types
{
MYSQL_TYPE_DECIMAL = 0,
@@ -651,7 +651,7 @@ enum enum_ftparser_mode
MYSQL_FTPARSER_WITH_STOPWORDS = 1,
MYSQL_FTPARSER_FULL_BOOLEAN_INFO = 2,
};
-# 332 "mysql_com.h"
+# 331 "mysql_com.h"
enum enum_mysql_set_option
{
MYSQL_OPTION_MULTI_STATEMENTS_ON = 0,
@@ -730,7 +730,7 @@ enum enum_stmt_attr_type
STMT_ATTR_CURSOR_TYPE = 1,
STMT_ATTR_PREFETCH_ROWS = 2,
};
-# 297 "mysql_com.h"
+# 296 "mysql_com.h"
enum mysql_enum_shutdown_level
{
SHUTDOWN_DEFAULT = 0,
@@ -790,13 +790,13 @@ enum mysql_status
MYSQL_STATUS_GET_RESULT = 1,
MYSQL_STATUS_USE_RESULT = 2,
};
-# 439 "mysql_com.h"
+# 441 "mysql_com.h"
extern my_bool check_scramble(char const * reply, char const * message, unsigned char const * hash_stage2);
-# 432 "mysql_com.h"
+# 434 "mysql_com.h"
extern my_bool check_scramble_323(char const *, char const * message, unsigned long int * salt);
# 35 "typelib.h"
extern TYPELIB * copy_typelib(MEM_ROOT * root, TYPELIB * from);
-# 427 "mysql_com.h"
+# 429 "mysql_com.h"
extern void create_random_string(char * to, unsigned int, struct rand_struct * rand_st);
# 32 "typelib.h"
extern int find_type(char * x, TYPELIB const * typelib, unsigned int);
@@ -804,15 +804,15 @@ extern int find_type(char * x, TYPELIB const * typelib, unsigned int);
extern int find_type_or_exit(char const * x, TYPELIB * typelib, char const * option);
# 29 "typelib.h"
extern my_ulonglong find_typeset(char * x, TYPELIB * typelib, int * error_position);
-# 441 "mysql_com.h"
+# 443 "mysql_com.h"
extern void get_salt_from_password(unsigned char * res, char const * password);
-# 434 "mysql_com.h"
+# 436 "mysql_com.h"
extern void get_salt_from_password_323(unsigned long int * res, char const * password);
-# 447 "mysql_com.h"
+# 449 "mysql_com.h"
extern char * get_tty_password(char const * opt_message);
# 34 "typelib.h"
extern char const * get_type(TYPELIB * typelib, unsigned int);
-# 429 "mysql_com.h"
+# 431 "mysql_com.h"
extern void hash_password(unsigned long int * to, char const * password, unsigned int);
# 30 "my_list.h"
extern LIST * list_add(LIST * root, LIST * element);
@@ -828,31 +828,31 @@ extern unsigned int list_length(LIST *);
extern LIST * list_reverse(LIST * root);
# 36 "my_list.h"
extern int list_walk(LIST *, list_walk_action, unsigned char * argument);
-# 442 "mysql_com.h"
+# 444 "mysql_com.h"
extern void make_password_from_salt(char * to, unsigned char const * hash_stage2);
-# 435 "mysql_com.h"
-extern void make_password_from_salt_323(char * to, unsigned long int const * salt);
# 437 "mysql_com.h"
+extern void make_password_from_salt_323(char * to, unsigned long int const * salt);
+# 439 "mysql_com.h"
extern void make_scrambled_password(char * to, char const * password);
-# 430 "mysql_com.h"
+# 432 "mysql_com.h"
extern void make_scrambled_password_323(char * to, char const * password);
# 33 "typelib.h"
extern void make_type(char * to, unsigned int, TYPELIB * typelib);
-# 367 "mysql_com.h"
+# 366 "mysql_com.h"
extern int my_connect(my_socket, struct sockaddr const * name, unsigned int, unsigned int);
-# 344 "mysql_com.h"
+# 343 "mysql_com.h"
extern my_bool my_net_init(NET * net, Vio * vio);
-# 345 "mysql_com.h"
+# 344 "mysql_com.h"
extern void my_net_local_init(NET * net);
-# 355 "mysql_com.h"
+# 354 "mysql_com.h"
extern unsigned long int my_net_read(NET * net);
-# 350 "mysql_com.h"
+# 349 "mysql_com.h"
extern my_bool my_net_write(NET * net, unsigned char const * packet, size_t);
-# 426 "mysql_com.h"
+# 428 "mysql_com.h"
extern double my_rnd(struct rand_struct *);
-# 453 "mysql_com.h"
+# 455 "mysql_com.h"
extern void my_thread_end(void);
-# 452 "mysql_com.h"
+# 454 "mysql_com.h"
extern my_bool my_thread_init(void);
# 560 "mysql.h"
extern void myodbc_remove_escape(MYSQL * mysql, char * name);
@@ -890,7 +890,7 @@ extern void mysql_enable_rpl_parse(MYSQL * mysql);
extern my_bool mysql_eof(MYSQL_RES * res);
# 423 "mysql.h"
extern unsigned int mysql_errno(MYSQL * mysql);
-# 448 "mysql_com.h"
+# 450 "mysql_com.h"
extern char const * mysql_errno_to_sqlstate(unsigned int);
# 424 "mysql.h"
extern char const * mysql_error(MYSQL * mysql);
@@ -1108,25 +1108,25 @@ extern char * mysql_unix_port;
extern MYSQL_RES * mysql_use_result(MYSQL * mysql);
# 426 "mysql.h"
extern unsigned int mysql_warning_count(MYSQL * mysql);
-# 347 "mysql_com.h"
-extern void net_clear(NET * net, my_bool);
# 346 "mysql_com.h"
+extern void net_clear(NET * net, my_bool);
+# 345 "mysql_com.h"
extern void net_end(NET * net);
-# 349 "mysql_com.h"
+# 348 "mysql_com.h"
extern my_bool net_flush(NET * net);
-# 354 "mysql_com.h"
+# 353 "mysql_com.h"
extern int net_real_write(NET * net, unsigned char const * packet, size_t);
-# 348 "mysql_com.h"
+# 347 "mysql_com.h"
extern my_bool net_realloc(NET * net, size_t);
-# 351 "mysql_com.h"
+# 350 "mysql_com.h"
extern my_bool net_write_command(NET * net, unsigned char, unsigned char const * header, size_t, unsigned char const * packet, size_t);
-# 443 "mysql_com.h"
+# 445 "mysql_com.h"
extern char * octet2hex(char * to, char const * str, unsigned int);
-# 424 "mysql_com.h"
+# 426 "mysql_com.h"
extern void randominit(struct rand_struct *, unsigned long int, unsigned long int);
-# 438 "mysql_com.h"
+# 440 "mysql_com.h"
extern void scramble(char * to, char const * message, char const * password);
-# 431 "mysql_com.h"
+# 433 "mysql_com.h"
extern void scramble_323(char * to, char const * message, char const * password);
# 37 "typelib.h"
extern TYPELIB sql_protocol_typelib;
diff --git a/include/sql_common.h b/include/sql_common.h
index 56e7305130f..9e43d076ba9 100644
--- a/include/sql_common.h
+++ b/include/sql_common.h
@@ -15,6 +15,7 @@
extern const char *unknown_sqlstate;
+extern const char *cant_connect_sqlstate;
extern const char *not_error_sqlstate;
#ifdef __cplusplus