summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-09-19 09:47:08 +0200
committerSergei Golubchik <serg@mariadb.org>2016-09-19 09:47:08 +0200
commitf9bdc7c01af52c04a05b5d0e890f86c77323d3b0 (patch)
tree09779236c1d7061fb1706524c2e3b357369eae8e /include
parentf7be8cf2854fc0c2871c1537e60b1d7cb1931a61 (diff)
parentf566a4f83c8c255e0192afa525fdeb0897927167 (diff)
downloadmariadb-git-f9bdc7c01af52c04a05b5d0e890f86c77323d3b0.tar.gz
Merge branch '10.2' into bb-10.2-jan
Diffstat (limited to 'include')
-rw-r--r--include/m_ctype.h70
-rw-r--r--include/my_stacktrace.h2
-rw-r--r--include/mysql.h1
-rw-r--r--include/mysql.h.pp17
-rw-r--r--include/mysql_com.h54
5 files changed, 133 insertions, 11 deletions
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 7a688f76acb..9812e9fa2eb 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -362,6 +362,8 @@ struct my_collation_handler_st
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 */
@@ -585,49 +587,81 @@ struct charset_info_st
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_bin;
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_latin1;
+extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_latin1_nopad;
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_filename;
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_utf8_general_ci;
extern struct charset_info_st my_charset_big5_bin;
extern struct charset_info_st my_charset_big5_chinese_ci;
+extern struct charset_info_st my_charset_big5_nopad_bin;
+extern struct charset_info_st my_charset_big5_chinese_nopad_ci;
extern struct charset_info_st my_charset_cp1250_czech_ci;
extern struct charset_info_st my_charset_cp932_bin;
extern struct charset_info_st my_charset_cp932_japanese_ci;
+extern struct charset_info_st my_charset_cp932_nopad_bin;
+extern struct charset_info_st my_charset_cp932_japanese_nopad_ci;
extern struct charset_info_st my_charset_eucjpms_bin;
extern struct charset_info_st my_charset_eucjpms_japanese_ci;
+extern struct charset_info_st my_charset_eucjpms_nopad_bin;
+extern struct charset_info_st my_charset_eucjpms_japanese_nopad_ci;
extern struct charset_info_st my_charset_euckr_bin;
extern struct charset_info_st my_charset_euckr_korean_ci;
+extern struct charset_info_st my_charset_euckr_nopad_bin;
+extern struct charset_info_st my_charset_euckr_korean_nopad_ci;
extern struct charset_info_st my_charset_gb2312_bin;
extern struct charset_info_st my_charset_gb2312_chinese_ci;
+extern struct charset_info_st my_charset_gb2312_nopad_bin;
+extern struct charset_info_st my_charset_gb2312_chinese_nopad_ci;
extern struct charset_info_st my_charset_gbk_bin;
extern struct charset_info_st my_charset_gbk_chinese_ci;
+extern struct charset_info_st my_charset_gbk_nopad_bin;
+extern struct charset_info_st my_charset_gbk_chinese_nopad_ci;
extern struct charset_info_st my_charset_latin1_bin;
+extern struct charset_info_st my_charset_latin1_nopad_bin;
extern struct charset_info_st my_charset_latin1_german2_ci;
extern struct charset_info_st my_charset_latin2_czech_ci;
extern struct charset_info_st my_charset_sjis_bin;
extern struct charset_info_st my_charset_sjis_japanese_ci;
+extern struct charset_info_st my_charset_sjis_nopad_bin;
+extern struct charset_info_st my_charset_sjis_japanese_nopad_ci;
extern struct charset_info_st my_charset_tis620_bin;
extern struct charset_info_st my_charset_tis620_thai_ci;
+extern struct charset_info_st my_charset_tis620_nopad_bin;
+extern struct charset_info_st my_charset_tis620_thai_nopad_ci;
extern struct charset_info_st my_charset_ucs2_bin;
extern struct charset_info_st my_charset_ucs2_general_ci;
+extern struct charset_info_st my_charset_ucs2_nopad_bin;
+extern struct charset_info_st my_charset_ucs2_general_nopad_ci;
extern struct charset_info_st my_charset_ucs2_general_mysql500_ci;
extern struct charset_info_st my_charset_ucs2_unicode_ci;
extern struct charset_info_st my_charset_ucs2_general_mysql500_ci;
extern struct charset_info_st my_charset_ujis_bin;
extern struct charset_info_st my_charset_ujis_japanese_ci;
+extern struct charset_info_st my_charset_ujis_nopad_bin;
+extern struct charset_info_st my_charset_ujis_japanese_nopad_ci;
extern struct charset_info_st my_charset_utf16_bin;
extern struct charset_info_st my_charset_utf16_general_ci;
extern struct charset_info_st my_charset_utf16_unicode_ci;
extern struct charset_info_st my_charset_utf16le_bin;
extern struct charset_info_st my_charset_utf16le_general_ci;
+extern struct charset_info_st my_charset_utf16_general_nopad_ci;
+extern struct charset_info_st my_charset_utf16_nopad_bin;
+extern struct charset_info_st my_charset_utf16le_nopad_bin;
+extern struct charset_info_st my_charset_utf16le_general_nopad_ci;
extern struct charset_info_st my_charset_utf32_bin;
extern struct charset_info_st my_charset_utf32_general_ci;
extern struct charset_info_st my_charset_utf32_unicode_ci;
+extern struct charset_info_st my_charset_utf32_nopad_bin;
+extern struct charset_info_st my_charset_utf32_general_nopad_ci;
extern struct charset_info_st my_charset_utf8_bin;
+extern struct charset_info_st my_charset_utf8_nopad_bin;
+extern struct charset_info_st my_charset_utf8_general_nopad_ci;
extern struct charset_info_st my_charset_utf8_general_mysql500_ci;
extern struct charset_info_st my_charset_utf8_unicode_ci;
extern struct charset_info_st my_charset_utf8mb4_bin;
extern struct charset_info_st my_charset_utf8mb4_general_ci;
+extern struct charset_info_st my_charset_utf8mb4_nopad_bin;
+extern struct charset_info_st my_charset_utf8mb4_general_nopad_ci;
extern struct charset_info_st my_charset_utf8mb4_unicode_ci;
#define MY_UTF8MB3 "utf8"
@@ -653,6 +687,11 @@ extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, size_t,
extern void my_hash_sort_simple(CHARSET_INFO *cs,
const uchar *key, size_t len,
ulong *nr1, ulong *nr2);
+
+extern void my_hash_sort_simple_nopad(CHARSET_INFO *cs,
+ const uchar *key, size_t len,
+ ulong *nr1, ulong *nr2);
+
extern void my_hash_sort_bin(CHARSET_INFO *cs,
const uchar *key, size_t len, ulong *nr1,
ulong *nr2);
@@ -824,18 +863,38 @@ int my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
const uchar *key, size_t len,ulong *nr1, ulong *nr2);
+void my_hash_sort_mb_nopad_bin(CHARSET_INFO *cs __attribute__((unused)),
+ const uchar *key, size_t len,
+ ulong *nr1, ulong *nr2);
+
size_t my_strnxfrm_mb(CHARSET_INFO *,
uchar *dst, size_t dstlen, uint nweights,
const uchar *src, size_t srclen, uint flags);
+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 *,
- uchar *dst, size_t dstlen, uint nweights,
- const uchar *src, size_t srclen, uint flags);
+ uchar *dst, size_t dstlen,
+ uint nweights, const uchar *src,
+ size_t srclen, uint flags);
+
+size_t my_strnxfrm_unicode_full_nopad_bin(CHARSET_INFO *,
+ uchar *dst, size_t dstlen,
+ uint nweights, const uchar *src,
+ size_t srclen, uint flags);
+
size_t my_strnxfrmlen_unicode_full_bin(CHARSET_INFO *, size_t);
int my_wildcmp_unicode(CHARSET_INFO *cs,
@@ -865,7 +924,6 @@ void my_string_metadata_get(MY_STRING_METADATA *metadata,
CHARSET_INFO *cs, const char *str, size_t len);
uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len);
my_bool my_charset_is_ascii_based(CHARSET_INFO *cs);
-my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs);
uint my_charset_repertoire(CHARSET_INFO *cs);
uint my_strxfrm_flag_normalize(uint flags, uint nlevels);
@@ -874,8 +932,10 @@ void my_strxfrm_desc_and_reverse(uchar *str, uchar *strend,
size_t my_strxfrm_pad_desc_and_reverse(CHARSET_INFO *cs,
uchar *str, uchar *frmend, uchar *strend,
uint nweights, uint flags, uint level);
-
-my_bool my_charset_is_ascii_compatible(CHARSET_INFO *cs);
+size_t my_strxfrm_pad_desc_and_reverse_nopad(CHARSET_INFO *cs,
+ uchar *str, uchar *frmend,
+ uchar *strend, uint nweights,
+ uint flags, uint level);
const MY_CONTRACTIONS *my_charset_get_contractions(CHARSET_INFO *cs,
int level);
diff --git a/include/my_stacktrace.h b/include/my_stacktrace.h
index fb2525e3a12..fad6e532de9 100644
--- a/include/my_stacktrace.h
+++ b/include/my_stacktrace.h
@@ -45,7 +45,7 @@ C_MODE_START
#if defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE)
void my_init_stacktrace();
void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack);
-void my_safe_print_str(const char* val, int max_len);
+int my_safe_print_str(const char* val, int max_len);
void my_write_core(int sig);
#if BACKTRACE_DEMANGLE
char *my_demangle(const char *mangled_name, int *status);
diff --git a/include/mysql.h b/include/mysql.h
index 19099b4f404..eab859270f7 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -137,6 +137,7 @@ typedef unsigned long long my_ulonglong;
/* backward compatibility define - to be removed eventually */
#define ER_WARN_DATA_TRUNCATED WARN_DATA_TRUNCATED
#define WARN_PLUGIN_DELETE_BUILTIN ER_PLUGIN_DELETE_BUILTIN
+#define ER_FK_DUP_NAME ER_DUP_CONSTRAINT_NAME
typedef struct st_mysql_rows {
struct st_mysql_rows *next; /* list of rows */
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index 0c06141df6c..857f5b99a90 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
};
@@ -30,7 +33,7 @@ typedef struct st_net {
char save_char;
char net_skip_rest_factor;
my_bool thread_specific_malloc;
- my_bool compress;
+ unsigned char compress;
my_bool unused3;
void *thd;
unsigned int last_errno;
@@ -84,6 +87,16 @@ enum enum_mysql_set_option
MYSQL_OPTION_MULTI_STATEMENTS_ON,
MYSQL_OPTION_MULTI_STATEMENTS_OFF
};
+enum enum_session_state_type
+{
+ SESSION_TRACK_SYSTEM_VARIABLES,
+ SESSION_TRACK_SCHEMA,
+ SESSION_TRACK_STATE_CHANGE,
+ SESSION_TRACK_GTIDS,
+ SESSION_TRACK_TRANSACTION_CHARACTERISTICS,
+ SESSION_TRACK_TRANSACTION_STATE,
+ SESSION_TRACK_always_at_the_end
+};
my_bool my_net_init(NET *net, Vio* vio, void *thd, unsigned int my_flags);
void my_net_local_init(NET *net);
void net_end(NET *net);
diff --git a/include/mysql_com.h b/include/mysql_com.h
index c65c5de7f66..96b872ace37 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -73,6 +73,14 @@
#define TABLE_PARTITION_COMMENT_MAXLEN 1024
/*
+ Maximum length of protocol packet.
+ OK packet length limit also restricted to this value as any length greater
+ than this value will have first byte of OK packet to be 254 thus does not
+ provide a means to identify if this is OK or EOF packet.
+*/
+#define MAX_PACKET_LENGTH (256L*256L*256L-1)
+
+/*
USER_HOST_BUFF_SIZE -- length of string buffer, that is enough to contain
username and hostname parts of the user identifier with trailing zero in
MySQL standard format:
@@ -105,7 +113,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
@@ -218,6 +229,14 @@ enum enum_server_command
/* Don't close the connection for a connection with expired password. */
#define CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS (1UL << 22)
+/**
+ Capable of handling server state change information. Its a hint to the
+ server to include the state change information in Ok packet.
+*/
+#define CLIENT_SESSION_TRACK (1UL << 23)
+/* Client no longer needs EOF packet */
+#define CLIENT_DEPRECATE_EOF (1UL << 24)
+
#define CLIENT_PROGRESS_OBSOLETE (1UL << 29)
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
/*
@@ -273,6 +292,8 @@ enum enum_server_command
MARIADB_CLIENT_PROGRESS | \
CLIENT_PLUGIN_AUTH | \
CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA | \
+ CLIENT_SESSION_TRACK |\
+ CLIENT_DEPRECATE_EOF |\
CLIENT_CONNECT_ATTRS |\
MARIADB_CLIENT_COM_MULTI)
@@ -337,6 +358,11 @@ enum enum_server_command
*/
#define SERVER_STATUS_IN_TRANS_READONLY 8192
+/**
+ This status flag, when on, implies that one of the state information has
+ changed on the server because of the execution of the last statement.
+*/
+#define SERVER_SESSION_STATE_CHANGED (1UL << 14)
/**
Server status flags that must be cleared when starting
@@ -353,7 +379,8 @@ enum enum_server_command
SERVER_QUERY_WAS_SLOW |\
SERVER_STATUS_DB_DROPPED |\
SERVER_STATUS_CURSOR_EXISTS|\
- SERVER_STATUS_LAST_ROW_SENT)
+ SERVER_STATUS_LAST_ROW_SENT|\
+ SERVER_SESSION_STATE_CHANGED)
#define MYSQL_ERRMSG_SIZE 512
#define NET_READ_TIMEOUT 30 /* Timeout on read */
@@ -391,7 +418,7 @@ typedef struct st_net {
char save_char;
char net_skip_rest_factor;
my_bool thread_specific_malloc;
- my_bool compress;
+ unsigned char compress;
my_bool unused3; /* Please remove with the next incompatible ABI change. */
/*
Pointer to query object in query cache, do not equal NULL (0) for
@@ -520,6 +547,26 @@ enum enum_mysql_set_option
MYSQL_OPTION_MULTI_STATEMENTS_OFF
};
+/*
+ Type of state change information that the server can include in the Ok
+ packet.
+*/
+enum enum_session_state_type
+{
+ SESSION_TRACK_SYSTEM_VARIABLES, /* Session system variables */
+ SESSION_TRACK_SCHEMA, /* Current schema */
+ SESSION_TRACK_STATE_CHANGE, /* track session state changes */
+ SESSION_TRACK_GTIDS,
+ SESSION_TRACK_TRANSACTION_CHARACTERISTICS, /* Transaction chistics */
+ SESSION_TRACK_TRANSACTION_STATE, /* Transaction state */
+ SESSION_TRACK_always_at_the_end /* must be last */
+};
+
+#define SESSION_TRACK_BEGIN SESSION_TRACK_SYSTEM_VARIABLES
+
+#define IS_SESSION_STATE_TYPE(T) \
+ (((int)(T) >= SESSION_TRACK_BEGIN) && ((T) < SESSION_TRACK_always_at_the_end))
+
#define net_new_transaction(net) ((net)->pkt_nr=0)
#ifdef __cplusplus
@@ -638,6 +685,7 @@ my_ulonglong net_field_length_ll(uchar **packet);
my_ulonglong safe_net_field_length_ll(uchar **packet, size_t packet_len);
uchar *net_store_length(uchar *pkg, ulonglong length);
uchar *safe_net_store_length(uchar *pkg, size_t pkg_len, ulonglong length);
+unsigned int net_length_size(ulonglong num);
#endif
#ifdef __cplusplus