summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2018-11-10 14:52:57 -0800
committerIgor Babaev <igor@askmonty.org>2018-11-10 14:52:57 -0800
commit5f46670bd09babbee75a24ac82eb4ade0706da66 (patch)
tree85e2759b75650b8165c3e01638e9458eb4d1274c /include
parent8d5a11122c32f4d9eb87536886c6e893377bdd07 (diff)
parent3ea7de9a78a1410a9b79362774247e9e44b201b3 (diff)
downloadmariadb-git-5f46670bd09babbee75a24ac82eb4ade0706da66.tar.gz
Merge branch '10.4' into 10.4-mdev16188
Diffstat (limited to 'include')
-rw-r--r--include/big_endian.h2
-rw-r--r--include/byte_order_generic.h2
-rw-r--r--include/byte_order_generic_x86.h2
-rw-r--r--include/byte_order_generic_x86_64.h2
-rw-r--r--include/json_lib.h6
-rw-r--r--include/little_endian.h2
-rw-r--r--include/m_ctype.h37
-rw-r--r--include/m_string.h2
-rw-r--r--include/my_bit.h10
-rw-r--r--include/my_cpu.h2
-rw-r--r--include/my_global.h16
-rw-r--r--include/my_pthread.h2
-rw-r--r--include/my_service_manager.h2
-rw-r--r--include/my_sys.h1
-rw-r--r--include/my_time.h31
-rw-r--r--include/myisamchk.h3
-rw-r--r--include/mysql/plugin_auth.h46
-rw-r--r--include/mysql/plugin_auth.h.pp4
-rw-r--r--include/mysql/plugin_password_validation.h4
-rw-r--r--include/mysql/plugin_password_validation.h.pp4
-rw-r--r--include/mysql/psi/mysql_socket.h4
-rw-r--r--include/mysql/service_kill_statement.h4
-rw-r--r--include/mysql/service_wsrep.h3
-rw-r--r--include/mysql_embed.h1
-rw-r--r--include/service_versions.h2
-rw-r--r--include/sql_common.h4
-rw-r--r--include/ssl_compat.h4
-rw-r--r--include/violite.h22
-rw-r--r--include/wsrep.h18
29 files changed, 136 insertions, 106 deletions
diff --git a/include/big_endian.h b/include/big_endian.h
index 021b6abc383..5f6e623f6a0 100644
--- a/include/big_endian.h
+++ b/include/big_endian.h
@@ -11,7 +11,7 @@
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., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301 USA */
/*
Data in big-endian format.
diff --git a/include/byte_order_generic.h b/include/byte_order_generic.h
index d4ac27eeb9c..14b00fc87eb 100644
--- a/include/byte_order_generic.h
+++ b/include/byte_order_generic.h
@@ -11,7 +11,7 @@
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., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301 USA */
/*
Endianness-independent definitions for architectures other
diff --git a/include/byte_order_generic_x86.h b/include/byte_order_generic_x86.h
index a97dd0f43a3..5df208ff35c 100644
--- a/include/byte_order_generic_x86.h
+++ b/include/byte_order_generic_x86.h
@@ -11,7 +11,7 @@
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., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301 USA */
/*
Optimized function-like macros for the x86 architecture (_WIN32 included).
diff --git a/include/byte_order_generic_x86_64.h b/include/byte_order_generic_x86_64.h
index fbc6e1f536b..42c1944ad21 100644
--- a/include/byte_order_generic_x86_64.h
+++ b/include/byte_order_generic_x86_64.h
@@ -11,7 +11,7 @@
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., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301 USA */
/*
Optimized function-like macros for the x86 architecture (_WIN32 included).
diff --git a/include/json_lib.h b/include/json_lib.h
index 781978cd6ca..fed85b516d9 100644
--- a/include/json_lib.h
+++ b/include/json_lib.h
@@ -319,6 +319,12 @@ int json_skip_to_level(json_engine_t *j, int level);
json_skip_to_level((json_engine), (json_engine)->stack_p)
+/*
+ works as json_skip_level() but also counts items on the current
+ level skipped.
+*/
+int json_skip_level_and_count(json_engine_t *j, int *n_items_skipped);
+
#define json_skip_array_item json_skip_key
/*
diff --git a/include/little_endian.h b/include/little_endian.h
index 7223fea648f..eb704f4344f 100644
--- a/include/little_endian.h
+++ b/include/little_endian.h
@@ -11,7 +11,7 @@
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., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301 USA */
/*
Data in little-endian format.
diff --git a/include/m_ctype.h b/include/m_ctype.h
index fc51ebd3c8b..c6273590bbe 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -362,7 +362,6 @@ extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_nopad_bin_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_simple_nopad_ci_handler;
-extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler;
/* Some typedef to make it easy for C++ to make function pointers */
typedef int (*my_charset_conv_mb_wc)(CHARSET_INFO *, my_wc_t *,
@@ -370,7 +369,7 @@ typedef int (*my_charset_conv_mb_wc)(CHARSET_INFO *, my_wc_t *,
typedef int (*my_charset_conv_wc_mb)(CHARSET_INFO *, my_wc_t,
uchar *, uchar *);
typedef size_t (*my_charset_conv_case)(CHARSET_INFO *,
- char *, size_t, char *, size_t);
+ const char *, size_t, char *, size_t);
/*
A structure to return the statistics of a native string copying,
@@ -725,9 +724,11 @@ size_t my_copy_fix_mb(CHARSET_INFO *cs,
/* Functions for 8bit */
extern size_t my_caseup_str_8bit(CHARSET_INFO *, char *);
extern size_t my_casedn_str_8bit(CHARSET_INFO *, char *);
-extern size_t my_caseup_8bit(CHARSET_INFO *, char *src, size_t srclen,
+extern size_t my_caseup_8bit(CHARSET_INFO *,
+ const char *src, size_t srclen,
char *dst, size_t dstlen);
-extern size_t my_casedn_8bit(CHARSET_INFO *, char *src, size_t srclen,
+extern size_t my_casedn_8bit(CHARSET_INFO *,
+ const char *src, size_t srclen,
char *dst, size_t dstlen);
extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
@@ -821,17 +822,17 @@ int my_charlen_8bit(CHARSET_INFO *, const uchar *str, const uchar *end);
/* Functions for multibyte charsets */
extern size_t my_caseup_str_mb(CHARSET_INFO *, char *);
extern size_t my_casedn_str_mb(CHARSET_INFO *, char *);
-extern size_t my_caseup_mb(CHARSET_INFO *, char *src, size_t srclen,
- char *dst, size_t dstlen);
-extern size_t my_casedn_mb(CHARSET_INFO *, char *src, size_t srclen,
- char *dst, size_t dstlen);
-extern size_t my_caseup_mb_varlen(CHARSET_INFO *, char *src, size_t srclen,
- char *dst, size_t dstlen);
-extern size_t my_casedn_mb_varlen(CHARSET_INFO *, char *src, size_t srclen,
- char *dst, size_t dstlen);
-extern size_t my_caseup_ujis(CHARSET_INFO *, char *src, size_t srclen,
+extern size_t my_caseup_mb(CHARSET_INFO *,
+ const char *src, size_t srclen,
+ char *dst, size_t dstlen);
+extern size_t my_casedn_mb(CHARSET_INFO *,
+ const char *src, size_t srclen,
+ char *dst, size_t dstlen);
+extern size_t my_caseup_ujis(CHARSET_INFO *,
+ const char *src, size_t srclen,
char *dst, size_t dstlen);
-extern size_t my_casedn_ujis(CHARSET_INFO *, char *src, size_t srclen,
+extern size_t my_casedn_ujis(CHARSET_INFO *,
+ const char *src, size_t srclen,
char *dst, size_t dstlen);
extern int my_strcasecmp_mb(CHARSET_INFO * cs,const char *, const char *);
@@ -870,14 +871,6 @@ size_t my_strnxfrm_mb_nopad(CHARSET_INFO *,
uchar *dst, size_t dstlen, uint nweights,
const uchar *src, size_t srclen, uint flags);
-size_t my_strnxfrm_unicode(CHARSET_INFO *,
- uchar *dst, size_t dstlen, uint nweights,
- const uchar *src, size_t srclen, uint flags);
-
-size_t my_strnxfrm_unicode_nopad(CHARSET_INFO *,
- uchar *dst, size_t dstlen, uint nweights,
- const uchar *src, size_t srclen, uint flags);
-
size_t my_strnxfrmlen_unicode(CHARSET_INFO *, size_t);
size_t my_strnxfrm_unicode_full_bin(CHARSET_INFO *,
diff --git a/include/m_string.h b/include/m_string.h
index d50da8770c3..c8b5774b08c 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -99,7 +99,7 @@ extern char *strmake(char *dst,const char *src,size_t length);
#define strmake_buf(D,S) strmake(D, S, sizeof(D) - 1)
#else
#define strmake_buf(D,S) ({ \
- typeof (D) __x __attribute__((unused)) = { 2 }; \
+ __typeof__ (D) __x __attribute__((unused)) = { 2 }; \
strmake(D, S, sizeof(D) - 1); \
})
#endif
diff --git a/include/my_bit.h b/include/my_bit.h
index 36764d8253d..b19c660d0cd 100644
--- a/include/my_bit.h
+++ b/include/my_bit.h
@@ -106,11 +106,11 @@ static inline uint32 my_clear_highest_bit(uint32 v)
static inline uint32 my_reverse_bits(uint32 key)
{
- return (uint32)
- (_my_bits_reverse_table[ key & 255] << 24) |
- (_my_bits_reverse_table[(key>> 8) & 255] << 16) |
- (_my_bits_reverse_table[(key>>16) & 255] << 8) |
- _my_bits_reverse_table[(key>>24) ];
+ return
+ ((uint32)_my_bits_reverse_table[ key & 255] << 24) |
+ ((uint32)_my_bits_reverse_table[(key>> 8) & 255] << 16) |
+ ((uint32)_my_bits_reverse_table[(key>>16) & 255] << 8) |
+ (uint32)_my_bits_reverse_table[(key>>24) ];
}
/*
diff --git a/include/my_cpu.h b/include/my_cpu.h
index f2e26fca70c..cab016a8c4a 100644
--- a/include/my_cpu.h
+++ b/include/my_cpu.h
@@ -13,7 +13,7 @@
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., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301 USA
*/
/* instructions for specific cpu's */
diff --git a/include/my_global.h b/include/my_global.h
index 11d17ad146a..ea438e7171f 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -133,11 +133,6 @@
#define F_UNLCK 3
#define F_TO_EOF 0x3FFFFFFF
-/* Shared memory and named pipe connections are supported. */
-#define HAVE_SMEM 1
-#define HAVE_NAMED_PIPE 1
-#define shared_memory_buffer_length 16000
-#define default_shared_memory_base_name "MYSQL"
#endif /* _WIN32*/
@@ -246,7 +241,9 @@
AIX includes inttypes.h from sys/types.h
Explicitly request format macros before the first inclusion of inttypes.h
*/
-#define __STDC_FORMAT_MACROS
+#if !defined(__STDC_FORMAT_MACROS)
+#define __STDC_FORMAT_MACROS
+#endif // !defined(__STDC_FORMAT_MACROS)
#endif
@@ -984,7 +981,6 @@ typedef unsigned long my_off_t;
TODO Convert these to use Bitmap class.
*/
typedef ulonglong table_map; /* Used for table bits in join */
-typedef ulong nesting_map; /* Used for flags of nesting constructs */
/* often used type names - opaque declarations */
typedef const struct charset_info_st CHARSET_INFO;
@@ -1052,7 +1048,9 @@ typedef ulong myf; /* Type of MyFlags in my_funcs */
#include <my_byteorder.h>
-#ifdef HAVE_CHARSET_utf8
+#ifdef HAVE_CHARSET_utf8mb4
+#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8mb4"
+#elif defined(HAVE_CHARSET_utf8)
#define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8"
#else
#define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME
@@ -1186,8 +1184,6 @@ typedef struct { const char *dli_fname, dli_fbase; } Dl_info;
/* Things we don't need in the embedded version of MySQL */
/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */
-#undef HAVE_SMEM /* No shared memory */
-
#else
#define HAVE_REPLICATION
#define HAVE_EXTERNAL_CLIENT
diff --git a/include/my_pthread.h b/include/my_pthread.h
index c6379047c16..2712c7d8ffd 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -161,7 +161,7 @@ int pthread_cancel(pthread_t thread);
#define pthread_key(T,V) pthread_key_t V
#define my_pthread_getspecific_ptr(T,V) my_pthread_getspecific(T,(V))
#define my_pthread_setspecific_ptr(T,V) pthread_setspecific(T,(void*) (V))
-#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); }
+#define pthread_detach_this_thread()
#define pthread_handler_t EXTERNC void *
typedef void *(* pthread_handler)(void *);
diff --git a/include/my_service_manager.h b/include/my_service_manager.h
index 4d88e992b5e..d9f41ace4d5 100644
--- a/include/my_service_manager.h
+++ b/include/my_service_manager.h
@@ -24,7 +24,9 @@
sd-daemon.h may include inttypes.h. Explicitly request format macros before
the first inclusion of inttypes.h.
*/
+#if !defined(__STDC_FORMAT_MACROS)
#define __STDC_FORMAT_MACROS
+#endif // !defined(__STDC_FORMAT_MACROS)
#include <systemd/sd-daemon.h>
/** INTERVAL in seconds followed by printf style status */
#define service_manager_extend_timeout(INTERVAL, FMTSTR, ...) \
diff --git a/include/my_sys.h b/include/my_sys.h
index 325c473eb23..11993c02516 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -903,6 +903,7 @@ static inline char *safe_strdup_root(MEM_ROOT *root, const char *str)
}
extern char *strmake_root(MEM_ROOT *root,const char *str,size_t len);
extern void *memdup_root(MEM_ROOT *root,const void *str, size_t len);
+extern LEX_CSTRING safe_lexcstrdup_root(MEM_ROOT *root, const LEX_CSTRING str);
extern my_bool my_compress(uchar *, size_t *, size_t *);
extern my_bool my_uncompress(uchar *, size_t , size_t *);
extern uchar *my_compress_alloc(const uchar *packet, size_t *len,
diff --git a/include/my_time.h b/include/my_time.h
index cec168c6fd6..babd6101eeb 100644
--- a/include/my_time.h
+++ b/include/my_time.h
@@ -61,18 +61,23 @@ extern uchar days_in_month[];
TIME_FUZZY_DATES is used for the result will only be used for comparison
purposes. Conversion is as relaxed as possible.
*/
-#define TIME_FUZZY_DATES 1U
-#define TIME_DATETIME_ONLY 2U
-#define TIME_TIME_ONLY 4U
-#define TIME_NO_ZERO_IN_DATE (1UL << 23) /* == MODE_NO_ZERO_IN_DATE */
-#define TIME_NO_ZERO_DATE (1UL << 24) /* == MODE_NO_ZERO_DATE */
-#define TIME_INVALID_DATES (1UL << 25) /* == MODE_INVALID_DATES */
+#define C_TIME_FUZZY_DATES 1U
+#define C_TIME_DATETIME_ONLY 2U
+#define C_TIME_TIME_ONLY 4U
+#define C_TIME_NO_ZERO_IN_DATE (1UL << 23) /* == MODE_NO_ZERO_IN_DATE */
+#define C_TIME_NO_ZERO_DATE (1UL << 24) /* == MODE_NO_ZERO_DATE */
+#define C_TIME_INVALID_DATES (1UL << 25) /* == MODE_INVALID_DATES */
#define MYSQL_TIME_WARN_TRUNCATED 1U
#define MYSQL_TIME_WARN_OUT_OF_RANGE 2U
+#define MYSQL_TIME_WARN_EDOM 4U
+#define MYSQL_TIME_WARN_ZERO_DATE 8U
#define MYSQL_TIME_NOTE_TRUNCATED 16U
-#define MYSQL_TIME_WARN_WARNINGS (MYSQL_TIME_WARN_TRUNCATED|MYSQL_TIME_WARN_OUT_OF_RANGE)
+#define MYSQL_TIME_WARN_WARNINGS (MYSQL_TIME_WARN_TRUNCATED|\
+ MYSQL_TIME_WARN_OUT_OF_RANGE|\
+ MYSQL_TIME_WARN_EDOM|\
+ MYSQL_TIME_WARN_ZERO_DATE)
#define MYSQL_TIME_WARN_NOTES (MYSQL_TIME_NOTE_TRUNCATED)
#define MYSQL_TIME_WARN_HAVE_WARNINGS(x) MY_TEST((x) & MYSQL_TIME_WARN_WARNINGS)
@@ -110,6 +115,8 @@ static inline void my_time_status_init(MYSQL_TIME_STATUS *status)
my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date,
ulonglong flags, int *was_cut);
+my_bool str_to_DDhhmmssff(const char *str, size_t length, MYSQL_TIME *l_time,
+ ulong max_hour, MYSQL_TIME_STATUS *status);
my_bool str_to_time(const char *str, size_t length, MYSQL_TIME *l_time,
ulonglong flag, MYSQL_TIME_STATUS *status);
my_bool str_to_datetime(const char *str, size_t length, MYSQL_TIME *l_time,
@@ -117,16 +124,6 @@ my_bool str_to_datetime(const char *str, size_t length, MYSQL_TIME *l_time,
longlong number_to_datetime(longlong nr, ulong sec_part, MYSQL_TIME *time_res,
ulonglong flags, int *was_cut);
-static inline
-longlong double_to_datetime(double nr, MYSQL_TIME *ltime, ulonglong flags, int *cut)
-{
- if (nr < 0 || nr > LONGLONG_MAX)
- nr= (double)LONGLONG_MAX;
- return number_to_datetime((longlong) floor(nr),
- (ulong)((nr-floor(nr))*TIME_SECOND_PART_FACTOR),
- ltime, flags, cut);
-}
-
int number_to_time(my_bool neg, ulonglong nr, ulong sec_part,
MYSQL_TIME *ltime, int *was_cut);
ulonglong TIME_to_ulonglong_datetime(const MYSQL_TIME *);
diff --git a/include/myisamchk.h b/include/myisamchk.h
index 1a9605aac46..67c8a20e0b8 100644
--- a/include/myisamchk.h
+++ b/include/myisamchk.h
@@ -100,12 +100,13 @@ typedef struct st_handler_check_param
time_t backup_time; /* To sign backup files */
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];
- uint out_flag, warning_printed, error_printed, note_printed, verbose;
+ uint out_flag, error_printed, verbose;
uint opt_sort_key, total_files, max_level;
uint key_cache_block_size, pagecache_block_size;
int tmpfile_createflag, err_count;
myf myf_rw;
uint16 language;
+ my_bool warning_printed, note_printed, wrong_trd_printed;
my_bool using_global_keycache, opt_lock_memory, opt_follow_links;
my_bool retry_repair, force_sort, calc_checksum, static_row_size;
char temp_filename[FN_REFLEN];
diff --git a/include/mysql/plugin_auth.h b/include/mysql/plugin_auth.h
index 638d9b57fd9..44e51c3fd0b 100644
--- a/include/mysql/plugin_auth.h
+++ b/include/mysql/plugin_auth.h
@@ -27,7 +27,7 @@
#include <mysql/plugin.h>
-#define MYSQL_AUTHENTICATION_INTERFACE_VERSION 0x0201
+#define MYSQL_AUTHENTICATION_INTERFACE_VERSION 0x0202
#include <mysql/plugin_auth_common.h>
@@ -60,7 +60,8 @@ typedef struct st_mysql_server_auth_info
/**
A corresponding column value from the mysql.user table for the
- matching account name
+ matching account name or the preprocessed value, if preprocess_hash
+ method is not NULL
*/
const char *auth_string;
@@ -130,6 +131,47 @@ struct st_mysql_auth
used for authorization.
*/
int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info);
+ /**
+ Create a password hash (or digest) out of a plain-text password
+
+ Used in SET PASSWORD, GRANT, and CREATE USER to convert user specified
+ plain-text password into a value that will be stored in mysql.user table.
+
+ @see preprocess_hash
+
+ @param password plain-text password
+ @param password_length plain-text password length
+ @param hash the digest will be stored there
+ @param hash_length in: hash buffer size
+ out: the actual length of the hash
+
+ @return 0 for ok, 1 for error
+
+ Can be NULL.
+ */
+ int (*hash_password)(const char *password, size_t password_length,
+ char *hash, size_t *hash_length);
+
+ /**
+ Prepare the password hash for authentication.
+
+ Password hash is stored in the authentication_string column of the
+ mysql.user table in a text form. If a plugin needs to preprocess the
+ value somehow before the authentication (e.g. convert from hex or base64
+ to binary), it can do it in this method. This way the conversion
+ will happen only once, not for every authentication attempt.
+
+ The value written to the out buffer will be cached and later made
+ available to the authenticate_user() method in the
+ MYSQL_SERVER_AUTH_INFO::auth_string[] buffer.
+
+ @return 0 for ok, 1 for error
+
+ Can be NULL, in this case the mysql.user.authentication_string value will
+ be given to the authenticate_user() method as is, unconverted.
+ */
+ int (*preprocess_hash)(const char *hash, size_t hash_length,
+ unsigned char *out, size_t *out_length);
};
#ifdef __cplusplus
diff --git a/include/mysql/plugin_auth.h.pp b/include/mysql/plugin_auth.h.pp
index e515699cad6..7ed786cc1ab 100644
--- a/include/mysql/plugin_auth.h.pp
+++ b/include/mysql/plugin_auth.h.pp
@@ -561,4 +561,8 @@ struct st_mysql_auth
int interface_version;
const char *client_auth_plugin;
int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info);
+ int (*hash_password)(const char *password, size_t password_length,
+ char *hash, size_t *hash_length);
+ int (*preprocess_hash)(const char *hash, size_t hash_length,
+ unsigned char *out, size_t *out_length);
};
diff --git a/include/mysql/plugin_password_validation.h b/include/mysql/plugin_password_validation.h
index e2763483db6..699d42d6b50 100644
--- a/include/mysql/plugin_password_validation.h
+++ b/include/mysql/plugin_password_validation.h
@@ -42,8 +42,8 @@ struct st_mariadb_password_validation
Function provided by the plugin which should perform password validation
and return 0 if the password has passed the validation.
*/
- int (*validate_password)(MYSQL_CONST_LEX_STRING *username,
- MYSQL_CONST_LEX_STRING *password);
+ int (*validate_password)(const MYSQL_CONST_LEX_STRING *username,
+ const MYSQL_CONST_LEX_STRING *password);
};
#ifdef __cplusplus
diff --git a/include/mysql/plugin_password_validation.h.pp b/include/mysql/plugin_password_validation.h.pp
index 9701ad1b92f..b13f8cc9afb 100644
--- a/include/mysql/plugin_password_validation.h.pp
+++ b/include/mysql/plugin_password_validation.h.pp
@@ -531,6 +531,6 @@ void thd_wakeup_subsequent_commits(void* thd, int wakeup_error);
struct st_mariadb_password_validation
{
int interface_version;
- int (*validate_password)(MYSQL_CONST_LEX_STRING *username,
- MYSQL_CONST_LEX_STRING *password);
+ int (*validate_password)(const MYSQL_CONST_LEX_STRING *username,
+ const MYSQL_CONST_LEX_STRING *password);
};
diff --git a/include/mysql/psi/mysql_socket.h b/include/mysql/psi/mysql_socket.h
index b8854edbfd0..2076f8cc999 100644
--- a/include/mysql/psi/mysql_socket.h
+++ b/include/mysql/psi/mysql_socket.h
@@ -735,7 +735,7 @@ inline_mysql_socket_send
MYSQL_SOCKET mysql_socket, const SOCKBUF_T *buf, size_t n, int flags)
{
ssize_t result;
-
+ DBUG_ASSERT(mysql_socket.fd != INVALID_SOCKET);
#ifdef HAVE_PSI_SOCKET_INTERFACE
if (psi_likely(mysql_socket.m_psi != NULL))
{
@@ -776,7 +776,7 @@ inline_mysql_socket_recv
MYSQL_SOCKET mysql_socket, SOCKBUF_T *buf, size_t n, int flags)
{
ssize_t result;
-
+ DBUG_ASSERT(mysql_socket.fd != INVALID_SOCKET);
#ifdef HAVE_PSI_SOCKET_INTERFACE
if (psi_likely(mysql_socket.m_psi != NULL))
{
diff --git a/include/mysql/service_kill_statement.h b/include/mysql/service_kill_statement.h
index 995b21f0a9f..bfb222301eb 100644
--- a/include/mysql/service_kill_statement.h
+++ b/include/mysql/service_kill_statement.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, Monty Program Ab.
+/* Copyright (c) 2013, 2018, MariaDB
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
@@ -27,7 +27,7 @@
time-consuming loops, and gracefully abort the operation if it is
non-zero.
- thd_is_killed(thd)
+ thd_killed(thd)
@return 0 - no KILL statement was issued, continue normally
@return 1 - there was a KILL statement, abort the execution.
diff --git a/include/mysql/service_wsrep.h b/include/mysql/service_wsrep.h
index 1540a5e56fe..cefba6303fe 100644
--- a/include/mysql/service_wsrep.h
+++ b/include/mysql/service_wsrep.h
@@ -112,6 +112,7 @@ extern struct wsrep_service_st {
int (*wsrep_trx_is_aborting_func)(MYSQL_THD thd);
int (*wsrep_trx_order_before_func)(MYSQL_THD, MYSQL_THD);
void (*wsrep_unlock_rollback_func)();
+ void (*wsrep_set_data_home_dir_func)(const char *data_dir);
} *wsrep_service;
#ifdef MYSQL_DYNAMIC_PLUGIN
@@ -155,6 +156,7 @@ extern struct wsrep_service_st {
#define wsrep_trx_is_aborting(T) wsrep_service->wsrep_trx_is_aborting_func(T)
#define wsrep_trx_order_before(T1,T2) wsrep_service->wsrep_trx_order_before_func(T1,T2)
#define wsrep_unlock_rollback() wsrep_service->wsrep_unlock_rollback_func()
+#define wsrep_set_data_home_dir(A) wsrep_service->wsrep_set_data_home_dir_func(A)
#define wsrep_debug get_wsrep_debug()
#define wsrep_log_conflicts get_wsrep_log_conflicts()
@@ -214,6 +216,7 @@ void wsrep_thd_awake(THD *thd, my_bool signal);
void wsrep_thd_set_conflict_state(THD *thd, enum wsrep_conflict_state state);
bool wsrep_thd_ignore_table(THD *thd);
void wsrep_unlock_rollback();
+void wsrep_set_data_home_dir(const char *data_dir);
#endif
diff --git a/include/mysql_embed.h b/include/mysql_embed.h
index 12b18ff965e..3047593fb6c 100644
--- a/include/mysql_embed.h
+++ b/include/mysql_embed.h
@@ -25,7 +25,6 @@
/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */
#undef HAVE_DLOPEN /* No udf functions */
-#undef HAVE_SMEM /* No shared memory */
#endif /* EMBEDDED_LIBRARY */
#endif /* MYSQL_EMBED_INCLUDED */
diff --git a/include/service_versions.h b/include/service_versions.h
index 582b3912355..753d6444475 100644
--- a/include/service_versions.h
+++ b/include/service_versions.h
@@ -41,4 +41,4 @@
#define VERSION_thd_specifics 0x0100
#define VERSION_thd_timezone 0x0100
#define VERSION_thd_wait 0x0100
-#define VERSION_wsrep 0x0201
+#define VERSION_wsrep 0x0202
diff --git a/include/sql_common.h b/include/sql_common.h
index bbf459e1e55..ca7d2618bb9 100644
--- a/include/sql_common.h
+++ b/include/sql_common.h
@@ -1,7 +1,7 @@
#ifndef SQL_COMMON_INCLUDED
#define SQL_COMMON_INCLUDED
-/* Copyright (c) 2003, 2012, Oracle and/or its affiliates.
- Copyright (c) 2010, 2012, Monty Program Ab
+/* Copyright (c) 2003, 2018, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2018, MariaDB
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/ssl_compat.h b/include/ssl_compat.h
index 2777ae94527..c94b9671d5f 100644
--- a/include/ssl_compat.h
+++ b/include/ssl_compat.h
@@ -30,9 +30,9 @@
#define EVP_CIPHER_CTX_SIZE 176
#define EVP_MD_CTX_SIZE 48
#undef EVP_MD_CTX_init
-#define EVP_MD_CTX_init(X) do { bzero((X), EVP_MD_CTX_SIZE); EVP_MD_CTX_reset(X); } while(0)
+#define EVP_MD_CTX_init(X) do { memset((X), 0, EVP_MD_CTX_SIZE); EVP_MD_CTX_reset(X); } while(0)
#undef EVP_CIPHER_CTX_init
-#define EVP_CIPHER_CTX_init(X) do { bzero((X), EVP_CIPHER_CTX_SIZE); EVP_CIPHER_CTX_reset(X); } while(0)
+#define EVP_CIPHER_CTX_init(X) do { memset((X), 0, EVP_CIPHER_CTX_SIZE); EVP_CIPHER_CTX_reset(X); } while(0)
/*
Macros below are deprecated. OpenSSL 1.1 may define them or not,
diff --git a/include/violite.h b/include/violite.h
index 19c117ebd85..74b53f41fdd 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -38,7 +38,7 @@ typedef struct st_vio Vio;
enum enum_vio_type
{
VIO_CLOSED, VIO_TYPE_TCPIP, VIO_TYPE_SOCKET, VIO_TYPE_NAMEDPIPE,
- VIO_TYPE_SSL, VIO_TYPE_SHARED_MEMORY
+ VIO_TYPE_SSL
};
/**
@@ -68,13 +68,6 @@ Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);
Vio* mysql_socket_vio_new(MYSQL_SOCKET mysql_socket, enum enum_vio_type type, uint flags);
#ifdef __WIN__
Vio* vio_new_win32pipe(HANDLE hPipe);
-Vio* vio_new_win32shared_memory(HANDLE handle_file_map,
- HANDLE handle_map,
- HANDLE event_server_wrote,
- HANDLE event_server_read,
- HANDLE event_client_wrote,
- HANDLE event_client_read,
- HANDLE event_conn_closed);
#else
#define HANDLE void *
#endif /* __WIN__ */
@@ -265,22 +258,9 @@ struct st_vio
#ifdef HAVE_OPENSSL
void *ssl_arg;
#endif
-#ifdef HAVE_SMEM
- HANDLE handle_file_map;
- char *handle_map;
- HANDLE event_server_wrote;
- HANDLE event_server_read;
- HANDLE event_client_wrote;
- HANDLE event_client_read;
- HANDLE event_conn_closed;
- size_t shared_memory_remain;
- char *shared_memory_pos;
-#endif /* HAVE_SMEM */
#ifdef _WIN32
HANDLE hPipe;
OVERLAPPED overlapped;
- DWORD read_timeout_ms;
- DWORD write_timeout_ms;
#endif
};
#endif /* vio_violite_h_ */
diff --git a/include/wsrep.h b/include/wsrep.h
index 0c06bb32b31..f7a9b6b0231 100644
--- a/include/wsrep.h
+++ b/include/wsrep.h
@@ -25,7 +25,12 @@
#define WSREP_MYSQL_DB (char *)"mysql"
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) \
if (WSREP_ON && WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) \
- goto error;
+ goto wsrep_error_label;
+
+#define WSREP_TO_ISOLATION_BEGIN_ALTER(db_, table_, table_list_, alter_info_) \
+ if (WSREP_ON && WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, \
+ table_list_, alter_info_)) \
+ goto wsrep_error_label;
#define WSREP_TO_ISOLATION_END \
if (WSREP_ON && (WSREP(thd) || (thd && thd->wsrep_exec_mode==TOTAL_ORDER))) \
@@ -37,7 +42,7 @@
*/
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_) \
if (WSREP(thd) && !thd->lex->no_write_to_binlog \
- && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error;
+ && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto wsrep_error_label;
#define WSREP_DEBUG(...) \
if (wsrep_debug) WSREP_LOG(sql_print_information, ##__VA_ARGS__)
@@ -45,9 +50,9 @@
#define WSREP_WARN(...) WSREP_LOG(sql_print_warning, ##__VA_ARGS__)
#define WSREP_ERROR(...) WSREP_LOG(sql_print_error, ##__VA_ARGS__)
-#define WSREP_SYNC_WAIT(thd_, before_) \
- { if (WSREP_CLIENT(thd_) && \
- wsrep_sync_wait(thd_, before_)) goto error; }
+#define WSREP_SYNC_WAIT(thd_, before_) \
+ { if (WSREP_CLIENT(thd_) && \
+ wsrep_sync_wait(thd_, before_)) goto wsrep_error_label; }
#else
#define IF_WSREP(A,B) B
@@ -56,7 +61,8 @@
#define WSREP_INFO(...)
#define WSREP_WARN(...)
#define WSREP_ERROR(...)
-#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_)
+#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) do { } while(0)
+#define WSREP_TO_ISOLATION_BEGIN_ALTER(db_, table_, table_list_, alter_info_)
#define WSREP_TO_ISOLATION_END
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)
#define WSREP_SYNC_WAIT(thd_, before_)