diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/CMakeLists.txt | 6 | ||||
-rw-r--r-- | include/lf.h | 7 | ||||
-rw-r--r-- | include/m_ctype.h | 3 | ||||
-rw-r--r-- | include/m_string.h | 8 | ||||
-rw-r--r-- | include/my_decimal_limits.h | 10 | ||||
-rw-r--r-- | include/my_global.h | 18 | ||||
-rw-r--r-- | include/my_pthread.h | 31 | ||||
-rw-r--r-- | include/my_time.h | 3 | ||||
-rw-r--r-- | include/my_tree.h | 2 | ||||
-rw-r--r-- | include/myisam.h | 3 | ||||
-rw-r--r-- | include/mysql.h | 2 | ||||
-rw-r--r-- | include/mysql.h.pp | 5 | ||||
-rw-r--r-- | include/mysql/plugin_audit.h | 8 | ||||
-rw-r--r-- | include/mysql/plugin_auth.h | 9 | ||||
-rw-r--r-- | include/mysql/plugin_encryption.h | 8 | ||||
-rw-r--r-- | include/mysql/plugin_ftparser.h | 8 | ||||
-rw-r--r-- | include/mysql/plugin_password_validation.h | 9 | ||||
-rw-r--r-- | include/mysql_com.h | 24 | ||||
-rw-r--r-- | include/thr_lock.h | 3 | ||||
-rw-r--r-- | include/violite.h | 9 |
20 files changed, 119 insertions, 57 deletions
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index d7853a46ecb..d0c4768e882 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -76,3 +76,9 @@ INSTALL(DIRECTORY . DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Developm PATTERN CMakeFiles EXCLUDE PATTERN mysql EXCLUDE REGEX "\\./(${EXCL_RE}$)" EXCLUDE) + +INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/. DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Development + FILES_MATCHING PATTERN "*.h" + PATTERN CMakeFiles EXCLUDE + PATTERN mysql EXCLUDE + REGEX "\\./(${EXCL_RE}$)" EXCLUDE) diff --git a/include/lf.h b/include/lf.h index 19bdafce647..1825de62b43 100644 --- a/include/lf.h +++ b/include/lf.h @@ -68,11 +68,8 @@ typedef struct { void *purgatory; uint32 purgatory_count; uint32 volatile link; -/* we want sizeof(LF_PINS) to be 128 to avoid false sharing */ - char pad[128-sizeof(uint32)*2 - -sizeof(LF_PINBOX *) - -sizeof(void*) - -sizeof(void *)*(LF_PINBOX_PINS+1)]; + /* avoid false sharing */ + char pad[CPU_LEVEL1_DCACHE_LINESIZE]; } LF_PINS; /* compile-time assert to make sure we have enough pins. */ diff --git a/include/m_ctype.h b/include/m_ctype.h index 536d7fb4629..7a688f76acb 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -101,7 +101,7 @@ extern MY_UNICASE_INFO my_unicase_unicode520; */ #define MY_UCA_MAX_WEIGHT_SIZE (8+1) /* Including 0 terminator */ #define MY_UCA_CONTRACTION_MAX_WEIGHT_SIZE (2*8+1) /* Including 0 terminator */ -#define MY_UCA_WEIGHT_LEVELS 1 +#define MY_UCA_WEIGHT_LEVELS 2 typedef struct my_contraction_t { @@ -131,6 +131,7 @@ typedef struct my_uca_level_info_st uchar *lengths; uint16 **weights; MY_CONTRACTIONS contractions; + uint levelno; } MY_UCA_WEIGHT_LEVEL; diff --git a/include/m_string.h b/include/m_string.h index 969725e4631..0f3cd362b4d 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -23,6 +23,7 @@ #define _m_string_h #include "my_global.h" /* HAVE_* */ +#include "my_decimal_limits.h" #ifndef __USE_GNU #define __USE_GNU /* We want to use stpcpy */ @@ -138,14 +139,13 @@ size_t my_fcvt(double x, int precision, char *to, my_bool *error); size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to, my_bool *error); -#define NOT_FIXED_DEC 31 - /* The longest string my_fcvt can return is 311 + "precision" bytes. - Here we assume that we never cal my_fcvt() with precision >= NOT_FIXED_DEC + Here we assume that we never cal my_fcvt() with + precision >= DECIMAL_NOT_SPECIFIED (+ 1 byte for the terminating '\0'). */ -#define FLOATING_POINT_BUFFER (311 + NOT_FIXED_DEC) +#define FLOATING_POINT_BUFFER (311 + DECIMAL_NOT_SPECIFIED) /* We want to use the 'e' format in some cases even if we have enough space diff --git a/include/my_decimal_limits.h b/include/my_decimal_limits.h index 50d70357c42..a287e82f989 100644 --- a/include/my_decimal_limits.h +++ b/include/my_decimal_limits.h @@ -31,10 +31,16 @@ digits * number of decimal digits in one our big digit - number of decimal digits in one our big digit decreased by 1 (because we always put decimal point on the border of our big digits)) + + With normal precession we can handle 65 digits. MariaDB can store in + the .frm up to 63 digits. By default we use DECIMAL_NOT_SPECIFIED digits + when converting strings to decimal, so we don't want to set this too high. + To not use up all digits for the scale we limit the number of decimals to + 38. */ #define DECIMAL_MAX_PRECISION (DECIMAL_MAX_POSSIBLE_PRECISION - 8*2) -#define DECIMAL_MAX_SCALE 30 -#define DECIMAL_NOT_SPECIFIED 31 +#define DECIMAL_MAX_SCALE 38 +#define DECIMAL_NOT_SPECIFIED 39 /** maximum length of string representation (number of maximum decimal diff --git a/include/my_global.h b/include/my_global.h index 7ed306b8b56..1cf3f217549 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1232,4 +1232,22 @@ static inline double rint(double x) #undef __GNUG__ #endif +/* + Provide defaults for the CPU cache line size, if it has not been detected by + CMake using getconf +*/ +#if !defined(CPU_LEVEL1_DCACHE_LINESIZE) || CPU_LEVEL1_DCACHE_LINESIZE == 0 + #if CPU_LEVEL1_DCACHE_LINESIZE == 0 + #undef CPU_LEVEL1_DCACHE_LINESIZE + #endif + + #if defined(__s390__) + #define CPU_LEVEL1_DCACHE_LINESIZE 256 + #elif defined(__powerpc__) || defined(__aarch64__) + #define CPU_LEVEL1_DCACHE_LINESIZE 128 + #else + #define CPU_LEVEL1_DCACHE_LINESIZE 64 + #endif +#endif + #endif /* my_global_h */ diff --git a/include/my_pthread.h b/include/my_pthread.h index 991bc76c1ec..0d0e5d51bac 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -54,26 +54,7 @@ typedef struct st_pthread_link { We use native conditions on Vista and later, and fallback to own implementation on earlier OS version. */ -typedef union -{ - /* Native condition (used on Vista and later) */ - CONDITION_VARIABLE native_cond; - - /* Own implementation (used on XP) */ - struct - { - uint32 waiting; - CRITICAL_SECTION lock_waiting; - enum - { - SIGNAL= 0, - BROADCAST= 1, - MAX_EVENTS= 2 - } EVENTS; - HANDLE events[MAX_EVENTS]; - HANDLE broadcast_block_event; - }; -} pthread_cond_t; +typedef CONDITION_VARIABLE pthread_cond_t; typedef int pthread_mutexattr_t; @@ -81,10 +62,8 @@ typedef int pthread_mutexattr_t; #define pthread_handler_t EXTERNC void * __cdecl typedef void * (__cdecl *pthread_handler)(void *); -typedef volatile LONG my_pthread_once_t; -#define MY_PTHREAD_ONCE_INIT 0 -#define MY_PTHREAD_ONCE_INPROGRESS 1 -#define MY_PTHREAD_ONCE_DONE 2 +typedef INIT_ONCE my_pthread_once_t; +#define MY_PTHREAD_ONCE_INIT INIT_ONCE_STATIC_INIT; #if !STRUCT_TIMESPEC_HAS_TV_SEC || !STRUCT_TIMESPEC_HAS_TV_NSEC struct timespec { @@ -694,7 +673,7 @@ extern void my_mutex_end(void); We need to have at least 256K stack to handle calls to myisamchk_init() with the current number of keys and key parts. */ -#define DEFAULT_THREAD_STACK (290*1024L) +#define DEFAULT_THREAD_STACK (291*1024L) #endif #define MY_PTHREAD_LOCK_READ 0 @@ -712,7 +691,7 @@ struct st_my_thread_var mysql_mutex_t * volatile current_mutex; mysql_cond_t * volatile current_cond; pthread_t pthread_self; - my_thread_id id; + my_thread_id id, dbug_id; int volatile abort; my_bool init; struct st_my_thread_var *next,**prev; diff --git a/include/my_time.h b/include/my_time.h index 557dcdd5670..a5fe7858797 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -23,6 +23,7 @@ #define _my_time_h_ #include "my_global.h" #include "mysql_time.h" +#include "my_decimal_limits.h" C_MODE_START @@ -184,7 +185,7 @@ void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type); sent using binary protocol fit in this buffer. */ #define MAX_DATE_STRING_REP_LENGTH 30 -#define AUTO_SEC_PART_DIGITS 31 /* same as NOT_FIXED_DEC */ +#define AUTO_SEC_PART_DIGITS DECIMAL_NOT_SPECIFIED int my_time_to_str(const MYSQL_TIME *l_time, char *to, uint digits); int my_date_to_str(const MYSQL_TIME *l_time, char *to); diff --git a/include/my_tree.h b/include/my_tree.h index f8be55f84b2..02cab02b52e 100644 --- a/include/my_tree.h +++ b/include/my_tree.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. 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 diff --git a/include/myisam.h b/include/myisam.h index 88ce401fabc..f7a3ae8cc8a 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -331,7 +331,8 @@ typedef struct st_sort_info my_off_t filelength, dupp, buff_length; ha_rows max_records; uint current_key, total_keys; - uint got_error, threads_running; + volatile uint got_error; + uint threads_running; myf myf_rw; enum data_file_type new_data_file_type; } MI_SORT_INFO; diff --git a/include/mysql.h b/include/mysql.h index f088ad668a1..19099b4f404 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -367,7 +367,7 @@ void STDCALL mysql_server_end(void); /* mysql_server_init/end need to be called when using libmysqld or libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so - you don't need to call it explicitely; but you need to call + you don't need to call it explicitly; but you need to call mysql_server_end() to free memory). The names are a bit misleading (mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general names which suit well whether you're using libmysqld or libmysqlclient. We diff --git a/include/mysql.h.pp b/include/mysql.h.pp index 0c06141df6c..b9018376876 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -10,7 +10,10 @@ enum enum_server_command COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE, COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON, COM_MDB_GAP_BEG, - COM_MDB_GAP_END=253, + COM_MDB_GAP_END=250, + COM_SLAVE_WORKER, + COM_SLAVE_IO, + COM_SLAVE_SQL, COM_MULTI, COM_END }; diff --git a/include/mysql/plugin_audit.h b/include/mysql/plugin_audit.h index 7fb6e816181..10039c4c1fa 100644 --- a/include/mysql/plugin_audit.h +++ b/include/mysql/plugin_audit.h @@ -23,6 +23,10 @@ #include "plugin.h" +#ifdef __cplusplus +extern "C" { +#endif + #define MYSQL_AUDIT_CLASS_MASK_SIZE 1 #define MYSQL_AUDIT_INTERFACE_VERSION 0x0302 @@ -175,4 +179,8 @@ struct st_mysql_audit }; +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/mysql/plugin_auth.h b/include/mysql/plugin_auth.h index 156fb386aae..d776ed79a61 100644 --- a/include/mysql/plugin_auth.h +++ b/include/mysql/plugin_auth.h @@ -31,6 +31,10 @@ #include <mysql/plugin_auth_common.h> +#ifdef __cplusplus +extern "C" { +#endif + /* defines for MYSQL_SERVER_AUTH_INFO.password_used */ #define PASSWORD_USED_NO 0 @@ -122,5 +126,10 @@ struct st_mysql_auth */ int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info); }; + +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/mysql/plugin_encryption.h b/include/mysql/plugin_encryption.h index 3f35c2bcf80..5d08f6d3067 100644 --- a/include/mysql/plugin_encryption.h +++ b/include/mysql/plugin_encryption.h @@ -27,6 +27,10 @@ #include <mysql/plugin.h> +#ifdef __cplusplus +extern "C" { +#endif + #define MariaDB_ENCRYPTION_INTERFACE_VERSION 0x0300 /** @@ -114,5 +118,9 @@ struct st_mariadb_encryption */ unsigned int (*encrypted_length)(unsigned int slen, unsigned int key_id, unsigned int key_version); }; + +#ifdef __cplusplus +} +#endif #endif diff --git a/include/mysql/plugin_ftparser.h b/include/mysql/plugin_ftparser.h index 324fce7ae86..4dace4ef3a6 100644 --- a/include/mysql/plugin_ftparser.h +++ b/include/mysql/plugin_ftparser.h @@ -18,6 +18,10 @@ #define _my_plugin_ftparser_h #include "plugin.h" +#ifdef __cplusplus +extern "C" { +#endif + /************************************************************************* API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN) */ @@ -208,5 +212,9 @@ struct st_mysql_ftparser }; +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/mysql/plugin_password_validation.h b/include/mysql/plugin_password_validation.h index f3ca5c7e0cf..18c643e877b 100644 --- a/include/mysql/plugin_password_validation.h +++ b/include/mysql/plugin_password_validation.h @@ -26,6 +26,10 @@ #include <mysql/plugin.h> +#ifdef __cplusplus +extern "C" { +#endif + #define MariaDB_PASSWORD_VALIDATION_INTERFACE_VERSION 0x0100 /** @@ -41,5 +45,10 @@ struct st_mariadb_password_validation int (*validate_password)(MYSQL_LEX_STRING *username, MYSQL_LEX_STRING *password); }; + +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/mysql_com.h b/include/mysql_com.h index c13999a1028..8e7bf2337cc 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -21,6 +21,8 @@ #ifndef _mysql_com_h #define _mysql_com_h +#include "my_decimal_limits.h" + #define HOSTNAME_LENGTH 60 #define SYSTEM_CHARSET_MBMAXLEN 3 #define NAME_CHAR_LEN 64 /* Field/table name length */ @@ -103,7 +105,10 @@ enum enum_server_command COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON, /* don't forget to update const char *command_name[] in sql_parse.cc */ COM_MDB_GAP_BEG, - COM_MDB_GAP_END=253, + COM_MDB_GAP_END=250, + COM_SLAVE_WORKER, + COM_SLAVE_IO, + COM_SLAVE_SQL, COM_MULTI, /* Must be last */ COM_END @@ -156,8 +161,6 @@ enum enum_server_command #define FIELD_FLAGS_COLUMN_FORMAT 24 /* Field column format, bit 24-25 */ #define FIELD_FLAGS_COLUMN_FORMAT_MASK (3 << FIELD_FLAGS_COLUMN_FORMAT) #define FIELD_IS_DROPPED (1<< 26) /* Intern: Field is being dropped */ -#define HAS_EXPLICIT_VALUE (1 << 27) /* An INSERT/UPDATE operation supplied - an explicit default value */ #define REFRESH_GRANT (1ULL << 0) /* Refresh grant tables */ #define REFRESH_LOG (1ULL << 1) /* Start on new log file */ @@ -648,5 +651,18 @@ uchar *safe_net_store_length(uchar *pkg, size_t pkg_len, ulonglong length); #define MYSQL_STMT_HEADER 4 #define MYSQL_LONG_DATA_HEADER 6 -#define NOT_FIXED_DEC 31 +/* + If a float or double field have more than this number of decimals, + it's regarded as floating point field without any specific number of + decimals +*/ + +#define FLOATING_POINT_DECIMALS 31 + +/* Keep client compatible with earlier versions */ +#ifdef MYSQL_SERVER +#define NOT_FIXED_DEC DECIMAL_NOT_SPECIFIED +#else +#define NOT_FIXED_DEC FLOATING_POINT_DECIMALS +#endif #endif diff --git a/include/thr_lock.h b/include/thr_lock.h index bc916b8ec9c..fb69d8a693e 100644 --- a/include/thr_lock.h +++ b/include/thr_lock.h @@ -139,9 +139,10 @@ typedef struct st_thr_lock { extern LIST *thr_lock_thread_list; extern mysql_mutex_t THR_LOCK_lock; +struct st_my_thread_var; my_bool init_thr_lock(void); /* Must be called once/thread */ -void thr_lock_info_init(THR_LOCK_INFO *info); +void thr_lock_info_init(THR_LOCK_INFO *info, struct st_my_thread_var *tmp); void thr_lock_init(THR_LOCK *lock); void thr_lock_delete(THR_LOCK *lock); void thr_lock_data_init(THR_LOCK *lock,THR_LOCK_DATA *data, diff --git a/include/violite.h b/include/violite.h index a7165ca91a9..8be9859ceb4 100644 --- a/include/violite.h +++ b/include/violite.h @@ -211,14 +211,6 @@ void vio_end(void); #define SHUT_RD SD_RECEIVE #endif -/* - Set thread id for io cancellation (required on Windows XP only, - and should to be removed if XP is no more supported) -*/ - -#define vio_set_thread_id(vio, tid) if(vio) vio->thread_id= tid -#else -#define vio_set_thread_id(vio, tid) #endif /* This enumerator is used in parser - should be always visible */ @@ -288,7 +280,6 @@ struct st_vio #ifdef _WIN32 HANDLE hPipe; OVERLAPPED overlapped; - DWORD thread_id; /* Used on XP only by vio_shutdown() */ DWORD read_timeout_ms; DWORD write_timeout_ms; #endif |