From 640051e06aa585b056671738a6614cd314074ac6 Mon Sep 17 00:00:00 2001 From: vinchen Date: Sat, 8 Oct 2016 12:07:26 +0800 Subject: [PATCH 01/71] Binlog compressed Add some event types for the compressed event, there are: QUERY_COMPRESSED_EVENT, WRITE_ROWS_COMPRESSED_EVENT_V1, UPDATE_ROWS_COMPRESSED_EVENT_V1, DELETE_POWS_COMPRESSED_EVENT_V1, WRITE_ROWS_COMPRESSED_EVENT, UPDATE_ROWS_COMPRESSED_EVENT, DELETE_POWS_COMPRESSED_EVENT. These events inheritance the uncompressed editor events. One of their constructor functions and write function have been overridden for uncompressing and compressing. Anything but this is totally the same. On slave, The IO thread will uncompress and convert them When it receiving the events from the master. So the SQL and worker threads can be stay unchanged. Now we use zlib as compress algorithm. It maybe support other algorithm in the future. --- client/mysqlbinlog.cc | 7 + sql/log.cc | 2 +- sql/log_event.cc | 550 +++++++++++++++++++++++++++++++++++++- sql/log_event.h | 123 ++++++++- sql/mysqld.cc | 2 + sql/mysqld.h | 3 +- sql/rpl_rli.cc | 6 + sql/share/errmsg-utf8.txt | 2 + sql/slave.cc | 67 ++++- sql/sql_class.cc | 52 +++- sql/sql_class.h | 6 + sql/sql_repl.cc | 4 +- sql/sys_vars.cc | 12 + 13 files changed, 797 insertions(+), 39 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 6a52c9fe29a1e..94443791441dc 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1002,6 +1002,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, switch (ev_type) { case QUERY_EVENT: + case QUERY_COMPRESSED_EVENT: { Query_log_event *qe= (Query_log_event*)ev; if (!qe->is_trans_keyword()) @@ -1243,6 +1244,12 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, case WRITE_ROWS_EVENT_V1: case UPDATE_ROWS_EVENT_V1: case DELETE_ROWS_EVENT_V1: + case WRITE_ROWS_COMPRESSED_EVENT: + case DELETE_ROWS_COMPRESSED_EVENT: + case UPDATE_ROWS_COMPRESSED_EVENT: + case WRITE_ROWS_COMPRESSED_EVENT_V1: + case UPDATE_ROWS_COMPRESSED_EVENT_V1: + case DELETE_ROWS_COMPRESSED_EVENT_V1: { Rows_log_event *e= (Rows_log_event*) ev; if (print_row_event(print_event_info, ev, e->get_table_id(), diff --git a/sql/log.cc b/sql/log.cc index 2c29071574132..4d903154d9884 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -9838,7 +9838,7 @@ int TC_LOG_BINLOG::recover(LOG_INFO *linfo, const char *last_log_name, ((last_gtid_standalone && !ev->is_part_of_group(typ)) || (!last_gtid_standalone && (typ == XID_EVENT || - (typ == QUERY_EVENT && + (LOG_EVENT_IS_QUERY(typ) && (((Query_log_event *)ev)->is_commit() || ((Query_log_event *)ev)->is_rollback())))))) { diff --git a/sql/log_event.cc b/sql/log_event.cc index 01bb5e7a56125..fdf8007283db8 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -51,6 +51,7 @@ #include "rpl_utility.h" #include "rpl_constants.h" #include "sql_digest.h" +#include "zlib.h" #define my_b_write_string(A, B) my_b_write((A), (uchar*)(B), (uint) (sizeof(B) - 1)) @@ -702,6 +703,271 @@ char *str_to_hex(char *to, const char *from, uint len) return to; // pointer to end 0 of 'to' } +#define BINLOG_COMPRESSED_HEADER_LEN 1 +#define BINLOG_COMPRESSED_ORIGINAL_LENGTH_MAX_BYTES 4 +/** + Compressed Record + Record Header: 1 Byte + 0 Bit: Always 1, mean compressed; + 1-3 Bit: Reversed, compressed algorithmAlways 0, means zlib + 4-7 Bit: Bytes of "Record Original Length" + Record Original Length: 1-4 Bytes + Compressed Buf: +*/ + +/** + Get the length of compress content. +*/ + +uint32 binlog_get_compress_len(uint32 len) +{ + /* 5 for the begin content, 1 reserved for a '\0'*/ + return ALIGN_SIZE((BINLOG_COMPRESSED_HEADER_LEN + BINLOG_COMPRESSED_ORIGINAL_LENGTH_MAX_BYTES) + + compressBound(len) + 1); +} + +/** + Compress buf from 'src' to 'dst'. + + Note: 1) Then the caller should guarantee the length of 'dst', which + can be got by binlog_get_uncompress_len, is enough to hold + the content uncompressed. + 2) The 'comlen' should stored the length of 'dst', and it will + be set as the size of compressed content after return. + + return zero if successful, others otherwise. +*/ +int binlog_buf_compress(const char *src, char *dst, uint32 len, uint32 *comlen) +{ + uchar lenlen; + if (len & 0xFF000000) + { + dst[1] = uchar(len >> 24); + dst[2] = uchar(len >> 16); + dst[3] = uchar(len >> 8); + dst[4] = uchar(len); + lenlen = 4; + } + else if (len & 0x00FF0000) + { + dst[1] = uchar(len >> 16); + dst[2] = uchar(len >> 8); + dst[3] = uchar(len); + lenlen = 3; + } + else if (len & 0x0000FF00) + { + dst[1] = uchar(len >> 8); + dst[2] = uchar(len); + lenlen = 2; + } + else + { + dst[1] = uchar(len); + lenlen = 1; + } + dst[0] = 0x80 | (lenlen & 0x07); + + uLongf tmplen = (uLongf)*comlen - BINLOG_COMPRESSED_HEADER_LEN - lenlen - 1; + if (compress((Bytef *)dst + BINLOG_COMPRESSED_HEADER_LEN + lenlen, &tmplen, (const Bytef *)src, (uLongf)len) != Z_OK) + { + return 1; + } + *comlen = (uint32)tmplen + BINLOG_COMPRESSED_HEADER_LEN + lenlen; + return 0; +} + +/** + Convert a query_compressed_log_event to query_log_event + from 'src' to 'dst'(malloced inside), the size after compress + stored in 'newlen'. + + @Warning: + 1)The caller should call my_free to release 'dst'. + + return zero if successful, others otherwise. +*/ + +int query_event_uncompress(const Format_description_log_event *description_event, bool contain_checksum, + const char *src, char **dst, ulong *newlen) +{ + ulong len = uint4korr(src + EVENT_LEN_OFFSET); + const char *tmp = src; + + DBUG_ASSERT((uchar)src[EVENT_TYPE_OFFSET] == QUERY_COMPRESSED_EVENT); + + uint8 common_header_len= description_event->common_header_len; + uint8 post_header_len= description_event->post_header_len[QUERY_COMPRESSED_EVENT-1]; + + tmp += common_header_len; + + uint db_len = (uint)tmp[Q_DB_LEN_OFFSET]; + uint16 status_vars_len= uint2korr(tmp + Q_STATUS_VARS_LEN_OFFSET); + + tmp += post_header_len + status_vars_len + db_len + 1; + + uint32 un_len = binlog_get_uncompress_len(tmp); + *newlen = (tmp - src) + un_len; + if(contain_checksum) + *newlen += BINLOG_CHECKSUM_LEN; + + *dst = (char *)my_malloc(ALIGN_SIZE(*newlen), MYF(MY_FAE)); + if (!*dst) + { + return 1; + } + + /* copy the head*/ + memcpy(*dst, src , tmp - src); + if (binlog_buf_uncompress(tmp, *dst + (tmp - src), len - (tmp - src), &un_len)) + { + my_free(*dst); + return 1; + } + + (*dst)[EVENT_TYPE_OFFSET] = QUERY_EVENT; + int4store(*dst + EVENT_LEN_OFFSET, *newlen); + if(contain_checksum){ + ulong clear_len = *newlen - BINLOG_CHECKSUM_LEN; + int4store(*dst + clear_len, my_checksum(0L, (uchar *)*dst, clear_len)); + } + return 0; +} + +int Row_log_event_uncompress(const Format_description_log_event *description_event, bool contain_checksum, + const char *src, char **dst, ulong *newlen) +{ + Log_event_type type = (Log_event_type)(uchar)src[EVENT_TYPE_OFFSET]; + ulong len = uint4korr(src + EVENT_LEN_OFFSET); + const char *tmp = src; + char *buf = NULL; + + DBUG_ASSERT(LOG_EVENT_IS_ROW_COMPRESSED(type)); + + uint8 common_header_len= description_event->common_header_len; + uint8 post_header_len= description_event->post_header_len[type-1]; + + tmp += common_header_len + ROWS_HEADER_LEN_V1; + if (post_header_len == ROWS_HEADER_LEN_V2) + { + /* + Have variable length header, check length, + which includes length bytes + */ + uint16 var_header_len= uint2korr(tmp); + assert(var_header_len >= 2); + + /* skip over var-len header, extracting 'chunks' */ + tmp += var_header_len; + + /* get the uncompressed event type */ + type = (Log_event_type)(type - WRITE_ROWS_COMPRESSED_EVENT + WRITE_ROWS_EVENT); + } + else + { + /* get the uncompressed event type */ + type = (Log_event_type)(type - WRITE_ROWS_COMPRESSED_EVENT_V1 + WRITE_ROWS_EVENT_V1); + } + + + ulong m_width = net_field_length((uchar **)&tmp); + tmp += (m_width + 7) / 8; + + if (type == UPDATE_ROWS_EVENT_V1 || type == UPDATE_ROWS_EVENT) + { + tmp += (m_width + 7) / 8; + } + + uint32 un_len = binlog_get_uncompress_len(tmp); + *newlen = (tmp - src) + un_len; + if(contain_checksum) + *newlen += BINLOG_CHECKSUM_LEN; + + uint32 alloc_size = ALIGN_SIZE(*newlen); + buf = (char *)my_malloc(alloc_size , MYF(MY_FAE)); + if (!buf) + { + return 1; + } + + /* copy the head*/ + memcpy(buf, src , tmp - src); + /* uncompress the body */ + if (binlog_buf_uncompress(tmp, buf + (tmp - src), len - (tmp - src), &un_len)) + { + my_free(buf); + return 1; + } + + buf[EVENT_TYPE_OFFSET] = type; + int4store(buf + EVENT_LEN_OFFSET, *newlen); + if(contain_checksum){ + ulong clear_len = *newlen - BINLOG_CHECKSUM_LEN; + int4store(buf + clear_len, my_checksum(0L, (uchar *)buf, clear_len)); + } + *dst = buf; + return 0; +} + +/** + Get the length of uncompress content. +*/ + +uint32 binlog_get_uncompress_len(const char *buf) +{ + DBUG_ASSERT((buf[0] & 0xe0) == 0x80); + uint32 lenlen = buf[0] & 0x07; + uint32 len = 0; + switch(lenlen) + { + case 1: + len = uchar(buf[1]); + break; + case 2: + len = uchar(buf[1]) << 8 | uchar(buf[2]); + break; + case 3: + len = uchar(buf[1]) << 16 | uchar(buf[2]) << 8 | uchar(buf[3]); + break; + case 4: + len = uchar(buf[1]) << 24 | uchar(buf[2]) << 16 | uchar(buf[3]) << 8 | uchar(buf[4]); + break; + default: + DBUG_ASSERT(lenlen >= 1 && lenlen <= 4); + break; + } + return len; +} + +/** + Uncompress the content in 'src' with length of 'len' to 'dst'. + + Note: 1) Then the caller should guarantee the length of 'dst' (which + can be got by statement_get_uncompress_len) is enough to hold + the content uncompressed. + 2) The 'newlen' should stored the length of 'dst', and it will + be set as the size of uncompressed content after return. + + return zero if successful, others otherwise. +*/ +int binlog_buf_uncompress(const char *src, char *dst, uint32 len, uint32 *newlen) +{ + if((src[0] & 0x80) == 0) + { + return 1; + } + + uint32 lenlen = src[0] & 0x07; + uLongf buflen = *newlen; + if(uncompress((Bytef *)dst, &buflen, (const Bytef*)src + 1 + lenlen, len) != Z_OK) + { + return 1; + } + + *newlen = (uint32)buflen; + return 0; +} + #ifndef MYSQL_CLIENT /** @@ -828,6 +1094,13 @@ const char* Log_event::get_type_str(Log_event_type type) case TRANSACTION_CONTEXT_EVENT: return "Transaction_context"; case VIEW_CHANGE_EVENT: return "View_change"; case XA_PREPARE_LOG_EVENT: return "XA_prepare"; + case QUERY_COMPRESSED_EVENT: return "Query_compressed"; + case WRITE_ROWS_COMPRESSED_EVENT: return "Write_rows_compressed"; + case UPDATE_ROWS_COMPRESSED_EVENT: return "Update_rows_compressed"; + case DELETE_ROWS_COMPRESSED_EVENT: return "Delete_rows_compressed"; + case WRITE_ROWS_COMPRESSED_EVENT_V1: return "Write_rows_compressed_v1"; + case UPDATE_ROWS_COMPRESSED_EVENT_V1: return "Update_rows_compressed_v1"; + case DELETE_ROWS_COMPRESSED_EVENT_V1: return "Delete_rows_compressed_v1"; default: return "Unknown"; /* impossible */ } @@ -1661,6 +1934,9 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, case QUERY_EVENT: ev = new Query_log_event(buf, event_len, fdle, QUERY_EVENT); break; + case QUERY_COMPRESSED_EVENT: + ev = new Query_compressed_log_event(buf, event_len, fdle, QUERY_COMPRESSED_EVENT); + break; case LOAD_EVENT: ev = new Load_log_event(buf, event_len, fdle); break; @@ -1735,6 +2011,19 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, ev = new Delete_rows_log_event(buf, event_len, fdle); break; + case WRITE_ROWS_COMPRESSED_EVENT: + case WRITE_ROWS_COMPRESSED_EVENT_V1: + ev = new Write_rows_compressed_log_event(buf, event_len, fdle); + break; + case UPDATE_ROWS_COMPRESSED_EVENT: + case UPDATE_ROWS_COMPRESSED_EVENT_V1: + ev = new Update_rows_compressed_log_event(buf, event_len, fdle); + break; + case DELETE_ROWS_COMPRESSED_EVENT: + case DELETE_ROWS_COMPRESSED_EVENT_V1: + ev = new Delete_rows_compressed_log_event(buf, event_len, fdle); + break; + /* MySQL GTID events are ignored */ case GTID_LOG_EVENT: case ANONYMOUS_GTID_LOG_EVENT: @@ -1778,7 +2067,7 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, else { DBUG_PRINT("error",("Unknown event code: %d", - (int) buf[EVENT_TYPE_OFFSET])); + (uchar) buf[EVENT_TYPE_OFFSET])); ev= NULL; break; } @@ -2831,11 +3120,32 @@ void Log_event::print_base64(IO_CACHE* file, } case UPDATE_ROWS_EVENT: case UPDATE_ROWS_EVENT_V1: - { - ev= new Update_rows_log_event((const char*) ptr, size, - glob_description_event); - break; - } + { + ev= new Update_rows_log_event((const char*) ptr, size, + glob_description_event); + break; + } + case WRITE_ROWS_COMPRESSED_EVENT: + case WRITE_ROWS_COMPRESSED_EVENT_V1: + { + ev= new Write_rows_compressed_log_event((const char*) ptr, size, + glob_description_event); + break; + } + case UPDATE_ROWS_COMPRESSED_EVENT: + case UPDATE_ROWS_COMPRESSED_EVENT_V1: + { + ev= new Update_rows_compressed_log_event((const char*) ptr, size, + glob_description_event); + break; + } + case DELETE_ROWS_COMPRESSED_EVENT: + case DELETE_ROWS_COMPRESSED_EVENT_V1: + { + ev= new Delete_rows_compressed_log_event((const char*) ptr, size, + glob_description_event); + break; + } default: break; } @@ -3190,6 +3500,23 @@ bool Query_log_event::write() write_footer(); } +bool Query_compressed_log_event::write() +{ + const char *query_tmp = query; + uint32 q_len_tmp = q_len; + bool ret = true; + q_len = binlog_get_compress_len(q_len); + query = (char *)my_malloc(q_len, MYF(MY_FAE)); + if(query && !binlog_buf_compress(query_tmp, (char *)query, q_len_tmp, &q_len)) + { + ret = Query_log_event::write(); + } + my_free((void *)query); + query = query_tmp; + q_len = q_len_tmp; + return ret; +} + /** The simplest constructor that could possibly work. This is used for creating static objects that have a special meaning and are invisible @@ -3382,6 +3709,15 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, DBUG_PRINT("info",("Query_log_event has flags2: %lu sql_mode: %llu cache_tye: %d", (ulong) flags2, sql_mode, cache_type)); } + +Query_compressed_log_event::Query_compressed_log_event(THD* thd_arg, const char* query_arg, + ulong query_length, bool using_trans, + bool direct, bool suppress_use, int errcode) + :Query_log_event(thd_arg, query_arg, query_length, using_trans, direct, suppress_use, errcode), + query_buf(0) +{ + +} #endif /* MYSQL_CLIENT */ @@ -3788,6 +4124,28 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, DBUG_VOID_RETURN; } +Query_compressed_log_event::Query_compressed_log_event(const char *buf, uint event_len, + const Format_description_log_event + *description_event, + Log_event_type event_type) + :Query_log_event(buf, event_len, description_event, event_type),query_buf(NULL) +{ + if(query) + { + uint32 un_len=binlog_get_uncompress_len(query); + query_buf = (Log_event::Byte*)my_malloc(ALIGN_SIZE(un_len + 1), MYF(MY_WME)); //reserve one byte for '\0' + if(query_buf && !binlog_buf_uncompress(query, (char *)query_buf, q_len, &un_len)) + { + query_buf[un_len] = 0; + query = (const char *)query_buf; + q_len = un_len; + } + else + { + query= 0; + } + } +} /* Replace a binlog event read into a packet with a dummy event. Either a @@ -5056,6 +5414,15 @@ Format_description_log_event(uint8 binlog_ver, const char* server_ver) post_header_len[GTID_LIST_EVENT-1]= GTID_LIST_HEADER_LEN; post_header_len[START_ENCRYPTION_EVENT-1]= START_ENCRYPTION_HEADER_LEN; + //compressed event + post_header_len[QUERY_COMPRESSED_EVENT-1]= QUERY_HEADER_LEN; + post_header_len[WRITE_ROWS_COMPRESSED_EVENT-1]= ROWS_HEADER_LEN_V2; + post_header_len[UPDATE_ROWS_COMPRESSED_EVENT-1]= ROWS_HEADER_LEN_V2; + post_header_len[DELETE_ROWS_COMPRESSED_EVENT-1]= ROWS_HEADER_LEN_V2; + post_header_len[WRITE_ROWS_COMPRESSED_EVENT_V1-1]= ROWS_HEADER_LEN_V1; + post_header_len[UPDATE_ROWS_COMPRESSED_EVENT_V1-1]= ROWS_HEADER_LEN_V1; + post_header_len[DELETE_ROWS_COMPRESSED_EVENT_V1-1]= ROWS_HEADER_LEN_V1; + // Sanity-check that all post header lengths are initialized. int i; for (i=0; icommon_header_len; - Log_event_type event_type= (Log_event_type) buf[EVENT_TYPE_OFFSET]; + Log_event_type event_type= (Log_event_type)(uchar)buf[EVENT_TYPE_OFFSET]; m_type= event_type; uint8 const post_header_len= description_event->post_header_len[event_type-1]; @@ -9503,8 +9870,7 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len, m_cols_ai.bitmap= m_cols.bitmap; /* See explanation in is_valid() */ - if ((event_type == UPDATE_ROWS_EVENT) || - (event_type == UPDATE_ROWS_EVENT_V1)) + if (LOG_EVENT_IS_UPDATE_ROW(event_type)) { DBUG_PRINT("debug", ("Reading from %p", ptr_after_width)); @@ -9551,6 +9917,31 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len, DBUG_VOID_RETURN; } +void Rows_log_event::uncompress_buf() +{ + uint32 un_len = binlog_get_uncompress_len((char *)m_rows_buf); + uchar *new_buf= (uchar*) my_malloc(ALIGN_SIZE(un_len), MYF(MY_WME)); + if (new_buf) + { + if(!binlog_buf_uncompress((char *)m_rows_buf, (char *)new_buf, m_rows_cur - m_rows_buf, &un_len)) + { + my_free(m_rows_buf); + m_rows_buf = new_buf; +#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) + m_curr_row= m_rows_buf; +#endif + m_rows_end= m_rows_buf + un_len; + m_rows_cur= m_rows_end; + return; + } + else + { + my_free(new_buf); + } + } + m_cols.bitmap= 0; // catch it in is_valid +} + Rows_log_event::~Rows_log_event() { if (m_cols.bitmap == m_bitbuf) // no my_malloc happened @@ -9573,7 +9964,8 @@ int Rows_log_event::get_data_size() (m_rows_cur - m_rows_buf);); int data_size= 0; - bool is_v2_event= get_type_code() > DELETE_ROWS_EVENT_V1; + Log_event_type type = get_type_code(); + bool is_v2_event= LOG_EVENT_IS_ROW_V2(type); if (is_v2_event) { data_size= ROWS_HEADER_LEN_V2 + @@ -10388,6 +10780,24 @@ bool Rows_log_event::write_data_body() return res; } + +bool Rows_log_event::write_compressed() +{ + uchar *m_rows_buf_tmp = m_rows_buf; + uchar *m_rows_cur_tmp = m_rows_cur; + bool ret = true; + uint32 comlen = binlog_get_compress_len(m_rows_cur_tmp - m_rows_buf_tmp); + m_rows_buf = (uchar *)my_malloc(comlen, MYF(MY_FAE)); + if(m_rows_buf && !binlog_buf_compress((const char *)m_rows_buf_tmp, (char *)m_rows_buf, m_rows_cur_tmp - m_rows_buf_tmp, &comlen)) + { + m_rows_cur = comlen + m_rows_buf; + ret = Log_event::write(); + } + my_free(m_rows_buf); + m_rows_buf = m_rows_buf_tmp; + m_rows_cur = m_rows_cur_tmp; + return ret; +} #endif #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) @@ -11302,6 +11712,20 @@ Write_rows_log_event::Write_rows_log_event(THD *thd_arg, TABLE *tbl_arg, is_transactional, WRITE_ROWS_EVENT_V1) { } + +Write_rows_compressed_log_event::Write_rows_compressed_log_event(THD *thd_arg, TABLE *tbl_arg, + ulong tid_arg, + bool is_transactional) + : Write_rows_log_event(thd_arg, tbl_arg, tid_arg, is_transactional) +{ + //m_type = log_bin_use_v1_row_events ? WRITE_ROWS_COMPRESSED_EVENT_V1 : WRITE_ROWS_COMPRESSED_EVENT; + m_type = WRITE_ROWS_COMPRESSED_EVENT_V1; +} + +bool Write_rows_compressed_log_event::write() +{ + return Rows_log_event::write_compressed(); +} #endif /* @@ -11314,6 +11738,14 @@ Write_rows_log_event::Write_rows_log_event(const char *buf, uint event_len, : Rows_log_event(buf, event_len, description_event) { } + +Write_rows_compressed_log_event::Write_rows_compressed_log_event(const char *buf, uint event_len, + const Format_description_log_event + *description_event) +: Write_rows_log_event(buf, event_len, description_event) +{ + uncompress_buf(); +} #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) @@ -11805,6 +12237,23 @@ void Write_rows_log_event::print(FILE *file, PRINT_EVENT_INFO* print_event_info) {DBUG_SET("+d,simulate_my_b_fill_error");}); Rows_log_event::print_helper(file, print_event_info, "Write_rows"); } + +void Write_rows_compressed_log_event::print(FILE *file, PRINT_EVENT_INFO* print_event_info) +{ + char *new_buf; + ulong len; + if(!Row_log_event_uncompress(glob_description_event, checksum_alg, + temp_buf, &new_buf, &len)) + { + free_temp_buf(); + register_temp_buf(new_buf, true); + Rows_log_event::print_helper(file, print_event_info, "Write_compressed_rows"); + } + else + { + my_b_printf(&print_event_info->head_cache, "ERROR: uncompress write_compressed_rows failed\n"); + } +} #endif @@ -12325,6 +12774,20 @@ Delete_rows_log_event::Delete_rows_log_event(THD *thd_arg, TABLE *tbl_arg, DELETE_ROWS_EVENT_V1) { } + +Delete_rows_compressed_log_event::Delete_rows_compressed_log_event(THD *thd_arg, TABLE *tbl_arg, + ulong tid_arg, + bool is_transactional) + : Delete_rows_log_event(thd_arg, tbl_arg, tid_arg, is_transactional) +{ + //m_type = log_bin_use_v1_row_events ? DELETE_ROWS_COMPRESSED_EVENT_V1 : DELETE_ROWS_COMPRESSED_EVENT; + m_type = DELETE_ROWS_COMPRESSED_EVENT_V1; +} + +bool Delete_rows_compressed_log_event::write() +{ + return Rows_log_event::write_compressed(); +} #endif /* #if !defined(MYSQL_CLIENT) */ /* @@ -12337,6 +12800,14 @@ Delete_rows_log_event::Delete_rows_log_event(const char *buf, uint event_len, : Rows_log_event(buf, event_len, description_event) { } + +Delete_rows_compressed_log_event::Delete_rows_compressed_log_event(const char *buf, uint event_len, + const Format_description_log_event + *description_event) + : Delete_rows_log_event(buf, event_len, description_event) +{ + uncompress_buf(); +} #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) @@ -12434,6 +12905,24 @@ void Delete_rows_log_event::print(FILE *file, { Rows_log_event::print_helper(file, print_event_info, "Delete_rows"); } + +void Delete_rows_compressed_log_event::print(FILE *file, + PRINT_EVENT_INFO* print_event_info) +{ + char *new_buf; + ulong len; + if(!Row_log_event_uncompress(glob_description_event, checksum_alg, + temp_buf, &new_buf, &len)) + { + free_temp_buf(); + register_temp_buf(new_buf, true); + Rows_log_event::print_helper(file, print_event_info, "Delete_compressed_rows"); + } + else + { + my_b_printf(&print_event_info->head_cache, "ERROR: uncompress delete_compressed_rows failed\n"); + } +} #endif @@ -12461,6 +12950,20 @@ Update_rows_log_event::Update_rows_log_event(THD *thd_arg, TABLE *tbl_arg, init(tbl_arg->rpl_write_set); } +Update_rows_compressed_log_event::Update_rows_compressed_log_event(THD *thd_arg, TABLE *tbl_arg, + ulong tid, + bool is_transactional) +: Update_rows_log_event(thd_arg, tbl_arg, tid, is_transactional) +{ + //m_type = log_bin_use_v1_row_events ? UPDATE_ROWS_COMPRESSED_EVENT_V1 : UPDATE_ROWS_COMPRESSED_EVENT; + m_type = UPDATE_ROWS_COMPRESSED_EVENT_V1; +} + +bool Update_rows_compressed_log_event::write() +{ + return Rows_log_event::write_compressed(); +} + void Update_rows_log_event::init(MY_BITMAP const *cols) { /* if my_bitmap_init fails, caught in is_valid() */ @@ -12499,6 +13002,14 @@ Update_rows_log_event::Update_rows_log_event(const char *buf, uint event_len, : Rows_log_event(buf, event_len, description_event) { } + +Update_rows_compressed_log_event::Update_rows_compressed_log_event(const char *buf, uint event_len, + const Format_description_log_event + *description_event) + : Update_rows_log_event(buf, event_len, description_event) +{ + uncompress_buf(); +} #endif #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) @@ -12651,6 +13162,23 @@ void Update_rows_log_event::print(FILE *file, { Rows_log_event::print_helper(file, print_event_info, "Update_rows"); } + +void Update_rows_compressed_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info) +{ + char *new_buf; + ulong len; + if(!Row_log_event_uncompress(glob_description_event, checksum_alg, + temp_buf, &new_buf, &len)) + { + free_temp_buf(); + register_temp_buf(new_buf, true); + Rows_log_event::print_helper(file, print_event_info, "Update_compressed_rows"); + } + else + { + my_b_printf(&print_event_info->head_cache, "ERROR: uncompress update_compressed_rows failed\n"); + } +} #endif #if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) @@ -12778,7 +13306,7 @@ Log_event* wsrep_read_log_event( DBUG_ASSERT(error != 0); sql_print_error("Error in Log_event::read_log_event(): " "'%s', data_len: %d, event_type: %d", - error,data_len,head[EVENT_TYPE_OFFSET]); + error,data_len,(uchar)head[EVENT_TYPE_OFFSET]); } (*arg_buf)+= data_len; (*arg_buf_len)-= data_len; diff --git a/sql/log_event.h b/sql/log_event.h index 306f78ca4c9ae..14bfc54aed313 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -692,11 +692,33 @@ enum Log_event_type START_ENCRYPTION_EVENT= 164, + /* + Compressed binlog event. + */ + QUERY_COMPRESSED_EVENT = 165, + WRITE_ROWS_COMPRESSED_EVENT_V1 = 166, + UPDATE_ROWS_COMPRESSED_EVENT_V1 = 167, + DELETE_ROWS_COMPRESSED_EVENT_V1 = 168, + WRITE_ROWS_COMPRESSED_EVENT = 169, + UPDATE_ROWS_COMPRESSED_EVENT = 170, + DELETE_ROWS_COMPRESSED_EVENT = 171, + /* Add new MariaDB events here - right above this comment! */ ENUM_END_EVENT /* end marker */ }; +#define LOG_EVENT_IS_QUERY(type) (type == QUERY_EVENT || type == QUERY_COMPRESSED_EVENT) +#define LOG_EVENT_IS_WRITE_ROW(type) (type == WRITE_ROWS_EVENT || type == WRITE_ROWS_EVENT_V1 || type == WRITE_ROWS_COMPRESSED_EVENT || type == WRITE_ROWS_COMPRESSED_EVENT_V1) +#define LOG_EVENT_IS_UPDATE_ROW(type) (type == UPDATE_ROWS_EVENT || type == UPDATE_ROWS_EVENT_V1 || type == UPDATE_ROWS_COMPRESSED_EVENT || type == UPDATE_ROWS_COMPRESSED_EVENT_V1) +#define LOG_EVENT_IS_DELETE_ROW(type) (type == DELETE_ROWS_EVENT || type == DELETE_ROWS_EVENT_V1 || type == DELETE_ROWS_COMPRESSED_EVENT || type == DELETE_ROWS_COMPRESSED_EVENT_V1) +#define LOG_EVENT_IS_ROW_COMPRESSED(type) (type == WRITE_ROWS_COMPRESSED_EVENT || type == WRITE_ROWS_COMPRESSED_EVENT_V1 ||\ + type == UPDATE_ROWS_COMPRESSED_EVENT || type == UPDATE_ROWS_COMPRESSED_EVENT_V1 ||\ + type == DELETE_ROWS_COMPRESSED_EVENT || type == DELETE_ROWS_COMPRESSED_EVENT_V1) +#define LOG_EVENT_IS_ROW_V2(type) (type >= WRITE_ROWS_EVENT && type <= DELETE_ROWS_EVENT || \ + type >= WRITE_ROWS_COMPRESSED_EVENT && type <= DELETE_ROWS_COMPRESSED_EVENT ) + + /* The number of types we handle in Format_description_log_event (UNKNOWN_EVENT is not to be handled, it does not exist in binlogs, it does not have a @@ -2045,9 +2067,37 @@ class Query_log_event: public Log_event !strncasecmp(query, "SAVEPOINT", 9) || !strncasecmp(query, "ROLLBACK", 8); } - bool is_begin() { return !strcmp(query, "BEGIN"); } - bool is_commit() { return !strcmp(query, "COMMIT"); } - bool is_rollback() { return !strcmp(query, "ROLLBACK"); } + virtual bool is_begin() { return !strcmp(query, "BEGIN"); } + virtual bool is_commit() { return !strcmp(query, "COMMIT"); } + virtual bool is_rollback() { return !strcmp(query, "ROLLBACK"); } +}; + +class Query_compressed_log_event:public Query_log_event{ +protected: + Log_event::Byte* query_buf; // point to the uncompressed query +public: + Query_compressed_log_event(const char* buf, uint event_len, + const Format_description_log_event *description_event, + Log_event_type event_type); + ~Query_compressed_log_event() + { + if (query_buf) + my_free(query_buf); + } + Log_event_type get_type_code() { return QUERY_COMPRESSED_EVENT; } + + /* + the min length of log_bin_compress_min_len is 10, + means that Begin/Commit/Rollback would never be compressed! + */ + virtual bool is_begin() { return false; } + virtual bool is_commit() { return false; } + virtual bool is_rollback() { return false; } +#ifdef MYSQL_SERVER + Query_compressed_log_event(THD* thd_arg, const char* query_arg, ulong query_length, + bool using_trans, bool direct, bool suppress_use, int error); + virtual bool write(); +#endif }; @@ -4341,6 +4391,7 @@ class Rows_log_event : public Log_event #ifdef MYSQL_SERVER virtual bool write_data_header(); virtual bool write_data_body(); + virtual bool write_compressed(); virtual const char *get_db() { return m_table->s->db.str; } #endif /* @@ -4375,6 +4426,7 @@ class Rows_log_event : public Log_event #endif Rows_log_event(const char *row_data, uint event_len, const Format_description_log_event *description_event); + void uncompress_buf(); #ifdef MYSQL_CLIENT void print_helper(FILE *, PRINT_EVENT_INFO *, char const *const name); @@ -4587,6 +4639,23 @@ class Write_rows_log_event : public Rows_log_event #endif }; +class Write_rows_compressed_log_event : public Write_rows_log_event +{ +public: +#if defined(MYSQL_SERVER) + Write_rows_compressed_log_event(THD*, TABLE*, ulong table_id, + bool is_transactional); + virtual bool write(); +#endif +#ifdef HAVE_REPLICATION + Write_rows_compressed_log_event(const char *buf, uint event_len, + const Format_description_log_event *description_event); +#endif +private: +#if defined(MYSQL_CLIENT) + void print(FILE *file, PRINT_EVENT_INFO *print_event_info); +#endif +}; /** @class Update_rows_log_event @@ -4657,6 +4726,24 @@ class Update_rows_log_event : public Rows_log_event #endif /* defined(MYSQL_SERVER) && defined(HAVE_REPLICATION) */ }; +class Update_rows_compressed_log_event : public Update_rows_log_event +{ +public: +#if defined(MYSQL_SERVER) + Update_rows_compressed_log_event(THD*, TABLE*, ulong table_id, + bool is_transactional); + virtual bool write(); +#endif +#ifdef HAVE_REPLICATION + Update_rows_compressed_log_event(const char *buf, uint event_len, + const Format_description_log_event *description_event); +#endif +private: +#if defined(MYSQL_CLIENT) + void print(FILE *file, PRINT_EVENT_INFO *print_event_info); +#endif +}; + /** @class Delete_rows_log_event @@ -4723,6 +4810,23 @@ class Delete_rows_log_event : public Rows_log_event #endif }; +class Delete_rows_compressed_log_event : public Delete_rows_log_event +{ +public: +#if defined(MYSQL_SERVER) + Delete_rows_compressed_log_event(THD*, TABLE*, ulong, bool is_transactional); + virtual bool write(); +#endif +#ifdef HAVE_REPLICATION + Delete_rows_compressed_log_event(const char *buf, uint event_len, + const Format_description_log_event *description_event); +#endif +private: +#if defined(MYSQL_CLIENT) + void print(FILE *file, PRINT_EVENT_INFO *print_event_info); +#endif +}; + #include "log_event_old.h" @@ -4964,4 +5068,17 @@ extern TYPELIB binlog_checksum_typelib; @} (end of group Replication) */ + +int binlog_buf_compress(const char *src, char *dst, uint32 len, uint32 *comlen); +int binlog_buf_uncompress(const char *src, char *dst, uint32 len, uint32 *newlen); +uint32 binlog_get_compress_len(uint32 len); +uint32 binlog_get_uncompress_len(const char *buf); + +int query_event_uncompress(const Format_description_log_event *description_event, + bool contain_checksum, const char *src, char **dst, ulong *newlen); + +int Row_log_event_uncompress(const Format_description_log_event *description_event, bool contain_checksum, + const char *src, char **dst, ulong *newlen); + + #endif /* _log_event_h */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 310ccb047c48e..8881e0423f5da 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -389,6 +389,8 @@ static DYNAMIC_ARRAY all_options; /* Global variables */ bool opt_bin_log, opt_bin_log_used=0, opt_ignore_builtin_innodb= 0; +bool opt_bin_log_compress; +uint opt_bin_log_compress_min_len; my_bool opt_log, debug_assert_if_crashed_table= 0, opt_help= 0; my_bool debug_assert_on_not_freed_memory= 0; my_bool disable_log_notes; diff --git a/sql/mysqld.h b/sql/mysqld.h index 294b463161b07..02bbdf839c195 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -109,7 +109,8 @@ extern CHARSET_INFO *character_set_filesystem; extern MY_BITMAP temp_pool; extern bool opt_large_files; -extern bool opt_update_log, opt_bin_log, opt_error_log; +extern bool opt_update_log, opt_bin_log, opt_error_log, opt_bin_log_compress; +extern uint opt_bin_log_compress_min_len; extern my_bool opt_log, opt_bootstrap; extern my_bool opt_backup_history_log; extern my_bool opt_backup_progress_log; diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 9e2977c8bc549..f687f64517124 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1732,6 +1732,12 @@ delete_or_keep_event_post_apply(rpl_group_info *rgi, case DELETE_ROWS_EVENT: case UPDATE_ROWS_EVENT: case WRITE_ROWS_EVENT: + case WRITE_ROWS_COMPRESSED_EVENT: + case DELETE_ROWS_COMPRESSED_EVENT: + case UPDATE_ROWS_COMPRESSED_EVENT: + case WRITE_ROWS_COMPRESSED_EVENT_V1: + case UPDATE_ROWS_COMPRESSED_EVENT_V1: + case DELETE_ROWS_COMPRESSED_EVENT_V1: /* After the last Rows event has been applied, the saved Annotate_rows event (if any) is not needed anymore and can be deleted. diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index d42611bfebe54..4d1925e5d845c 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -7232,3 +7232,5 @@ ER_PARTITION_DEFAULT_ERROR ukr "Припустимо мати тільки один DEFAULT розділ" ER_REFERENCED_TRG_DOES_NOT_EXIST eng "Referenced trigger '%s' for the given action time and event type does not exist" +ER_BINLOG_UNCOMPRESS_ERROR + eng "Uncompress the compressed binlog failed" diff --git a/sql/slave.cc b/sql/slave.cc index 20bf68e6b6f7e..f7efb97e44d86 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3769,7 +3769,7 @@ inline void update_state_of_relay_log(Relay_log_info *rli, Log_event *ev) } /* Check for an event that starts or stops a transaction */ - if (typ == QUERY_EVENT) + if (LOG_EVENT_IS_QUERY(typ)) { Query_log_event *qev= (Query_log_event*) ev; /* @@ -3909,7 +3909,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli, */ DBUG_EXECUTE_IF("incomplete_group_in_relay_log", if ((typ == XID_EVENT) || - ((typ == QUERY_EVENT) && + (LOG_EVENT_IS_QUERY(typ) && strcmp("COMMIT", ((Query_log_event *) ev)->query) == 0)) { DBUG_ASSERT(thd->transaction.all.modified_non_trans_table); @@ -5664,6 +5664,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) bool gtid_skip_enqueue= false; bool got_gtid_event= false; rpl_gtid event_gtid; + bool compressed_event = FALSE; /* FD_q must have been prepared for the first R_a event @@ -5710,7 +5711,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) // Emulate the network corruption DBUG_EXECUTE_IF("corrupt_queue_event", - if (buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT) + if ((uchar)buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT) { char *debug_event_buf_c = (char*) buf; int debug_cor_pos = rand() % (event_len - BINLOG_CHECKSUM_LEN); @@ -6144,6 +6145,43 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) inc_pos= event_len; } break; + /* + Binlog compressed event should uncompress in IO thread + */ + case QUERY_COMPRESSED_EVENT: + inc_pos= event_len; + if (query_event_uncompress(rli->relay_log.description_event_for_queue, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, buf, (char **)&buf, &event_len)) + { + char llbuf[22]; + error = ER_BINLOG_UNCOMPRESS_ERROR; + error_msg.append(STRING_WITH_LEN("binlog uncompress error, master log_pos: ")); + llstr(mi->master_log_pos, llbuf); + error_msg.append(llbuf, strlen(llbuf)); + goto err; + } + compressed_event = true; + goto default_action; + + case WRITE_ROWS_COMPRESSED_EVENT: + case UPDATE_ROWS_COMPRESSED_EVENT: + case DELETE_ROWS_COMPRESSED_EVENT: + case WRITE_ROWS_COMPRESSED_EVENT_V1: + case UPDATE_ROWS_COMPRESSED_EVENT_V1: + case DELETE_ROWS_COMPRESSED_EVENT_V1: + inc_pos = event_len; + { + if (Row_log_event_uncompress(rli->relay_log.description_event_for_queue, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, buf, (char **)&buf, &event_len)) + { + char llbuf[22]; + error = ER_BINLOG_UNCOMPRESS_ERROR; + error_msg.append(STRING_WITH_LEN("binlog uncompress error, master log_pos: ")); + llstr(mi->master_log_pos, llbuf); + error_msg.append(llbuf, strlen(llbuf)); + goto err; + } + } + compressed_event = true; + goto default_action; #ifndef DBUG_OFF case XID_EVENT: @@ -6162,7 +6200,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) DBUG_EXECUTE_IF("kill_slave_io_after_2_events", { if (mi->dbug_do_disconnect && - (((uchar)buf[EVENT_TYPE_OFFSET] == QUERY_EVENT) || + (LOG_EVENT_IS_QUERY((uchar)buf[EVENT_TYPE_OFFSET]) || ((uchar)buf[EVENT_TYPE_OFFSET] == TABLE_MAP_EVENT)) && (--mi->dbug_event_counter == 0)) { @@ -6175,7 +6213,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) DBUG_EXECUTE_IF("kill_slave_io_before_commit", { if ((uchar)buf[EVENT_TYPE_OFFSET] == XID_EVENT || - ((uchar)buf[EVENT_TYPE_OFFSET] == QUERY_EVENT && + ((uchar)buf[EVENT_TYPE_OFFSET] == QUERY_EVENT && /* QUERY_COMPRESSED_EVENT would never be commmit or rollback */ Query_log_event::peek_is_commit_rollback(buf, event_len, checksum_alg))) { @@ -6195,7 +6233,9 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) ++mi->events_queued_since_last_gtid; } - inc_pos= event_len; + if (!compressed_event) + inc_pos= event_len; + break; } @@ -6286,8 +6326,8 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) /* everything is filtered out from non-master */ (s_id != mi->master_id || /* for the master meta information is necessary */ - (buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT && - buf[EVENT_TYPE_OFFSET] != ROTATE_EVENT))) || + ((uchar)buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT && + (uchar)buf[EVENT_TYPE_OFFSET] != ROTATE_EVENT))) || /* Check whether it needs to be filtered based on domain_id @@ -6316,9 +6356,9 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) */ if (!(s_id == global_system_variables.server_id && !mi->rli.replicate_same_server_id) || - (buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT && - buf[EVENT_TYPE_OFFSET] != ROTATE_EVENT && - buf[EVENT_TYPE_OFFSET] != STOP_EVENT)) + ((uchar)buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT && + (uchar)buf[EVENT_TYPE_OFFSET] != ROTATE_EVENT && + (uchar)buf[EVENT_TYPE_OFFSET] != STOP_EVENT)) { mi->master_log_pos+= inc_pos; memcpy(rli->ign_master_log_name_end, mi->master_log_name, FN_REFLEN); @@ -6359,7 +6399,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) buf[EVENT_TYPE_OFFSET])) || (!mi->last_queued_gtid_standalone && ((uchar)buf[EVENT_TYPE_OFFSET] == XID_EVENT || - ((uchar)buf[EVENT_TYPE_OFFSET] == QUERY_EVENT && + ((uchar)buf[EVENT_TYPE_OFFSET] == QUERY_EVENT && /* QUERY_COMPRESSED_EVENT would never be commmit or rollback */ Query_log_event::peek_is_commit_rollback(buf, event_len, checksum_alg)))))) { @@ -6389,6 +6429,9 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) mi->report(ERROR_LEVEL, error, NULL, ER_DEFAULT(error), error_msg.ptr()); + if(compressed_event) + my_free((void *)buf); + DBUG_RETURN(error); } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 1af3b9a9cca42..a741a0f6d0144 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -6373,7 +6373,14 @@ int THD::binlog_write_row(TABLE* table, bool is_trans, if (variables.option_bits & OPTION_GTID_BEGIN) is_trans= 1; - Rows_log_event* const ev= + Rows_log_event* ev; + if (binlog_should_compress(len)) + ev = + binlog_prepare_pending_rows_event(table, variables.server_id, + len, is_trans, + static_cast(0)); + else + ev = binlog_prepare_pending_rows_event(table, variables.server_id, len, is_trans, static_cast(0)); @@ -6421,8 +6428,15 @@ int THD::binlog_update_row(TABLE* table, bool is_trans, DBUG_DUMP("after_row", after_row, after_size); #endif - Rows_log_event* const ev= - binlog_prepare_pending_rows_event(table, variables.server_id, + Rows_log_event* ev; + if(binlog_should_compress(before_size + after_size)) + ev = + binlog_prepare_pending_rows_event(table, variables.server_id, + before_size + after_size, is_trans, + static_cast(0)); + else + ev = + binlog_prepare_pending_rows_event(table, variables.server_id, before_size + after_size, is_trans, static_cast(0)); @@ -6474,8 +6488,15 @@ int THD::binlog_delete_row(TABLE* table, bool is_trans, if (variables.option_bits & OPTION_GTID_BEGIN) is_trans= 1; - Rows_log_event* const ev= - binlog_prepare_pending_rows_event(table, variables.server_id, + Rows_log_event* ev; + if(binlog_should_compress(len)) + ev = + binlog_prepare_pending_rows_event(table, variables.server_id, + len, is_trans, + static_cast(0)); + else + ev = + binlog_prepare_pending_rows_event(table, variables.server_id, len, is_trans, static_cast(0)); @@ -6940,15 +6961,28 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, flush the pending rows event if necessary. */ { - Query_log_event qinfo(this, query_arg, query_len, is_trans, direct, - suppress_use, errcode); + Log_event* ev = NULL; + int error = 0; + /* Binlog table maps will be irrelevant after a Query_log_event (they are just removed on the slave side) so after the query log event is written to the binary log, we pretend that no table maps were written. - */ - int error= mysql_bin_log.write(&qinfo); + */ + if(binlog_should_compress(query_len)) + { + Query_compressed_log_event qinfo(this, query_arg, query_len, is_trans, direct, + suppress_use, errcode); + error= mysql_bin_log.write(&qinfo); + } + else + { + Query_log_event qinfo(this, query_arg, query_len, is_trans, direct, + suppress_use, errcode); + error= mysql_bin_log.write(&qinfo); + } + binlog_table_maps= 0; DBUG_RETURN(error); } diff --git a/sql/sql_class.h b/sql/sql_class.h index 994a161a64626..a63a3379ec1c3 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -5681,6 +5681,12 @@ void thd_exit_cond(MYSQL_THD thd, const PSI_stage_info *stage, #define THD_EXIT_COND(P1, P2) \ thd_exit_cond(P1, P2, __func__, __FILE__, __LINE__) +inline bool binlog_should_compress(ulong len) +{ + return opt_bin_log_compress && + len >= opt_bin_log_compress_min_len; +} + #endif /* MYSQL_SERVER */ #endif /* SQL_CLASS_INCLUDED */ diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index bdf90f7caf653..c115ac5f0ecc8 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1629,7 +1629,7 @@ is_until_reached(binlog_send_info *info, ulong *ev_offset, break; case GTID_UNTIL_STOP_AFTER_TRANSACTION: if (event_type != XID_EVENT && - (event_type != QUERY_EVENT || + (event_type != QUERY_EVENT || /* QUERY_COMPRESSED_EVENT would never be commmit or rollback */ !Query_log_event::peek_is_commit_rollback (info->packet->ptr()+*ev_offset, info->packet->length()-*ev_offset, @@ -1863,7 +1863,7 @@ send_event_to_slave(binlog_send_info *info, Log_event_type event_type, return NULL; case GTID_SKIP_TRANSACTION: if (event_type == XID_EVENT || - (event_type == QUERY_EVENT && + (event_type == QUERY_EVENT && /* QUERY_COMPRESSED_EVENT would never be commmit or rollback */ Query_log_event::peek_is_commit_rollback(packet->ptr() + ev_offset, len - ev_offset, current_checksum_alg))) diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 3e6a06c3ab0af..ab4429005abcd 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1157,6 +1157,18 @@ static Sys_var_mybool Sys_log_bin( "log_bin", "Whether the binary log is enabled", READ_ONLY GLOBAL_VAR(opt_bin_log), NO_CMD_LINE, DEFAULT(FALSE)); +static Sys_var_mybool Sys_log_bin_compress( + "log_bin_compress", "Whether the binary log can be compressed", + GLOBAL_VAR(opt_bin_log_compress), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); + +/* the min length is 10, means that Begin/Commit/Rollback would never be compressed! */ +static Sys_var_uint Sys_log_bin_compress_min_len( + "log_bin_compress_min_len", + "Minimum length of sql statement(in statement mode) or record(in row mode)" + "that can be compressed.", + GLOBAL_VAR(opt_bin_log_compress_min_len), + CMD_LINE(OPT_ARG), VALID_RANGE(10, 1024), DEFAULT(256), BLOCK_SIZE(1)); + static Sys_var_mybool Sys_trust_function_creators( "log_bin_trust_function_creators", "If set to FALSE (the default), then when --log-bin is used, creation " From d4b2c9bb1afd6887d9295b44ed8f85f3bcf5019f Mon Sep 17 00:00:00 2001 From: vinchen Date: Fri, 14 Oct 2016 15:23:49 +0800 Subject: [PATCH 02/71] optimize the memory allocation for compressed binlog event --- sql/log_event.cc | 116 ++++++++++++++++++++++++++++++----------------- sql/log_event.h | 10 ++-- sql/slave.cc | 23 ++++++---- 3 files changed, 96 insertions(+), 53 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index fdf8007283db8..fbc9db1f5b79b 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -789,7 +789,8 @@ int binlog_buf_compress(const char *src, char *dst, uint32 len, uint32 *comlen) */ int query_event_uncompress(const Format_description_log_event *description_event, bool contain_checksum, - const char *src, char **dst, ulong *newlen) + const char *src, char* buf, ulong buf_size, bool* is_malloc, + char **dst, ulong *newlen) { ulong len = uint4korr(src + EVENT_LEN_OFFSET); const char *tmp = src; @@ -810,37 +811,54 @@ int query_event_uncompress(const Format_description_log_event *description_event *newlen = (tmp - src) + un_len; if(contain_checksum) *newlen += BINLOG_CHECKSUM_LEN; - - *dst = (char *)my_malloc(ALIGN_SIZE(*newlen), MYF(MY_FAE)); - if (!*dst) - { - return 1; - } + + uint32 alloc_size = ALIGN_SIZE(*newlen); + char *new_dst = NULL; - /* copy the head*/ - memcpy(*dst, src , tmp - src); - if (binlog_buf_uncompress(tmp, *dst + (tmp - src), len - (tmp - src), &un_len)) + *is_malloc = false; + if (alloc_size <= buf_size) + { + new_dst = buf; + } + else + { + new_dst = (char *)my_malloc(alloc_size, MYF(MY_WME)); + if (!new_dst) + return 1; + + *is_malloc = true; + } + + /* copy the head*/ + memcpy(new_dst, src , tmp - src); + if (binlog_buf_uncompress(tmp, new_dst + (tmp - src), len - (tmp - src), &un_len)) { - my_free(*dst); + if (*is_malloc) + my_free(new_dst); + + *is_malloc = false; + return 1; } - (*dst)[EVENT_TYPE_OFFSET] = QUERY_EVENT; - int4store(*dst + EVENT_LEN_OFFSET, *newlen); + new_dst[EVENT_TYPE_OFFSET] = QUERY_EVENT; + int4store(new_dst + EVENT_LEN_OFFSET, *newlen); if(contain_checksum){ ulong clear_len = *newlen - BINLOG_CHECKSUM_LEN; - int4store(*dst + clear_len, my_checksum(0L, (uchar *)*dst, clear_len)); + int4store(new_dst + clear_len, my_checksum(0L, (uchar *)new_dst, clear_len)); } + *dst = new_dst; return 0; } -int Row_log_event_uncompress(const Format_description_log_event *description_event, bool contain_checksum, - const char *src, char **dst, ulong *newlen) +int row_log_event_uncompress(const Format_description_log_event *description_event, bool contain_checksum, + const char *src, char* buf, ulong buf_size, bool* is_malloc, + char **dst, ulong *newlen) { Log_event_type type = (Log_event_type)(uchar)src[EVENT_TYPE_OFFSET]; ulong len = uint4korr(src + EVENT_LEN_OFFSET); const char *tmp = src; - char *buf = NULL; + char *new_dst = NULL; DBUG_ASSERT(LOG_EVENT_IS_ROW_COMPRESSED(type)); @@ -884,28 +902,39 @@ int Row_log_event_uncompress(const Format_description_log_event *description_eve *newlen += BINLOG_CHECKSUM_LEN; uint32 alloc_size = ALIGN_SIZE(*newlen); - buf = (char *)my_malloc(alloc_size , MYF(MY_FAE)); - if (!buf) - { - return 1; - } + + *is_malloc = false; + if (alloc_size <= buf_size) + { + new_dst = buf; + } + else + { + new_dst = (char *)my_malloc(alloc_size, MYF(MY_WME)); + if (!new_dst) + return 1; + + *is_malloc = true; + } /* copy the head*/ - memcpy(buf, src , tmp - src); + memcpy(new_dst, src , tmp - src); /* uncompress the body */ - if (binlog_buf_uncompress(tmp, buf + (tmp - src), len - (tmp - src), &un_len)) + if (binlog_buf_uncompress(tmp, new_dst + (tmp - src), len - (tmp - src), &un_len)) { - my_free(buf); + if (*is_malloc) + my_free(new_dst); + return 1; } - buf[EVENT_TYPE_OFFSET] = type; - int4store(buf + EVENT_LEN_OFFSET, *newlen); + new_dst[EVENT_TYPE_OFFSET] = type; + int4store(new_dst + EVENT_LEN_OFFSET, *newlen); if(contain_checksum){ ulong clear_len = *newlen - BINLOG_CHECKSUM_LEN; - int4store(buf + clear_len, my_checksum(0L, (uchar *)buf, clear_len)); + int4store(new_dst + clear_len, my_checksum(0L, (uchar *)new_dst, clear_len)); } - *dst = buf; + *dst = new_dst; return 0; } @@ -3504,14 +3533,15 @@ bool Query_compressed_log_event::write() { const char *query_tmp = query; uint32 q_len_tmp = q_len; + uint32 alloc_size; bool ret = true; - q_len = binlog_get_compress_len(q_len); - query = (char *)my_malloc(q_len, MYF(MY_FAE)); + q_len = alloc_size = binlog_get_compress_len(q_len); + query = (char *)my_safe_alloca(alloc_size); if(query && !binlog_buf_compress(query_tmp, (char *)query, q_len_tmp, &q_len)) { ret = Query_log_event::write(); } - my_free((void *)query); + my_safe_afree((void *)query, alloc_size); query = query_tmp; q_len = q_len_tmp; return ret; @@ -10786,14 +10816,15 @@ bool Rows_log_event::write_compressed() uchar *m_rows_buf_tmp = m_rows_buf; uchar *m_rows_cur_tmp = m_rows_cur; bool ret = true; - uint32 comlen = binlog_get_compress_len(m_rows_cur_tmp - m_rows_buf_tmp); - m_rows_buf = (uchar *)my_malloc(comlen, MYF(MY_FAE)); + uint32 comlen, alloc_size; + comlen = alloc_size = binlog_get_compress_len(m_rows_cur_tmp - m_rows_buf_tmp); + m_rows_buf = (uchar *)my_safe_alloca(alloc_size); if(m_rows_buf && !binlog_buf_compress((const char *)m_rows_buf_tmp, (char *)m_rows_buf, m_rows_cur_tmp - m_rows_buf_tmp, &comlen)) { m_rows_cur = comlen + m_rows_buf; ret = Log_event::write(); } - my_free(m_rows_buf); + my_safe_afree(m_rows_buf, alloc_size); m_rows_buf = m_rows_buf_tmp; m_rows_cur = m_rows_cur_tmp; return ret; @@ -12242,8 +12273,9 @@ void Write_rows_compressed_log_event::print(FILE *file, PRINT_EVENT_INFO* print_ { char *new_buf; ulong len; - if(!Row_log_event_uncompress(glob_description_event, checksum_alg, - temp_buf, &new_buf, &len)) + bool is_malloc = false; + if(!row_log_event_uncompress(glob_description_event, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, + temp_buf, NULL, 0, &is_malloc, &new_buf, &len)) { free_temp_buf(); register_temp_buf(new_buf, true); @@ -12911,8 +12943,9 @@ void Delete_rows_compressed_log_event::print(FILE *file, { char *new_buf; ulong len; - if(!Row_log_event_uncompress(glob_description_event, checksum_alg, - temp_buf, &new_buf, &len)) + bool is_malloc = false; + if(!row_log_event_uncompress(glob_description_event, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, + temp_buf, NULL, 0, &is_malloc, &new_buf, &len)) { free_temp_buf(); register_temp_buf(new_buf, true); @@ -13167,8 +13200,9 @@ void Update_rows_compressed_log_event::print(FILE *file, PRINT_EVENT_INFO *print { char *new_buf; ulong len; - if(!Row_log_event_uncompress(glob_description_event, checksum_alg, - temp_buf, &new_buf, &len)) + bool is_malloc = false; + if(!row_log_event_uncompress(glob_description_event, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, + temp_buf, NULL, 0, &is_malloc, &new_buf, &len)) { free_temp_buf(); register_temp_buf(new_buf, true); diff --git a/sql/log_event.h b/sql/log_event.h index 14bfc54aed313..59e4dcd852711 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -5074,11 +5074,13 @@ int binlog_buf_uncompress(const char *src, char *dst, uint32 len, uint32 *newlen uint32 binlog_get_compress_len(uint32 len); uint32 binlog_get_uncompress_len(const char *buf); -int query_event_uncompress(const Format_description_log_event *description_event, - bool contain_checksum, const char *src, char **dst, ulong *newlen); +int query_event_uncompress(const Format_description_log_event *description_event, bool contain_checksum, + const char *src, char* buf, ulong buf_size, bool* is_malloc, + char **dst, ulong *newlen); -int Row_log_event_uncompress(const Format_description_log_event *description_event, bool contain_checksum, - const char *src, char **dst, ulong *newlen); +int row_log_event_uncompress(const Format_description_log_event *description_event, bool contain_checksum, + const char *src, char* buf, ulong buf_size, bool* is_malloc, + char **dst, ulong *newlen); #endif /* _log_event_h */ diff --git a/sql/slave.cc b/sql/slave.cc index f7efb97e44d86..62eb24da14cc3 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -5664,7 +5664,10 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) bool gtid_skip_enqueue= false; bool got_gtid_event= false; rpl_gtid event_gtid; - bool compressed_event = FALSE; + bool is_compress_event = false; + char* new_buf = NULL; + char new_buf_arr[4096]; + bool is_malloc = false; /* FD_q must have been prepared for the first R_a event @@ -6150,7 +6153,8 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) */ case QUERY_COMPRESSED_EVENT: inc_pos= event_len; - if (query_event_uncompress(rli->relay_log.description_event_for_queue, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, buf, (char **)&buf, &event_len)) + if (query_event_uncompress(rli->relay_log.description_event_for_queue, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, + buf, new_buf_arr, sizeof(new_buf_arr), &is_malloc, (char **)&new_buf, &event_len)) { char llbuf[22]; error = ER_BINLOG_UNCOMPRESS_ERROR; @@ -6159,7 +6163,8 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) error_msg.append(llbuf, strlen(llbuf)); goto err; } - compressed_event = true; + buf = new_buf; + is_compress_event = true; goto default_action; case WRITE_ROWS_COMPRESSED_EVENT: @@ -6170,7 +6175,8 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) case DELETE_ROWS_COMPRESSED_EVENT_V1: inc_pos = event_len; { - if (Row_log_event_uncompress(rli->relay_log.description_event_for_queue, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, buf, (char **)&buf, &event_len)) + if (row_log_event_uncompress(rli->relay_log.description_event_for_queue, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, + buf, new_buf_arr, sizeof(new_buf_arr), &is_malloc, (char **)&new_buf, &event_len)) { char llbuf[22]; error = ER_BINLOG_UNCOMPRESS_ERROR; @@ -6180,7 +6186,8 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) goto err; } } - compressed_event = true; + buf = new_buf; + is_compress_event = true; goto default_action; #ifndef DBUG_OFF @@ -6233,7 +6240,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) ++mi->events_queued_since_last_gtid; } - if (!compressed_event) + if (!is_compress_event) inc_pos= event_len; break; @@ -6429,8 +6436,8 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) mi->report(ERROR_LEVEL, error, NULL, ER_DEFAULT(error), error_msg.ptr()); - if(compressed_event) - my_free((void *)buf); + if(is_malloc) + my_free((void *)new_buf); DBUG_RETURN(error); } From e1c502879fea4bc95c493e429c295ba8c95e5483 Mon Sep 17 00:00:00 2001 From: vinchen Date: Fri, 14 Oct 2016 18:55:37 +0800 Subject: [PATCH 03/71] test suite for compressed binlog event --- mysql-test/include/binlog_start_pos.inc | 10 +- mysql-test/include/show_binlog_events2.inc | 2 +- mysql-test/r/flush2.result | 4 + .../r/mysqlbinlog_row_compressed.result | 413 ++++++++++++++++++ mysql-test/r/mysqlbinlog_row_minimal.result | 158 +++---- .../r/mysqlbinlog_stmt_compressed.result | 182 ++++++++ mysql-test/r/mysqld--help.result | 6 + .../binlog/r/binlog_variables_log_bin.result | 4 + .../r/binlog_variables_log_bin_index.result | 4 + .../suite/rpl/r/rpl_binlog_compress.result | 76 ++++ .../suite/rpl/t/rpl_binlog_compress.test | 61 +++ .../r/sysvars_server_notembedded.result | 28 ++ mysql-test/t/mysqlbinlog_row_compressed.test | 37 ++ mysql-test/t/mysqlbinlog_stmt_compressed.test | 37 ++ 14 files changed, 937 insertions(+), 85 deletions(-) create mode 100644 mysql-test/r/mysqlbinlog_row_compressed.result create mode 100644 mysql-test/r/mysqlbinlog_stmt_compressed.result create mode 100644 mysql-test/suite/rpl/r/rpl_binlog_compress.result create mode 100644 mysql-test/suite/rpl/t/rpl_binlog_compress.test create mode 100644 mysql-test/t/mysqlbinlog_row_compressed.test create mode 100644 mysql-test/t/mysqlbinlog_stmt_compressed.test diff --git a/mysql-test/include/binlog_start_pos.inc b/mysql-test/include/binlog_start_pos.inc index a187e18b3a4cb..942a124d639aa 100644 --- a/mysql-test/include/binlog_start_pos.inc +++ b/mysql-test/include/binlog_start_pos.inc @@ -10,19 +10,19 @@ # # Format_description_log_event length = # 19 /* event common header */ + -# 58 /* misc stuff in the Format description header */ + +# 57 /* misc stuff in the Format description header */ + # number of events + # 1 /* Checksum algorithm */ + # 4 /* CRC32 length */ # -# With current number of events = 164, +# With current number of events = 171, # -# binlog_start_pos = 4 + 19 + 57 + 163 + 1 + 4 = 249. +# binlog_start_pos = 4 + 19 + 57 + 171 + 1 + 4 = 256. # ############################################################################## -let $binlog_start_pos=249; +let $binlog_start_pos=256; --disable_query_log -SET @binlog_start_pos=249; +SET @binlog_start_pos=256; --enable_query_log diff --git a/mysql-test/include/show_binlog_events2.inc b/mysql-test/include/show_binlog_events2.inc index eefefe4bfbe09..84c62cced6641 100644 --- a/mysql-test/include/show_binlog_events2.inc +++ b/mysql-test/include/show_binlog_events2.inc @@ -4,7 +4,7 @@ if ($binlog_start) } if (!$binlog_start) { - --let $_binlog_start=249 + --let $_binlog_start=256 } if ($binlog_file) { diff --git a/mysql-test/r/flush2.result b/mysql-test/r/flush2.result index ff5d8755f0169..a66b0d5c68884 100644 --- a/mysql-test/r/flush2.result +++ b/mysql-test/r/flush2.result @@ -4,6 +4,8 @@ show variables like 'log_bin%'; Variable_name Value log_bin OFF log_bin_basename +log_bin_compress OFF +log_bin_compress_min_len 256 log_bin_index log_bin_trust_function_creators ON show variables like 'relay_log%'; @@ -20,6 +22,8 @@ show variables like 'log_bin%'; Variable_name Value log_bin OFF log_bin_basename +log_bin_compress OFF +log_bin_compress_min_len 256 log_bin_index log_bin_trust_function_creators ON show variables like 'relay_log%'; diff --git a/mysql-test/r/mysqlbinlog_row_compressed.result b/mysql-test/r/mysqlbinlog_row_compressed.result new file mode 100644 index 0000000000000..c5d8c2b163b72 --- /dev/null +++ b/mysql-test/r/mysqlbinlog_row_compressed.result @@ -0,0 +1,413 @@ +SET GLOBAL log_bin_compress=on; +SET GLOBAL log_bin_compress_min_len=10; +CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f5 BIGINT, f6 INT, f7 INT, f8 char(1)); +CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1)); +INSERT INTO t1 VALUES (10, 1, 2, 3, 4, 5, 6, 7, ""); +INSERT INTO t1 VALUES (11, 1, 2, 3, 4, 5, 6, 7, NULL); +INSERT INTO t1 VALUES (12, 1, 2, 3, NULL, 5, 6, 7, "A"); +INSERT INTO t1 VALUES (13, 1, 2, 3, 0, 5, 6, 7, "A"); +INSERT INTO t2 SELECT * FROM t1; +UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL; +DELETE FROM t1; +DELETE FROM t2; +FLUSH BINARY LOGS; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +# at 4 +# server id 1 end_log_pos 256 CRC32 XXX Start: xxx +ROLLBACK/*!*/; +# at 256 +# server id 1 end_log_pos 285 CRC32 XXX Gtid list [] +# at 285 +# server id 1 end_log_pos 329 CRC32 XXX Binlog checkpoint master-bin.000001 +# at 329 +# server id 1 end_log_pos 371 CRC32 XXX GTID 0-1-1 ddl +/*!100101 SET @@session.skip_parallel_replication=0*//*!*/; +/*!100001 SET @@session.gtid_domain_id=0*//*!*/; +/*!100001 SET @@session.server_id=1*//*!*/; +/*!100001 SET @@session.gtid_seq_no=1*//*!*/; +# at 371 +# server id 1 end_log_pos 533 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +use `test`/*!*/; +SET TIMESTAMP=X/*!*/; +SET @@session.pseudo_thread_id=4/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; +SET @@session.sql_mode=1342177280/*!*/; +SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +SET @@session.lc_time_names=0/*!*/; +SET @@session.collation_database=DEFAULT/*!*/; +CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f5 BIGINT, f6 INT, f7 INT, f8 char(1)) +/*!*/; +# at 533 +# server id 1 end_log_pos 575 CRC32 XXX GTID 0-1-2 ddl +/*!100001 SET @@session.gtid_seq_no=2*//*!*/; +# at 575 +# server id 1 end_log_pos 727 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1)) +/*!*/; +# at 727 +# server id 1 end_log_pos 769 CRC32 XXX GTID 0-1-3 +/*!100001 SET @@session.gtid_seq_no=3*//*!*/; +BEGIN +/*!*/; +# at 769 +# server id 1 end_log_pos 825 CRC32 XXX Table_map: `test`.`t1` mapped to number num +# at 825 +# server id 1 end_log_pos 893 CRC32 XXX Write_compressed_rows: table id 30 flags: STMT_END_F +### INSERT INTO `test`.`t1` +### SET +### @1=10 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* TINYINT meta=0 nullable=1 is_null=0 */ +### @5=4 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @6=5 /* LONGINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +# at 893 +# server id 1 end_log_pos 966 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 966 +# server id 1 end_log_pos 1008 CRC32 XXX GTID 0-1-4 +/*!100001 SET @@session.gtid_seq_no=4*//*!*/; +BEGIN +/*!*/; +# at 1008 +# server id 1 end_log_pos 1064 CRC32 XXX Table_map: `test`.`t1` mapped to number num +# at 1064 +# server id 1 end_log_pos 1131 CRC32 XXX Write_compressed_rows: table id 30 flags: STMT_END_F +### INSERT INTO `test`.`t1` +### SET +### @1=11 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* TINYINT meta=0 nullable=1 is_null=0 */ +### @5=4 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @6=5 /* LONGINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */ +# at 1131 +# server id 1 end_log_pos 1204 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 1204 +# server id 1 end_log_pos 1246 CRC32 XXX GTID 0-1-5 +/*!100001 SET @@session.gtid_seq_no=5*//*!*/; +BEGIN +/*!*/; +# at 1246 +# server id 1 end_log_pos 1302 CRC32 XXX Table_map: `test`.`t1` mapped to number num +# at 1302 +# server id 1 end_log_pos 1368 CRC32 XXX Write_compressed_rows: table id 30 flags: STMT_END_F +### INSERT INTO `test`.`t1` +### SET +### @1=12 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* TINYINT meta=0 nullable=1 is_null=0 */ +### @5=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */ +### @6=5 /* LONGINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +# at 1368 +# server id 1 end_log_pos 1441 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 1441 +# server id 1 end_log_pos 1483 CRC32 XXX GTID 0-1-6 +/*!100001 SET @@session.gtid_seq_no=6*//*!*/; +BEGIN +/*!*/; +# at 1483 +# server id 1 end_log_pos 1539 CRC32 XXX Table_map: `test`.`t1` mapped to number num +# at 1539 +# server id 1 end_log_pos 1606 CRC32 XXX Write_compressed_rows: table id 30 flags: STMT_END_F +### INSERT INTO `test`.`t1` +### SET +### @1=13 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* TINYINT meta=0 nullable=1 is_null=0 */ +### @5=0 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @6=5 /* LONGINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +# at 1606 +# server id 1 end_log_pos 1679 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 1679 +# server id 1 end_log_pos 1721 CRC32 XXX GTID 0-1-7 +/*!100001 SET @@session.gtid_seq_no=7*//*!*/; +BEGIN +/*!*/; +# at 1721 +# server id 1 end_log_pos 1777 CRC32 XXX Table_map: `test`.`t2` mapped to number num +# at 1777 +# server id 1 end_log_pos 1868 CRC32 XXX Write_compressed_rows: table id 31 flags: STMT_END_F +### INSERT INTO `test`.`t2` +### SET +### @1=10 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* INT meta=0 nullable=1 is_null=0 */ +### @5=4 /* INT meta=0 nullable=1 is_null=0 */ +### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +### INSERT INTO `test`.`t2` +### SET +### @1=11 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* INT meta=0 nullable=1 is_null=0 */ +### @5=4 /* INT meta=0 nullable=1 is_null=0 */ +### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */ +### INSERT INTO `test`.`t2` +### SET +### @1=12 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* INT meta=0 nullable=1 is_null=0 */ +### @5=NULL /* INT meta=0 nullable=1 is_null=1 */ +### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +### INSERT INTO `test`.`t2` +### SET +### @1=13 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* INT meta=0 nullable=1 is_null=0 */ +### @5=0 /* INT meta=0 nullable=1 is_null=0 */ +### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +# at 1868 +# server id 1 end_log_pos 1941 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 1941 +# server id 1 end_log_pos 1983 CRC32 XXX GTID 0-1-8 +/*!100001 SET @@session.gtid_seq_no=8*//*!*/; +BEGIN +/*!*/; +# at 1983 +# server id 1 end_log_pos 2039 CRC32 XXX Table_map: `test`.`t2` mapped to number num +# at 2039 +# server id 1 end_log_pos 2138 CRC32 XXX Update_compressed_rows: table id 31 flags: STMT_END_F +### UPDATE `test`.`t2` +### WHERE +### @1=10 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* INT meta=0 nullable=1 is_null=0 */ +### @5=4 /* INT meta=0 nullable=1 is_null=0 */ +### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +### SET +### @1=10 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* INT meta=0 nullable=1 is_null=0 */ +### @5=5 /* INT meta=0 nullable=1 is_null=0 */ +### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +### UPDATE `test`.`t2` +### WHERE +### @1=11 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* INT meta=0 nullable=1 is_null=0 */ +### @5=4 /* INT meta=0 nullable=1 is_null=0 */ +### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */ +### SET +### @1=11 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* INT meta=0 nullable=1 is_null=0 */ +### @5=5 /* INT meta=0 nullable=1 is_null=0 */ +### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */ +### UPDATE `test`.`t2` +### WHERE +### @1=12 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* INT meta=0 nullable=1 is_null=0 */ +### @5=NULL /* INT meta=0 nullable=1 is_null=1 */ +### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +### SET +### @1=12 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* INT meta=0 nullable=1 is_null=0 */ +### @5=5 /* INT meta=0 nullable=1 is_null=0 */ +### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +# at 2138 +# server id 1 end_log_pos 2211 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 2211 +# server id 1 end_log_pos 2253 CRC32 XXX GTID 0-1-9 +/*!100001 SET @@session.gtid_seq_no=9*//*!*/; +BEGIN +/*!*/; +# at 2253 +# server id 1 end_log_pos 2309 CRC32 XXX Table_map: `test`.`t1` mapped to number num +# at 2309 +# server id 1 end_log_pos 2401 CRC32 XXX Delete_compressed_rows: table id 30 flags: STMT_END_F +### DELETE FROM `test`.`t1` +### WHERE +### @1=10 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* TINYINT meta=0 nullable=1 is_null=0 */ +### @5=4 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @6=5 /* LONGINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +### DELETE FROM `test`.`t1` +### WHERE +### @1=11 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* TINYINT meta=0 nullable=1 is_null=0 */ +### @5=4 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @6=5 /* LONGINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */ +### DELETE FROM `test`.`t1` +### WHERE +### @1=12 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* TINYINT meta=0 nullable=1 is_null=0 */ +### @5=NULL /* MEDIUMINT meta=0 nullable=1 is_null=1 */ +### @6=5 /* LONGINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +### DELETE FROM `test`.`t1` +### WHERE +### @1=13 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* TINYINT meta=0 nullable=1 is_null=0 */ +### @5=0 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @6=5 /* LONGINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +# at 2401 +# server id 1 end_log_pos 2474 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 2474 +# server id 1 end_log_pos 2516 CRC32 XXX GTID 0-1-10 +/*!100001 SET @@session.gtid_seq_no=10*//*!*/; +BEGIN +/*!*/; +# at 2516 +# server id 1 end_log_pos 2572 CRC32 XXX Table_map: `test`.`t2` mapped to number num +# at 2572 +# server id 1 end_log_pos 2657 CRC32 XXX Delete_compressed_rows: table id 31 flags: STMT_END_F +### DELETE FROM `test`.`t2` +### WHERE +### @1=10 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* INT meta=0 nullable=1 is_null=0 */ +### @5=5 /* INT meta=0 nullable=1 is_null=0 */ +### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +### DELETE FROM `test`.`t2` +### WHERE +### @1=11 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* INT meta=0 nullable=1 is_null=0 */ +### @5=5 /* INT meta=0 nullable=1 is_null=0 */ +### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */ +### DELETE FROM `test`.`t2` +### WHERE +### @1=12 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* INT meta=0 nullable=1 is_null=0 */ +### @5=5 /* INT meta=0 nullable=1 is_null=0 */ +### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +### DELETE FROM `test`.`t2` +### WHERE +### @1=13 /* INT meta=0 nullable=0 is_null=0 */ +### @2=1 /* INT meta=0 nullable=1 is_null=0 */ +### @3=2 /* INT meta=0 nullable=1 is_null=0 */ +### @4=3 /* INT meta=0 nullable=1 is_null=0 */ +### @5=0 /* INT meta=0 nullable=1 is_null=0 */ +### @6=5 /* MEDIUMINT meta=0 nullable=1 is_null=0 */ +### @7=6 /* INT meta=0 nullable=1 is_null=0 */ +### @8=7 /* INT meta=0 nullable=1 is_null=0 */ +### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ +# at 2657 +# server id 1 end_log_pos 2730 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 2730 +# server id 1 end_log_pos 2778 CRC32 XXX Rotate to master-bin.000002 pos: 4 +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; +DROP TABLE t1,t2; +SET GLOBAL log_bin_compress=off; +SET GLOBAL log_bin_compress_min_len=256; diff --git a/mysql-test/r/mysqlbinlog_row_minimal.result b/mysql-test/r/mysqlbinlog_row_minimal.result index 2737d61eca4ab..2fb721d41033f 100644 --- a/mysql-test/r/mysqlbinlog_row_minimal.result +++ b/mysql-test/r/mysqlbinlog_row_minimal.result @@ -14,20 +14,20 @@ FLUSH BINARY LOGS; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; # at 4 -# server id 1 end_log_pos 249 CRC32 XXX Start: xxx +# server id 1 end_log_pos 256 CRC32 XXX Start: xxx ROLLBACK/*!*/; -# at 249 -# server id 1 end_log_pos 278 CRC32 XXX Gtid list [] -# at 278 -# server id 1 end_log_pos 322 CRC32 XXX Binlog checkpoint master-bin.000001 -# at 322 -# server id 1 end_log_pos 364 CRC32 XXX GTID 0-1-1 ddl +# at 256 +# server id 1 end_log_pos 285 CRC32 XXX Gtid list [] +# at 285 +# server id 1 end_log_pos 329 CRC32 XXX Binlog checkpoint master-bin.000001 +# at 329 +# server id 1 end_log_pos 371 CRC32 XXX GTID 0-1-1 ddl /*!100101 SET @@session.skip_parallel_replication=0*//*!*/; /*!100001 SET @@session.gtid_domain_id=0*//*!*/; /*!100001 SET @@session.server_id=1*//*!*/; /*!100001 SET @@session.gtid_seq_no=1*//*!*/; -# at 364 -# server id 1 end_log_pos 548 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +# at 371 +# server id 1 end_log_pos 555 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 use `test`/*!*/; SET TIMESTAMP=X/*!*/; SET @@session.pseudo_thread_id=4/*!*/; @@ -40,23 +40,23 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f5 BIGINT, f6 INT, f7 INT, f8 char(1)) /*!*/; -# at 548 -# server id 1 end_log_pos 590 CRC32 XXX GTID 0-1-2 ddl +# at 555 +# server id 1 end_log_pos 597 CRC32 XXX GTID 0-1-2 ddl /*!100001 SET @@session.gtid_seq_no=2*//*!*/; -# at 590 -# server id 1 end_log_pos 767 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +# at 597 +# server id 1 end_log_pos 774 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1)) /*!*/; -# at 767 -# server id 1 end_log_pos 809 CRC32 XXX GTID 0-1-3 +# at 774 +# server id 1 end_log_pos 816 CRC32 XXX GTID 0-1-3 /*!100001 SET @@session.gtid_seq_no=3*//*!*/; BEGIN /*!*/; -# at 809 -# server id 1 end_log_pos 865 CRC32 XXX Table_map: `test`.`t1` mapped to number num -# at 865 -# server id 1 end_log_pos 934 CRC32 XXX Write_rows: table id 30 flags: STMT_END_F +# at 816 +# server id 1 end_log_pos 872 CRC32 XXX Table_map: `test`.`t1` mapped to number num +# at 872 +# server id 1 end_log_pos 941 CRC32 XXX Write_rows: table id 30 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -68,20 +68,20 @@ BEGIN ### @7=6 /* INT meta=0 nullable=1 is_null=0 */ ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */ -# at 934 -# server id 1 end_log_pos 1007 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +# at 941 +# server id 1 end_log_pos 1014 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 1007 -# server id 1 end_log_pos 1049 CRC32 XXX GTID 0-1-4 +# at 1014 +# server id 1 end_log_pos 1056 CRC32 XXX GTID 0-1-4 /*!100001 SET @@session.gtid_seq_no=4*//*!*/; BEGIN /*!*/; -# at 1049 -# server id 1 end_log_pos 1105 CRC32 XXX Table_map: `test`.`t1` mapped to number num -# at 1105 -# server id 1 end_log_pos 1173 CRC32 XXX Write_rows: table id 30 flags: STMT_END_F +# at 1056 +# server id 1 end_log_pos 1112 CRC32 XXX Table_map: `test`.`t1` mapped to number num +# at 1112 +# server id 1 end_log_pos 1180 CRC32 XXX Write_rows: table id 30 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=11 /* INT meta=0 nullable=0 is_null=0 */ @@ -93,20 +93,20 @@ BEGIN ### @7=6 /* INT meta=0 nullable=1 is_null=0 */ ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */ -# at 1173 -# server id 1 end_log_pos 1246 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +# at 1180 +# server id 1 end_log_pos 1253 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 1246 -# server id 1 end_log_pos 1288 CRC32 XXX GTID 0-1-5 +# at 1253 +# server id 1 end_log_pos 1295 CRC32 XXX GTID 0-1-5 /*!100001 SET @@session.gtid_seq_no=5*//*!*/; BEGIN /*!*/; -# at 1288 -# server id 1 end_log_pos 1344 CRC32 XXX Table_map: `test`.`t1` mapped to number num -# at 1344 -# server id 1 end_log_pos 1411 CRC32 XXX Write_rows: table id 30 flags: STMT_END_F +# at 1295 +# server id 1 end_log_pos 1351 CRC32 XXX Table_map: `test`.`t1` mapped to number num +# at 1351 +# server id 1 end_log_pos 1418 CRC32 XXX Write_rows: table id 30 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=12 /* INT meta=0 nullable=0 is_null=0 */ @@ -118,20 +118,20 @@ BEGIN ### @7=6 /* INT meta=0 nullable=1 is_null=0 */ ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ -# at 1411 -# server id 1 end_log_pos 1484 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +# at 1418 +# server id 1 end_log_pos 1491 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 1484 -# server id 1 end_log_pos 1526 CRC32 XXX GTID 0-1-6 +# at 1491 +# server id 1 end_log_pos 1533 CRC32 XXX GTID 0-1-6 /*!100001 SET @@session.gtid_seq_no=6*//*!*/; BEGIN /*!*/; -# at 1526 -# server id 1 end_log_pos 1582 CRC32 XXX Table_map: `test`.`t1` mapped to number num -# at 1582 -# server id 1 end_log_pos 1652 CRC32 XXX Write_rows: table id 30 flags: STMT_END_F +# at 1533 +# server id 1 end_log_pos 1589 CRC32 XXX Table_map: `test`.`t1` mapped to number num +# at 1589 +# server id 1 end_log_pos 1659 CRC32 XXX Write_rows: table id 30 flags: STMT_END_F ### INSERT INTO `test`.`t1` ### SET ### @1=13 /* INT meta=0 nullable=0 is_null=0 */ @@ -143,20 +143,20 @@ BEGIN ### @7=6 /* INT meta=0 nullable=1 is_null=0 */ ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ -# at 1652 -# server id 1 end_log_pos 1725 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +# at 1659 +# server id 1 end_log_pos 1732 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 1725 -# server id 1 end_log_pos 1767 CRC32 XXX GTID 0-1-7 +# at 1732 +# server id 1 end_log_pos 1774 CRC32 XXX GTID 0-1-7 /*!100001 SET @@session.gtid_seq_no=7*//*!*/; BEGIN /*!*/; -# at 1767 -# server id 1 end_log_pos 1823 CRC32 XXX Table_map: `test`.`t2` mapped to number num -# at 1823 -# server id 1 end_log_pos 1990 CRC32 XXX Write_rows: table id 31 flags: STMT_END_F +# at 1774 +# server id 1 end_log_pos 1830 CRC32 XXX Table_map: `test`.`t2` mapped to number num +# at 1830 +# server id 1 end_log_pos 1997 CRC32 XXX Write_rows: table id 31 flags: STMT_END_F ### INSERT INTO `test`.`t2` ### SET ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -201,20 +201,20 @@ BEGIN ### @7=6 /* INT meta=0 nullable=1 is_null=0 */ ### @8=7 /* INT meta=0 nullable=1 is_null=0 */ ### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */ -# at 1990 -# server id 1 end_log_pos 2063 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +# at 1997 +# server id 1 end_log_pos 2070 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 2063 -# server id 1 end_log_pos 2105 CRC32 XXX GTID 0-1-8 +# at 2070 +# server id 1 end_log_pos 2112 CRC32 XXX GTID 0-1-8 /*!100001 SET @@session.gtid_seq_no=8*//*!*/; BEGIN /*!*/; -# at 2105 -# server id 1 end_log_pos 2161 CRC32 XXX Table_map: `test`.`t2` mapped to number num -# at 2161 -# server id 1 end_log_pos 2235 CRC32 XXX Update_rows: table id 31 flags: STMT_END_F +# at 2112 +# server id 1 end_log_pos 2168 CRC32 XXX Table_map: `test`.`t2` mapped to number num +# at 2168 +# server id 1 end_log_pos 2242 CRC32 XXX Update_rows: table id 31 flags: STMT_END_F ### UPDATE `test`.`t2` ### WHERE ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -233,20 +233,20 @@ BEGIN ### @5=NULL /* INT meta=0 nullable=1 is_null=1 */ ### SET ### @5=5 /* INT meta=0 nullable=1 is_null=0 */ -# at 2235 -# server id 1 end_log_pos 2308 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +# at 2242 +# server id 1 end_log_pos 2315 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 2308 -# server id 1 end_log_pos 2350 CRC32 XXX GTID 0-1-9 +# at 2315 +# server id 1 end_log_pos 2357 CRC32 XXX GTID 0-1-9 /*!100001 SET @@session.gtid_seq_no=9*//*!*/; BEGIN /*!*/; -# at 2350 -# server id 1 end_log_pos 2406 CRC32 XXX Table_map: `test`.`t1` mapped to number num -# at 2406 -# server id 1 end_log_pos 2460 CRC32 XXX Delete_rows: table id 30 flags: STMT_END_F +# at 2357 +# server id 1 end_log_pos 2413 CRC32 XXX Table_map: `test`.`t1` mapped to number num +# at 2413 +# server id 1 end_log_pos 2467 CRC32 XXX Delete_rows: table id 30 flags: STMT_END_F ### DELETE FROM `test`.`t1` ### WHERE ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -259,20 +259,20 @@ BEGIN ### DELETE FROM `test`.`t1` ### WHERE ### @1=13 /* INT meta=0 nullable=0 is_null=0 */ -# at 2460 -# server id 1 end_log_pos 2533 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +# at 2467 +# server id 1 end_log_pos 2540 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 2533 -# server id 1 end_log_pos 2575 CRC32 XXX GTID 0-1-10 +# at 2540 +# server id 1 end_log_pos 2582 CRC32 XXX GTID 0-1-10 /*!100001 SET @@session.gtid_seq_no=10*//*!*/; BEGIN /*!*/; -# at 2575 -# server id 1 end_log_pos 2631 CRC32 XXX Table_map: `test`.`t2` mapped to number num -# at 2631 -# server id 1 end_log_pos 2685 CRC32 XXX Delete_rows: table id 31 flags: STMT_END_F +# at 2582 +# server id 1 end_log_pos 2638 CRC32 XXX Table_map: `test`.`t2` mapped to number num +# at 2638 +# server id 1 end_log_pos 2692 CRC32 XXX Delete_rows: table id 31 flags: STMT_END_F ### DELETE FROM `test`.`t2` ### WHERE ### @1=10 /* INT meta=0 nullable=0 is_null=0 */ @@ -285,13 +285,13 @@ BEGIN ### DELETE FROM `test`.`t2` ### WHERE ### @1=13 /* INT meta=0 nullable=0 is_null=0 */ -# at 2685 -# server id 1 end_log_pos 2758 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +# at 2692 +# server id 1 end_log_pos 2765 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 SET TIMESTAMP=X/*!*/; COMMIT /*!*/; -# at 2758 -# server id 1 end_log_pos 2806 CRC32 XXX Rotate to master-bin.000002 pos: 4 +# at 2765 +# server id 1 end_log_pos 2813 CRC32 XXX Rotate to master-bin.000002 pos: 4 DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; diff --git a/mysql-test/r/mysqlbinlog_stmt_compressed.result b/mysql-test/r/mysqlbinlog_stmt_compressed.result new file mode 100644 index 0000000000000..6bff2649b0245 --- /dev/null +++ b/mysql-test/r/mysqlbinlog_stmt_compressed.result @@ -0,0 +1,182 @@ +SET GLOBAL log_bin_compress=on; +SET GLOBAL log_bin_compress_min_len=10; +CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f5 BIGINT, f6 INT, f7 INT, f8 char(1)); +CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1)); +INSERT INTO t1 VALUES (10, 1, 2, 3, 4, 5, 6, 7, ""); +INSERT INTO t1 VALUES (11, 1, 2, 3, 4, 5, 6, 7, NULL); +INSERT INTO t1 VALUES (12, 1, 2, 3, NULL, 5, 6, 7, "A"); +INSERT INTO t1 VALUES (13, 1, 2, 3, 0, 5, 6, 7, "A"); +INSERT INTO t2 SELECT * FROM t1; +UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL; +DELETE FROM t1; +DELETE FROM t2; +FLUSH BINARY LOGS; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; +DELIMITER /*!*/; +# at 4 +# server id 1 end_log_pos 256 CRC32 XXX Start: xxx +ROLLBACK/*!*/; +# at 256 +# server id 1 end_log_pos 285 CRC32 XXX Gtid list [] +# at 285 +# server id 1 end_log_pos 329 CRC32 XXX Binlog checkpoint master-bin.000001 +# at 329 +# server id 1 end_log_pos 371 CRC32 XXX GTID 0-1-1 ddl +/*!100101 SET @@session.skip_parallel_replication=0*//*!*/; +/*!100001 SET @@session.gtid_domain_id=0*//*!*/; +/*!100001 SET @@session.server_id=1*//*!*/; +/*!100001 SET @@session.gtid_seq_no=1*//*!*/; +# at 371 +# server id 1 end_log_pos 533 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +use `test`/*!*/; +SET TIMESTAMP=X/*!*/; +SET @@session.pseudo_thread_id=4/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; +SET @@session.sql_mode=1342177280/*!*/; +SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; +/*!\C latin1 *//*!*/; +SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/; +SET @@session.lc_time_names=0/*!*/; +SET @@session.collation_database=DEFAULT/*!*/; +CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f5 BIGINT, f6 INT, f7 INT, f8 char(1)) +/*!*/; +# at 533 +# server id 1 end_log_pos 575 CRC32 XXX GTID 0-1-2 ddl +/*!100001 SET @@session.gtid_seq_no=2*//*!*/; +# at 575 +# server id 1 end_log_pos 727 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1)) +/*!*/; +# at 727 +# server id 1 end_log_pos 769 CRC32 XXX GTID 0-1-3 +/*!100001 SET @@session.gtid_seq_no=3*//*!*/; +BEGIN +/*!*/; +# at 769 +# server id 1 end_log_pos 897 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +INSERT INTO t1 VALUES (10, 1, 2, 3, 4, 5, 6, 7, "") +/*!*/; +# at 897 +# server id 1 end_log_pos 970 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 970 +# server id 1 end_log_pos 1012 CRC32 XXX GTID 0-1-4 +/*!100001 SET @@session.gtid_seq_no=4*//*!*/; +BEGIN +/*!*/; +# at 1012 +# server id 1 end_log_pos 1140 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +INSERT INTO t1 VALUES (11, 1, 2, 3, 4, 5, 6, 7, NULL) +/*!*/; +# at 1140 +# server id 1 end_log_pos 1213 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 1213 +# server id 1 end_log_pos 1255 CRC32 XXX GTID 0-1-5 +/*!100001 SET @@session.gtid_seq_no=5*//*!*/; +BEGIN +/*!*/; +# at 1255 +# server id 1 end_log_pos 1385 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +INSERT INTO t1 VALUES (12, 1, 2, 3, NULL, 5, 6, 7, "A") +/*!*/; +# at 1385 +# server id 1 end_log_pos 1458 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 1458 +# server id 1 end_log_pos 1500 CRC32 XXX GTID 0-1-6 +/*!100001 SET @@session.gtid_seq_no=6*//*!*/; +BEGIN +/*!*/; +# at 1500 +# server id 1 end_log_pos 1627 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +INSERT INTO t1 VALUES (13, 1, 2, 3, 0, 5, 6, 7, "A") +/*!*/; +# at 1627 +# server id 1 end_log_pos 1700 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 1700 +# server id 1 end_log_pos 1742 CRC32 XXX GTID 0-1-7 +/*!100001 SET @@session.gtid_seq_no=7*//*!*/; +BEGIN +/*!*/; +# at 1742 +# server id 1 end_log_pos 1850 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +INSERT INTO t2 SELECT * FROM t1 +/*!*/; +# at 1850 +# server id 1 end_log_pos 1923 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 1923 +# server id 1 end_log_pos 1965 CRC32 XXX GTID 0-1-8 +/*!100001 SET @@session.gtid_seq_no=8*//*!*/; +BEGIN +/*!*/; +# at 1965 +# server id 1 end_log_pos 2082 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL +/*!*/; +# at 2082 +# server id 1 end_log_pos 2155 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 2155 +# server id 1 end_log_pos 2197 CRC32 XXX GTID 0-1-9 +/*!100001 SET @@session.gtid_seq_no=9*//*!*/; +BEGIN +/*!*/; +# at 2197 +# server id 1 end_log_pos 2288 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +DELETE FROM t1 +/*!*/; +# at 2288 +# server id 1 end_log_pos 2361 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 2361 +# server id 1 end_log_pos 2403 CRC32 XXX GTID 0-1-10 +/*!100001 SET @@session.gtid_seq_no=10*//*!*/; +BEGIN +/*!*/; +# at 2403 +# server id 1 end_log_pos 2494 CRC32 XXX Query_compressed thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +DELETE FROM t2 +/*!*/; +# at 2494 +# server id 1 end_log_pos 2567 CRC32 XXX Query thread_id=4 exec_time=x error_code=0 +SET TIMESTAMP=X/*!*/; +COMMIT +/*!*/; +# at 2567 +# server id 1 end_log_pos 2615 CRC32 XXX Rotate to master-bin.000002 pos: 4 +DELIMITER ; +# End of log file +ROLLBACK /* added by mysqlbinlog */; +/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; +/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; +DROP TABLE t1,t2; +SET GLOBAL log_bin_compress=off; +SET GLOBAL log_bin_compress_min_len=256; diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index 862113c224a41..52f526d912447 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -344,6 +344,10 @@ The following options may be given as the first argument: We strongly recommend to use either --log-basename or specify a filename to ensure that replication doesn't stop if the real hostname of the computer changes. + --log-bin-compress Whether the binary log can be compressed + --log-bin-compress-min-len[=#] + Minimum length of sql statement(in statement mode) or + record(in row mode)that can be compressed. --log-bin-index=name File that holds the names for last binary log files. --log-bin-trust-function-creators @@ -1264,6 +1268,8 @@ lc-time-names en_US local-infile TRUE lock-wait-timeout 31536000 log-bin (No default value) +log-bin-compress FALSE +log-bin-compress-min-len 256 log-bin-index (No default value) log-bin-trust-function-creators FALSE log-error diff --git a/mysql-test/suite/binlog/r/binlog_variables_log_bin.result b/mysql-test/suite/binlog/r/binlog_variables_log_bin.result index 215e14f97dfb5..d05a28847b481 100644 --- a/mysql-test/suite/binlog/r/binlog_variables_log_bin.result +++ b/mysql-test/suite/binlog/r/binlog_variables_log_bin.result @@ -3,6 +3,10 @@ Variable_name log_bin Value ON Variable_name log_bin_basename Value MYSQLTEST_VARDIR/mysqld.1/data/other +Variable_name log_bin_compress +Value OFF +Variable_name log_bin_compress_min_len +Value 256 Variable_name log_bin_index Value MYSQLTEST_VARDIR/mysqld.1/data/mysqld-bin.index Variable_name log_bin_trust_function_creators diff --git a/mysql-test/suite/binlog/r/binlog_variables_log_bin_index.result b/mysql-test/suite/binlog/r/binlog_variables_log_bin_index.result index fb7324ced34a8..09f2feae9c285 100644 --- a/mysql-test/suite/binlog/r/binlog_variables_log_bin_index.result +++ b/mysql-test/suite/binlog/r/binlog_variables_log_bin_index.result @@ -3,6 +3,10 @@ Variable_name log_bin Value ON Variable_name log_bin_basename Value MYSQLTEST_VARDIR/mysqld.1/data/other +Variable_name log_bin_compress +Value OFF +Variable_name log_bin_compress_min_len +Value 256 Variable_name log_bin_index Value MYSQLTEST_VARDIR/tmp/something.index Variable_name log_bin_trust_function_creators diff --git a/mysql-test/suite/rpl/r/rpl_binlog_compress.result b/mysql-test/suite/rpl/r/rpl_binlog_compress.result new file mode 100644 index 0000000000000..d729611e8852a --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_binlog_compress.result @@ -0,0 +1,76 @@ +include/master-slave.inc +[connection master] +set @old_log_bin_compress=@@log_bin_compress; +set @old_log_bin_compress_min_len=@@log_bin_compress_min_len; +set @old_binlog_format=@@binlog_format; +set @old_binlog_row_image=@@binlog_row_image; +set global log_bin_compress=on; +set global log_bin_compress_min_len=10; +drop table if exists t1; +Warnings: +Note 1051 Unknown table 'test.t1' +CREATE TABLE t1 (pr_id int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, pr_page int(11) NOT NULL, pr_type varbinary(60) NOT NULL, test int, UNIQUE KEY pr_pagetype (pr_page,pr_type)) ENGINE=myisam AUTO_INCREMENT=136; +set binlog_format=statement; +insert into t1 (pr_page, pr_type, test) values(1,"one",0),(2,"two",0); +replace into t1 (pr_page, pr_type,test) values(1,"one",2); +update t1 set test=test+1 where pr_page > 1; +delete from t1 where test=1; +select * from t1; +pr_id pr_page pr_type test +138 1 one 2 +connection slave; +connection slave; +select * from t1; +pr_id pr_page pr_type test +138 1 one 2 +connection master; +set binlog_format=row; +insert into t1 (pr_page, pr_type, test) values(3,"three",0),(4,"four",4),(5, "five", 0); +replace into t1 (pr_page, pr_type,test) values(3,"one",2); +update t1 set test=test+1 where pr_page > 3; +delete from t1 where test=1; +select * from t1; +pr_id pr_page pr_type test +138 1 one 2 +140 4 four 5 +139 3 three 0 +142 3 one 2 +connection slave; +connection slave; +select * from t1; +pr_id pr_page pr_type test +138 1 one 2 +140 4 four 5 +139 3 three 0 +142 3 one 2 +connection master; +set binlog_row_image=minimal; +insert into t1 (pr_page, pr_type, test) values(6,"six",0),(7,"seven",7),(8, "eight", 0); +replace into t1 (pr_page, pr_type,test) values(6,"six",2); +update t1 set test=test+1 where pr_page > 6; +delete from t1 where test=1; +select * from t1; +pr_id pr_page pr_type test +138 1 one 2 +140 4 four 5 +139 3 three 0 +144 7 seven 8 +142 3 one 2 +146 6 six 2 +connection slave; +connection slave; +select * from t1; +pr_id pr_page pr_type test +138 1 one 2 +140 4 four 5 +139 3 three 0 +144 7 seven 8 +142 3 one 2 +146 6 six 2 +connection master; +drop table t1; +set global log_bin_compress=@old_log_bin_compress; +set global log_bin_compress_min_len=@old_log_bin_compress_min_len; +set binlog_format=@old_binlog_format; +set binlog_row_image=@old_binlog_row_image; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_binlog_compress.test b/mysql-test/suite/rpl/t/rpl_binlog_compress.test new file mode 100644 index 0000000000000..ef1e45084b686 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_binlog_compress.test @@ -0,0 +1,61 @@ +# +# Test of compressed binlog with replication +# + +source include/master-slave.inc; + +set @old_log_bin_compress=@@log_bin_compress; +set @old_log_bin_compress_min_len=@@log_bin_compress_min_len; +set @old_binlog_format=@@binlog_format; +set @old_binlog_row_image=@@binlog_row_image; + +set global log_bin_compress=on; +set global log_bin_compress_min_len=10; + +drop table if exists t1; +CREATE TABLE t1 (pr_id int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, pr_page int(11) NOT NULL, pr_type varbinary(60) NOT NULL, test int, UNIQUE KEY pr_pagetype (pr_page,pr_type)) ENGINE=myisam AUTO_INCREMENT=136; + +set binlog_format=statement; +insert into t1 (pr_page, pr_type, test) values(1,"one",0),(2,"two",0); +replace into t1 (pr_page, pr_type,test) values(1,"one",2); +update t1 set test=test+1 where pr_page > 1; +delete from t1 where test=1; + +select * from t1; +sync_slave_with_master; +connection slave; +select * from t1; +connection master; + + +set binlog_format=row; +insert into t1 (pr_page, pr_type, test) values(3,"three",0),(4,"four",4),(5, "five", 0); +replace into t1 (pr_page, pr_type,test) values(3,"one",2); +update t1 set test=test+1 where pr_page > 3; +delete from t1 where test=1; + +select * from t1; +sync_slave_with_master; +connection slave; +select * from t1; +connection master; + + +set binlog_row_image=minimal; +insert into t1 (pr_page, pr_type, test) values(6,"six",0),(7,"seven",7),(8, "eight", 0); +replace into t1 (pr_page, pr_type,test) values(6,"six",2); +update t1 set test=test+1 where pr_page > 6; +delete from t1 where test=1; + +select * from t1; +sync_slave_with_master; +connection slave; +select * from t1; +connection master; +drop table t1; + +set global log_bin_compress=@old_log_bin_compress; +set global log_bin_compress_min_len=@old_log_bin_compress_min_len; +set binlog_format=@old_binlog_format; +set binlog_row_image=@old_binlog_row_image; +--source include/rpl_end.inc diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index 2a6c24653e175..d9bcb91760be6 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -1759,6 +1759,34 @@ NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT NULL +VARIABLE_NAME LOG_BIN_COMPRESS +SESSION_VALUE NULL +GLOBAL_VALUE OFF +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE OFF +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE BOOLEAN +VARIABLE_COMMENT Whether the binary log can be compressed +NUMERIC_MIN_VALUE NULL +NUMERIC_MAX_VALUE NULL +NUMERIC_BLOCK_SIZE NULL +ENUM_VALUE_LIST OFF,ON +READ_ONLY NO +COMMAND_LINE_ARGUMENT OPTIONAL +VARIABLE_NAME LOG_BIN_COMPRESS_MIN_LEN +SESSION_VALUE NULL +GLOBAL_VALUE 256 +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE 256 +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE INT UNSIGNED +VARIABLE_COMMENT Minimum length of sql statement(in statement mode) or record(in row mode)that can be compressed. +NUMERIC_MIN_VALUE 10 +NUMERIC_MAX_VALUE 1024 +NUMERIC_BLOCK_SIZE 1 +ENUM_VALUE_LIST NULL +READ_ONLY NO +COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME LOG_BIN_INDEX SESSION_VALUE NULL GLOBAL_VALUE diff --git a/mysql-test/t/mysqlbinlog_row_compressed.test b/mysql-test/t/mysqlbinlog_row_compressed.test new file mode 100644 index 0000000000000..05edf7a9a7854 --- /dev/null +++ b/mysql-test/t/mysqlbinlog_row_compressed.test @@ -0,0 +1,37 @@ +# +# Test for compressed row event +# + +--source include/have_log_bin.inc +--source include/have_binlog_format_row.inc + +# +# +# mysqlbinlog: comprssed row event +# +# + +SET GLOBAL log_bin_compress=on; +SET GLOBAL log_bin_compress_min_len=10; +CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f5 BIGINT, f6 INT, f7 INT, f8 char(1)); +CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1)); +INSERT INTO t1 VALUES (10, 1, 2, 3, 4, 5, 6, 7, ""); +INSERT INTO t1 VALUES (11, 1, 2, 3, 4, 5, 6, 7, NULL); +INSERT INTO t1 VALUES (12, 1, 2, 3, NULL, 5, 6, 7, "A"); +INSERT INTO t1 VALUES (13, 1, 2, 3, 0, 5, 6, 7, "A"); +INSERT INTO t2 SELECT * FROM t1; +UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL; +DELETE FROM t1; +DELETE FROM t2; + +--let $binlog = query_get_value(SHOW MASTER STATUS, File, 1) +--let $datadir = `SELECT @@datadir` + +FLUSH BINARY LOGS; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--replace_regex /\d{6} *\d*:\d\d:\d\d// /Start:.*at startup/Start: xxx/ /SET TIMESTAMP=\d*/SET TIMESTAMP=X/ /exec_time=\d*/exec_time=x/ /mapped to number \d*/mapped to number num/ /CRC32 0x[0-9a-f]+/CRC32 XXX/ +--exec $MYSQL_BINLOG --verbose --verbose --base64-output=DECODE-ROWS $datadir/$binlog + +DROP TABLE t1,t2; +SET GLOBAL log_bin_compress=off; +SET GLOBAL log_bin_compress_min_len=256; diff --git a/mysql-test/t/mysqlbinlog_stmt_compressed.test b/mysql-test/t/mysqlbinlog_stmt_compressed.test new file mode 100644 index 0000000000000..da5e7f44696fc --- /dev/null +++ b/mysql-test/t/mysqlbinlog_stmt_compressed.test @@ -0,0 +1,37 @@ +# +# Test for compressed query event +# + +--source include/have_log_bin.inc +--source include/have_binlog_format_statement.inc + +# +# +# mysqlbinlog: comprssed query event +# +# + +SET GLOBAL log_bin_compress=on; +SET GLOBAL log_bin_compress_min_len=10; +CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 TINYINT, f4 MEDIUMINT, f5 BIGINT, f6 INT, f7 INT, f8 char(1)); +CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT, f2 INT, f3 INT, f4 INT, f5 MEDIUMINT, f6 INT, f7 INT, f8 char(1)); +INSERT INTO t1 VALUES (10, 1, 2, 3, 4, 5, 6, 7, ""); +INSERT INTO t1 VALUES (11, 1, 2, 3, 4, 5, 6, 7, NULL); +INSERT INTO t1 VALUES (12, 1, 2, 3, NULL, 5, 6, 7, "A"); +INSERT INTO t1 VALUES (13, 1, 2, 3, 0, 5, 6, 7, "A"); +INSERT INTO t2 SELECT * FROM t1; +UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL; +DELETE FROM t1; +DELETE FROM t2; + +--let $binlog = query_get_value(SHOW MASTER STATUS, File, 1) +--let $datadir = `SELECT @@datadir` + +FLUSH BINARY LOGS; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +--replace_regex /\d{6} *\d*:\d\d:\d\d// /Start:.*at startup/Start: xxx/ /SET TIMESTAMP=\d*/SET TIMESTAMP=X/ /exec_time=\d*/exec_time=x/ /mapped to number \d*/mapped to number num/ /CRC32 0x[0-9a-f]+/CRC32 XXX/ +--exec $MYSQL_BINLOG --verbose --verbose --base64-output=DECODE-ROWS $datadir/$binlog + +DROP TABLE t1,t2; +SET GLOBAL log_bin_compress=off; +SET GLOBAL log_bin_compress_min_len=256; From c06bc668166ed658e6c68a57d9a6ee42b14189e8 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Thu, 20 Oct 2016 18:00:59 +0200 Subject: [PATCH 04/71] MDEV-11065: Compressed binary log Minor review comments/changes: - A bunch of style-fixes. - Change macros to static inline functions. - Update check_event_type() with compressed event types. - Small .result file update. --- mysql-test/suite/rpl/r/rpl_checksum.result | 2 +- mysql-test/t/mysqlbinlog_row_compressed.test | 2 +- mysql-test/t/mysqlbinlog_stmt_compressed.test | 2 +- sql/log_event.cc | 352 ++++++++++-------- sql/log_event.h | 60 ++- sql/rpl_parallel.cc | 4 +- sql/slave.cc | 14 +- sql/sql_binlog.cc | 6 + sql/sql_class.cc | 1 - 9 files changed, 267 insertions(+), 176 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_checksum.result b/mysql-test/suite/rpl/r/rpl_checksum.result index 820224d99da07..e74e5af9f84fa 100644 --- a/mysql-test/suite/rpl/r/rpl_checksum.result +++ b/mysql-test/suite/rpl/r/rpl_checksum.result @@ -79,7 +79,7 @@ connection slave; set @@global.debug_dbug='d,simulate_slave_unaware_checksum'; start slave; include/wait_for_slave_io_error.inc [errno=1236] -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the first event 'master-bin.000009' at 368, the last event read from 'master-bin.000010' at 4, the last byte read from 'master-bin.000010' at 249.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the first event 'master-bin.000009' at 375, the last event read from 'master-bin.000010' at 4, the last byte read from 'master-bin.000010' at 256.'' select count(*) as zero from t1; zero 0 diff --git a/mysql-test/t/mysqlbinlog_row_compressed.test b/mysql-test/t/mysqlbinlog_row_compressed.test index 05edf7a9a7854..3f8c31a088aef 100644 --- a/mysql-test/t/mysqlbinlog_row_compressed.test +++ b/mysql-test/t/mysqlbinlog_row_compressed.test @@ -7,7 +7,7 @@ # # -# mysqlbinlog: comprssed row event +# mysqlbinlog: compressed row event # # diff --git a/mysql-test/t/mysqlbinlog_stmt_compressed.test b/mysql-test/t/mysqlbinlog_stmt_compressed.test index da5e7f44696fc..4b22683059b7c 100644 --- a/mysql-test/t/mysqlbinlog_stmt_compressed.test +++ b/mysql-test/t/mysqlbinlog_stmt_compressed.test @@ -7,7 +7,7 @@ # # -# mysqlbinlog: comprssed query event +# mysqlbinlog: compressed query event # # diff --git a/sql/log_event.cc b/sql/log_event.cc index fbc9db1f5b79b..30a770080944f 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -708,11 +708,11 @@ char *str_to_hex(char *to, const char *from, uint len) /** Compressed Record Record Header: 1 Byte - 0 Bit: Always 1, mean compressed; - 1-3 Bit: Reversed, compressed algorithmAlways 0, means zlib - 4-7 Bit: Bytes of "Record Original Length" + 0 Bit: Always 1, mean compressed; + 1-3 Bit: Reversed, compressed algorithm - Always 0, means zlib + 4-7 Bit: Bytes of "Record Original Length" Record Original Length: 1-4 Bytes - Compressed Buf: + Compressed Buf: */ /** @@ -721,7 +721,7 @@ char *str_to_hex(char *to, const char *from, uint len) uint32 binlog_get_compress_len(uint32 len) { - /* 5 for the begin content, 1 reserved for a '\0'*/ + /* 5 for the begin content, 1 reserved for a '\0'*/ return ALIGN_SIZE((BINLOG_COMPRESSED_HEADER_LEN + BINLOG_COMPRESSED_ORIGINAL_LENGTH_MAX_BYTES) + compressBound(len) + 1); } @@ -769,7 +769,8 @@ int binlog_buf_compress(const char *src, char *dst, uint32 len, uint32 *comlen) dst[0] = 0x80 | (lenlen & 0x07); uLongf tmplen = (uLongf)*comlen - BINLOG_COMPRESSED_HEADER_LEN - lenlen - 1; - if (compress((Bytef *)dst + BINLOG_COMPRESSED_HEADER_LEN + lenlen, &tmplen, (const Bytef *)src, (uLongf)len) != Z_OK) + if (compress((Bytef *)dst + BINLOG_COMPRESSED_HEADER_LEN + lenlen, &tmplen, + (const Bytef *)src, (uLongf)len) != Z_OK) { return 1; } @@ -779,41 +780,46 @@ int binlog_buf_compress(const char *src, char *dst, uint32 len, uint32 *comlen) /** Convert a query_compressed_log_event to query_log_event - from 'src' to 'dst'(malloced inside), the size after compress - stored in 'newlen'. + from 'src' to 'dst', the size after compression stored in 'newlen'. - @Warning: - 1)The caller should call my_free to release 'dst'. + @Note: + 1) The caller should call my_free to release 'dst' if *is_malloc is + returned as true. + 2) If *is_malloc is retuened as false, then 'dst' reuses the passed-in + 'buf'. - return zero if successful, others otherwise. + return zero if successful, non-zero otherwise. */ -int query_event_uncompress(const Format_description_log_event *description_event, bool contain_checksum, - const char *src, char* buf, ulong buf_size, bool* is_malloc, - char **dst, ulong *newlen) +int +query_event_uncompress(const Format_description_log_event *description_event, + bool contain_checksum, const char *src, char* buf, + ulong buf_size, bool* is_malloc, char **dst, + ulong *newlen) { ulong len = uint4korr(src + EVENT_LEN_OFFSET); - const char *tmp = src; + const char *tmp = src; DBUG_ASSERT((uchar)src[EVENT_TYPE_OFFSET] == QUERY_COMPRESSED_EVENT); - uint8 common_header_len= description_event->common_header_len; - uint8 post_header_len= description_event->post_header_len[QUERY_COMPRESSED_EVENT-1]; + uint8 common_header_len= description_event->common_header_len; + uint8 post_header_len= + description_event->post_header_len[QUERY_COMPRESSED_EVENT-1]; - tmp += common_header_len; + tmp += common_header_len; - uint db_len = (uint)tmp[Q_DB_LEN_OFFSET]; - uint16 status_vars_len= uint2korr(tmp + Q_STATUS_VARS_LEN_OFFSET); + uint db_len = (uint)tmp[Q_DB_LEN_OFFSET]; + uint16 status_vars_len= uint2korr(tmp + Q_STATUS_VARS_LEN_OFFSET); - tmp += post_header_len + status_vars_len + db_len + 1; + tmp += post_header_len + status_vars_len + db_len + 1; - uint32 un_len = binlog_get_uncompress_len(tmp); - *newlen = (tmp - src) + un_len; + uint32 un_len = binlog_get_uncompress_len(tmp); + *newlen = (tmp - src) + un_len; if(contain_checksum) *newlen += BINLOG_CHECKSUM_LEN; uint32 alloc_size = ALIGN_SIZE(*newlen); - char *new_dst = NULL; + char *new_dst = NULL; *is_malloc = false; if (alloc_size <= buf_size) @@ -822,7 +828,7 @@ int query_event_uncompress(const Format_description_log_event *description_event } else { - new_dst = (char *)my_malloc(alloc_size, MYF(MY_WME)); + new_dst = (char *)my_malloc(alloc_size, MYF(MY_WME)); if (!new_dst) return 1; @@ -830,42 +836,47 @@ int query_event_uncompress(const Format_description_log_event *description_event } /* copy the head*/ - memcpy(new_dst, src , tmp - src); - if (binlog_buf_uncompress(tmp, new_dst + (tmp - src), len - (tmp - src), &un_len)) - { + memcpy(new_dst, src , tmp - src); + if (binlog_buf_uncompress(tmp, new_dst + (tmp - src), + len - (tmp - src), &un_len)) + { if (*is_malloc) - my_free(new_dst); + my_free(new_dst); *is_malloc = false; - return 1; - } + return 1; + } new_dst[EVENT_TYPE_OFFSET] = QUERY_EVENT; - int4store(new_dst + EVENT_LEN_OFFSET, *newlen); - if(contain_checksum){ + int4store(new_dst + EVENT_LEN_OFFSET, *newlen); + if(contain_checksum) + { ulong clear_len = *newlen - BINLOG_CHECKSUM_LEN; - int4store(new_dst + clear_len, my_checksum(0L, (uchar *)new_dst, clear_len)); + int4store(new_dst + clear_len, + my_checksum(0L, (uchar *)new_dst, clear_len)); } *dst = new_dst; - return 0; + return 0; } -int row_log_event_uncompress(const Format_description_log_event *description_event, bool contain_checksum, - const char *src, char* buf, ulong buf_size, bool* is_malloc, - char **dst, ulong *newlen) +int +row_log_event_uncompress(const Format_description_log_event *description_event, + bool contain_checksum, const char *src, char* buf, + ulong buf_size, bool* is_malloc, char **dst, + ulong *newlen) { Log_event_type type = (Log_event_type)(uchar)src[EVENT_TYPE_OFFSET]; ulong len = uint4korr(src + EVENT_LEN_OFFSET); - const char *tmp = src; + const char *tmp = src; char *new_dst = NULL; DBUG_ASSERT(LOG_EVENT_IS_ROW_COMPRESSED(type)); - uint8 common_header_len= description_event->common_header_len; - uint8 post_header_len= description_event->post_header_len[type-1]; + uint8 common_header_len= description_event->common_header_len; + uint8 post_header_len= description_event->post_header_len[type-1]; - tmp += common_header_len + ROWS_HEADER_LEN_V1; + tmp += common_header_len + ROWS_HEADER_LEN_V1; if (post_header_len == ROWS_HEADER_LEN_V2) { /* @@ -879,15 +890,16 @@ int row_log_event_uncompress(const Format_description_log_event *description_eve tmp += var_header_len; /* get the uncompressed event type */ - type = (Log_event_type)(type - WRITE_ROWS_COMPRESSED_EVENT + WRITE_ROWS_EVENT); + type= + (Log_event_type)(type - WRITE_ROWS_COMPRESSED_EVENT + WRITE_ROWS_EVENT); } else { /* get the uncompressed event type */ - type = (Log_event_type)(type - WRITE_ROWS_COMPRESSED_EVENT_V1 + WRITE_ROWS_EVENT_V1); + type= (Log_event_type) + (type - WRITE_ROWS_COMPRESSED_EVENT_V1 + WRITE_ROWS_EVENT_V1); } - ulong m_width = net_field_length((uchar **)&tmp); tmp += (m_width + 7) / 8; @@ -896,8 +908,8 @@ int row_log_event_uncompress(const Format_description_log_event *description_eve tmp += (m_width + 7) / 8; } - uint32 un_len = binlog_get_uncompress_len(tmp); - *newlen = (tmp - src) + un_len; + uint32 un_len = binlog_get_uncompress_len(tmp); + *newlen = (tmp - src) + un_len; if(contain_checksum) *newlen += BINLOG_CHECKSUM_LEN; @@ -910,32 +922,34 @@ int row_log_event_uncompress(const Format_description_log_event *description_eve } else { - new_dst = (char *)my_malloc(alloc_size, MYF(MY_WME)); + new_dst = (char *)my_malloc(alloc_size, MYF(MY_WME)); if (!new_dst) return 1; *is_malloc = true; } - /* copy the head*/ - memcpy(new_dst, src , tmp - src); - /* uncompress the body */ - if (binlog_buf_uncompress(tmp, new_dst + (tmp - src), len - (tmp - src), &un_len)) - { + /* Copy the head. */ + memcpy(new_dst, src , tmp - src); + /* Uncompress the body. */ + if (binlog_buf_uncompress(tmp, new_dst + (tmp - src), + len - (tmp - src), &un_len)) + { if (*is_malloc) - my_free(new_dst); + my_free(new_dst); - return 1; - } + return 1; + } new_dst[EVENT_TYPE_OFFSET] = type; int4store(new_dst + EVENT_LEN_OFFSET, *newlen); if(contain_checksum){ ulong clear_len = *newlen - BINLOG_CHECKSUM_LEN; - int4store(new_dst + clear_len, my_checksum(0L, (uchar *)new_dst, clear_len)); + int4store(new_dst + clear_len, + my_checksum(0L, (uchar *)new_dst, clear_len)); } *dst = new_dst; - return 0; + return 0; } /** @@ -945,27 +959,28 @@ int row_log_event_uncompress(const Format_description_log_event *description_eve uint32 binlog_get_uncompress_len(const char *buf) { DBUG_ASSERT((buf[0] & 0xe0) == 0x80); - uint32 lenlen = buf[0] & 0x07; - uint32 len = 0; - switch(lenlen) - { - case 1: - len = uchar(buf[1]); - break; - case 2: - len = uchar(buf[1]) << 8 | uchar(buf[2]); - break; - case 3: - len = uchar(buf[1]) << 16 | uchar(buf[2]) << 8 | uchar(buf[3]); - break; - case 4: - len = uchar(buf[1]) << 24 | uchar(buf[2]) << 16 | uchar(buf[3]) << 8 | uchar(buf[4]); - break; - default: - DBUG_ASSERT(lenlen >= 1 && lenlen <= 4); - break; - } - return len; + uint32 lenlen = buf[0] & 0x07; + uint32 len = 0; + switch(lenlen) + { + case 1: + len = uchar(buf[1]); + break; + case 2: + len = uchar(buf[1]) << 8 | uchar(buf[2]); + break; + case 3: + len = uchar(buf[1]) << 16 | uchar(buf[2]) << 8 | uchar(buf[3]); + break; + case 4: + len = uchar(buf[1]) << 24 | uchar(buf[2]) << 16 | + uchar(buf[3]) << 8 | uchar(buf[4]); + break; + default: + DBUG_ASSERT(lenlen >= 1 && lenlen <= 4); + break; + } + return len; } /** @@ -979,22 +994,24 @@ uint32 binlog_get_uncompress_len(const char *buf) return zero if successful, others otherwise. */ -int binlog_buf_uncompress(const char *src, char *dst, uint32 len, uint32 *newlen) +int binlog_buf_uncompress(const char *src, char *dst, uint32 len, + uint32 *newlen) { - if((src[0] & 0x80) == 0) - { - return 1; - } + if((src[0] & 0x80) == 0) + { + return 1; + } - uint32 lenlen = src[0] & 0x07; - uLongf buflen = *newlen; - if(uncompress((Bytef *)dst, &buflen, (const Bytef*)src + 1 + lenlen, len) != Z_OK) - { - return 1; - } + uint32 lenlen= src[0] & 0x07; + uLongf buflen= *newlen; + if(uncompress((Bytef *)dst, &buflen, + (const Bytef*)src + 1 + lenlen, len) != Z_OK) + { + return 1; + } - *newlen = (uint32)buflen; - return 0; + *newlen = (uint32)buflen; + return 0; } #ifndef MYSQL_CLIENT @@ -1964,7 +1981,8 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, ev = new Query_log_event(buf, event_len, fdle, QUERY_EVENT); break; case QUERY_COMPRESSED_EVENT: - ev = new Query_compressed_log_event(buf, event_len, fdle, QUERY_COMPRESSED_EVENT); + ev = new Query_compressed_log_event(buf, event_len, fdle, + QUERY_COMPRESSED_EVENT); break; case LOAD_EVENT: ev = new Load_log_event(buf, event_len, fdle); @@ -3149,32 +3167,32 @@ void Log_event::print_base64(IO_CACHE* file, } case UPDATE_ROWS_EVENT: case UPDATE_ROWS_EVENT_V1: - { - ev= new Update_rows_log_event((const char*) ptr, size, - glob_description_event); - break; - } + { + ev= new Update_rows_log_event((const char*) ptr, size, + glob_description_event); + break; + } case WRITE_ROWS_COMPRESSED_EVENT: case WRITE_ROWS_COMPRESSED_EVENT_V1: - { - ev= new Write_rows_compressed_log_event((const char*) ptr, size, - glob_description_event); - break; - } + { + ev= new Write_rows_compressed_log_event((const char*) ptr, size, + glob_description_event); + break; + } case UPDATE_ROWS_COMPRESSED_EVENT: case UPDATE_ROWS_COMPRESSED_EVENT_V1: - { - ev= new Update_rows_compressed_log_event((const char*) ptr, size, - glob_description_event); - break; + { + ev= new Update_rows_compressed_log_event((const char*) ptr, size, + glob_description_event); + break; } case DELETE_ROWS_COMPRESSED_EVENT: case DELETE_ROWS_COMPRESSED_EVENT_V1: - { - ev= new Delete_rows_compressed_log_event((const char*) ptr, size, - glob_description_event); - break; - } + { + ev= new Delete_rows_compressed_log_event((const char*) ptr, size, + glob_description_event); + break; + } default: break; } @@ -3743,8 +3761,9 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, Query_compressed_log_event::Query_compressed_log_event(THD* thd_arg, const char* query_arg, ulong query_length, bool using_trans, bool direct, bool suppress_use, int errcode) - :Query_log_event(thd_arg, query_arg, query_length, using_trans, direct, suppress_use, errcode), - query_buf(0) + :Query_log_event(thd_arg, query_arg, query_length, using_trans, direct, + suppress_use, errcode), + query_buf(0) { } @@ -4154,17 +4173,22 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, DBUG_VOID_RETURN; } -Query_compressed_log_event::Query_compressed_log_event(const char *buf, uint event_len, +Query_compressed_log_event::Query_compressed_log_event(const char *buf, + uint event_len, const Format_description_log_event *description_event, Log_event_type event_type) - :Query_log_event(buf, event_len, description_event, event_type),query_buf(NULL) + :Query_log_event(buf, event_len, description_event, event_type), + query_buf(NULL) { if(query) { uint32 un_len=binlog_get_uncompress_len(query); - query_buf = (Log_event::Byte*)my_malloc(ALIGN_SIZE(un_len + 1), MYF(MY_WME)); //reserve one byte for '\0' - if(query_buf && !binlog_buf_uncompress(query, (char *)query_buf, q_len, &un_len)) + /* Reserve one byte for '\0' */ + query_buf = (Log_event::Byte*)my_malloc(ALIGN_SIZE(un_len + 1), + MYF(MY_WME)); + if(query_buf && + !binlog_buf_uncompress(query, (char *)query_buf, q_len, &un_len)) { query_buf[un_len] = 0; query = (const char *)query_buf; @@ -9953,7 +9977,8 @@ void Rows_log_event::uncompress_buf() uchar *new_buf= (uchar*) my_malloc(ALIGN_SIZE(un_len), MYF(MY_WME)); if (new_buf) { - if(!binlog_buf_uncompress((char *)m_rows_buf, (char *)new_buf, m_rows_cur - m_rows_buf, &un_len)) + if(!binlog_buf_uncompress((char *)m_rows_buf, (char *)new_buf, + m_rows_cur - m_rows_buf, &un_len)) { my_free(m_rows_buf); m_rows_buf = new_buf; @@ -10817,16 +10842,18 @@ bool Rows_log_event::write_compressed() uchar *m_rows_cur_tmp = m_rows_cur; bool ret = true; uint32 comlen, alloc_size; - comlen = alloc_size = binlog_get_compress_len(m_rows_cur_tmp - m_rows_buf_tmp); + comlen= alloc_size= binlog_get_compress_len(m_rows_cur_tmp - m_rows_buf_tmp); m_rows_buf = (uchar *)my_safe_alloca(alloc_size); - if(m_rows_buf && !binlog_buf_compress((const char *)m_rows_buf_tmp, (char *)m_rows_buf, m_rows_cur_tmp - m_rows_buf_tmp, &comlen)) + if(m_rows_buf && + !binlog_buf_compress((const char *)m_rows_buf_tmp, (char *)m_rows_buf, + m_rows_cur_tmp - m_rows_buf_tmp, &comlen)) { - m_rows_cur = comlen + m_rows_buf; - ret = Log_event::write(); + m_rows_cur= comlen + m_rows_buf; + ret= Log_event::write(); } my_safe_afree(m_rows_buf, alloc_size); - m_rows_buf = m_rows_buf_tmp; - m_rows_cur = m_rows_cur_tmp; + m_rows_buf= m_rows_buf_tmp; + m_rows_cur= m_rows_cur_tmp; return ret; } #endif @@ -11744,18 +11771,19 @@ Write_rows_log_event::Write_rows_log_event(THD *thd_arg, TABLE *tbl_arg, { } -Write_rows_compressed_log_event::Write_rows_compressed_log_event(THD *thd_arg, TABLE *tbl_arg, +Write_rows_compressed_log_event::Write_rows_compressed_log_event( + THD *thd_arg, + TABLE *tbl_arg, ulong tid_arg, bool is_transactional) : Write_rows_log_event(thd_arg, tbl_arg, tid_arg, is_transactional) { - //m_type = log_bin_use_v1_row_events ? WRITE_ROWS_COMPRESSED_EVENT_V1 : WRITE_ROWS_COMPRESSED_EVENT; m_type = WRITE_ROWS_COMPRESSED_EVENT_V1; } bool Write_rows_compressed_log_event::write() { - return Rows_log_event::write_compressed(); + return Rows_log_event::write_compressed(); } #endif @@ -11770,7 +11798,8 @@ Write_rows_log_event::Write_rows_log_event(const char *buf, uint event_len, { } -Write_rows_compressed_log_event::Write_rows_compressed_log_event(const char *buf, uint event_len, +Write_rows_compressed_log_event::Write_rows_compressed_log_event( + const char *buf, uint event_len, const Format_description_log_event *description_event) : Write_rows_log_event(buf, event_len, description_event) @@ -12269,21 +12298,25 @@ void Write_rows_log_event::print(FILE *file, PRINT_EVENT_INFO* print_event_info) Rows_log_event::print_helper(file, print_event_info, "Write_rows"); } -void Write_rows_compressed_log_event::print(FILE *file, PRINT_EVENT_INFO* print_event_info) +void Write_rows_compressed_log_event::print(FILE *file, + PRINT_EVENT_INFO* print_event_info) { char *new_buf; ulong len; bool is_malloc = false; - if(!row_log_event_uncompress(glob_description_event, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, + if(!row_log_event_uncompress(glob_description_event, + checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, temp_buf, NULL, 0, &is_malloc, &new_buf, &len)) { - free_temp_buf(); - register_temp_buf(new_buf, true); - Rows_log_event::print_helper(file, print_event_info, "Write_compressed_rows"); + free_temp_buf(); + register_temp_buf(new_buf, true); + Rows_log_event::print_helper(file, print_event_info, + "Write_compressed_rows"); } else { - my_b_printf(&print_event_info->head_cache, "ERROR: uncompress write_compressed_rows failed\n"); + my_b_printf(&print_event_info->head_cache, + "ERROR: uncompress write_compressed_rows failed\n"); } } #endif @@ -12471,7 +12504,7 @@ void issue_long_find_row_warning(Log_event_type type, if (delta > LONG_FIND_ROW_THRESHOLD) { rgi->set_long_find_row_note_printed(); - const char* evt_type= type == DELETE_ROWS_EVENT ? " DELETE" : "n UPDATE"; + const char* evt_type= LOG_EVENT_IS_DELETE_ROW(type) ? " DELETE" : "n UPDATE"; const char* scan_type= is_index_scan ? "scanning an index" : "scanning the table"; sql_print_information("The slave is applying a ROW event on behalf of a%s statement " @@ -12807,18 +12840,18 @@ Delete_rows_log_event::Delete_rows_log_event(THD *thd_arg, TABLE *tbl_arg, { } -Delete_rows_compressed_log_event::Delete_rows_compressed_log_event(THD *thd_arg, TABLE *tbl_arg, +Delete_rows_compressed_log_event::Delete_rows_compressed_log_event( + THD *thd_arg, TABLE *tbl_arg, ulong tid_arg, bool is_transactional) : Delete_rows_log_event(thd_arg, tbl_arg, tid_arg, is_transactional) { - //m_type = log_bin_use_v1_row_events ? DELETE_ROWS_COMPRESSED_EVENT_V1 : DELETE_ROWS_COMPRESSED_EVENT; - m_type = DELETE_ROWS_COMPRESSED_EVENT_V1; + m_type= DELETE_ROWS_COMPRESSED_EVENT_V1; } bool Delete_rows_compressed_log_event::write() { - return Rows_log_event::write_compressed(); + return Rows_log_event::write_compressed(); } #endif /* #if !defined(MYSQL_CLIENT) */ @@ -12833,7 +12866,8 @@ Delete_rows_log_event::Delete_rows_log_event(const char *buf, uint event_len, { } -Delete_rows_compressed_log_event::Delete_rows_compressed_log_event(const char *buf, uint event_len, +Delete_rows_compressed_log_event::Delete_rows_compressed_log_event( + const char *buf, uint event_len, const Format_description_log_event *description_event) : Delete_rows_log_event(buf, event_len, description_event) @@ -12944,16 +12978,19 @@ void Delete_rows_compressed_log_event::print(FILE *file, char *new_buf; ulong len; bool is_malloc = false; - if(!row_log_event_uncompress(glob_description_event, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, + if(!row_log_event_uncompress(glob_description_event, + checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, temp_buf, NULL, 0, &is_malloc, &new_buf, &len)) { - free_temp_buf(); - register_temp_buf(new_buf, true); - Rows_log_event::print_helper(file, print_event_info, "Delete_compressed_rows"); + free_temp_buf(); + register_temp_buf(new_buf, true); + Rows_log_event::print_helper(file, print_event_info, + "Delete_compressed_rows"); } else { - my_b_printf(&print_event_info->head_cache, "ERROR: uncompress delete_compressed_rows failed\n"); + my_b_printf(&print_event_info->head_cache, + "ERROR: uncompress delete_compressed_rows failed\n"); } } #endif @@ -12988,13 +13025,12 @@ Update_rows_compressed_log_event::Update_rows_compressed_log_event(THD *thd_arg, bool is_transactional) : Update_rows_log_event(thd_arg, tbl_arg, tid, is_transactional) { - //m_type = log_bin_use_v1_row_events ? UPDATE_ROWS_COMPRESSED_EVENT_V1 : UPDATE_ROWS_COMPRESSED_EVENT; m_type = UPDATE_ROWS_COMPRESSED_EVENT_V1; } bool Update_rows_compressed_log_event::write() { - return Rows_log_event::write_compressed(); + return Rows_log_event::write_compressed(); } void Update_rows_log_event::init(MY_BITMAP const *cols) @@ -13036,12 +13072,13 @@ Update_rows_log_event::Update_rows_log_event(const char *buf, uint event_len, { } -Update_rows_compressed_log_event::Update_rows_compressed_log_event(const char *buf, uint event_len, +Update_rows_compressed_log_event::Update_rows_compressed_log_event( + const char *buf, uint event_len, const Format_description_log_event *description_event) : Update_rows_log_event(buf, event_len, description_event) { - uncompress_buf(); + uncompress_buf(); } #endif @@ -13200,17 +13237,20 @@ void Update_rows_compressed_log_event::print(FILE *file, PRINT_EVENT_INFO *print { char *new_buf; ulong len; - bool is_malloc = false; - if(!row_log_event_uncompress(glob_description_event, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, + bool is_malloc= false; + if(!row_log_event_uncompress(glob_description_event, + checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, temp_buf, NULL, 0, &is_malloc, &new_buf, &len)) { - free_temp_buf(); - register_temp_buf(new_buf, true); - Rows_log_event::print_helper(file, print_event_info, "Update_compressed_rows"); + free_temp_buf(); + register_temp_buf(new_buf, true); + Rows_log_event::print_helper(file, print_event_info, + "Update_compressed_rows"); } else { - my_b_printf(&print_event_info->head_cache, "ERROR: uncompress update_compressed_rows failed\n"); + my_b_printf(&print_event_info->head_cache, + "ERROR: uncompress update_compressed_rows failed\n"); } } #endif diff --git a/sql/log_event.h b/sql/log_event.h index 59e4dcd852711..7ac21e379bbd2 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -694,6 +694,11 @@ enum Log_event_type /* Compressed binlog event. + + Note that the order between WRITE/UPDATE/DELETE events is significant; + this is so that we can convert from the compressed to the uncompressed + event type with (type-WRITE_ROWS_COMPRESSED_EVENT + WRITE_ROWS_EVENT) + and similar for _V1. */ QUERY_COMPRESSED_EVENT = 165, WRITE_ROWS_COMPRESSED_EVENT_V1 = 166, @@ -708,15 +713,52 @@ enum Log_event_type ENUM_END_EVENT /* end marker */ }; -#define LOG_EVENT_IS_QUERY(type) (type == QUERY_EVENT || type == QUERY_COMPRESSED_EVENT) -#define LOG_EVENT_IS_WRITE_ROW(type) (type == WRITE_ROWS_EVENT || type == WRITE_ROWS_EVENT_V1 || type == WRITE_ROWS_COMPRESSED_EVENT || type == WRITE_ROWS_COMPRESSED_EVENT_V1) -#define LOG_EVENT_IS_UPDATE_ROW(type) (type == UPDATE_ROWS_EVENT || type == UPDATE_ROWS_EVENT_V1 || type == UPDATE_ROWS_COMPRESSED_EVENT || type == UPDATE_ROWS_COMPRESSED_EVENT_V1) -#define LOG_EVENT_IS_DELETE_ROW(type) (type == DELETE_ROWS_EVENT || type == DELETE_ROWS_EVENT_V1 || type == DELETE_ROWS_COMPRESSED_EVENT || type == DELETE_ROWS_COMPRESSED_EVENT_V1) -#define LOG_EVENT_IS_ROW_COMPRESSED(type) (type == WRITE_ROWS_COMPRESSED_EVENT || type == WRITE_ROWS_COMPRESSED_EVENT_V1 ||\ - type == UPDATE_ROWS_COMPRESSED_EVENT || type == UPDATE_ROWS_COMPRESSED_EVENT_V1 ||\ - type == DELETE_ROWS_COMPRESSED_EVENT || type == DELETE_ROWS_COMPRESSED_EVENT_V1) -#define LOG_EVENT_IS_ROW_V2(type) (type >= WRITE_ROWS_EVENT && type <= DELETE_ROWS_EVENT || \ - type >= WRITE_ROWS_COMPRESSED_EVENT && type <= DELETE_ROWS_COMPRESSED_EVENT ) +static inline bool LOG_EVENT_IS_QUERY(enum Log_event_type type) +{ + return type == QUERY_EVENT || type == QUERY_COMPRESSED_EVENT; +} + + +static inline bool LOG_EVENT_IS_WRITE_ROW(enum Log_event_type type) +{ + return type == WRITE_ROWS_EVENT || type == WRITE_ROWS_EVENT_V1 || + type == WRITE_ROWS_COMPRESSED_EVENT || + type == WRITE_ROWS_COMPRESSED_EVENT_V1; +} + + +static inline bool LOG_EVENT_IS_UPDATE_ROW(enum Log_event_type type) +{ + return type == UPDATE_ROWS_EVENT || type == UPDATE_ROWS_EVENT_V1 || + type == UPDATE_ROWS_COMPRESSED_EVENT || + type == UPDATE_ROWS_COMPRESSED_EVENT_V1; +} + + +static inline bool LOG_EVENT_IS_DELETE_ROW(enum Log_event_type type) +{ + return type == DELETE_ROWS_EVENT || type == DELETE_ROWS_EVENT_V1 || + type == DELETE_ROWS_COMPRESSED_EVENT || + type == DELETE_ROWS_COMPRESSED_EVENT_V1; +} + + +static inline bool LOG_EVENT_IS_ROW_COMPRESSED(enum Log_event_type type) +{ + return type == WRITE_ROWS_COMPRESSED_EVENT || + type == WRITE_ROWS_COMPRESSED_EVENT_V1 || + type == UPDATE_ROWS_COMPRESSED_EVENT || + type == UPDATE_ROWS_COMPRESSED_EVENT_V1 || + type == DELETE_ROWS_COMPRESSED_EVENT || + type == DELETE_ROWS_COMPRESSED_EVENT_V1; +} + + +static inline bool LOG_EVENT_IS_ROW_V2(enum Log_event_type type) +{ + return (type >= WRITE_ROWS_EVENT && type <= DELETE_ROWS_EVENT) || + (type >= WRITE_ROWS_COMPRESSED_EVENT && type <= DELETE_ROWS_COMPRESSED_EVENT); +} /* diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index eeb96d8608a50..ec5ea7254871e 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -645,7 +645,7 @@ is_group_ending(Log_event *ev, Log_event_type event_type) { if (event_type == XID_EVENT) return 1; - if (event_type == QUERY_EVENT) + if (event_type == QUERY_EVENT) // COMMIT/ROLLBACK are never compressed { Query_log_event *qev = (Query_log_event *)ev; if (qev->is_commit()) @@ -2511,7 +2511,7 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev, { DBUG_ASSERT(rli->gtid_skip_flag == GTID_SKIP_TRANSACTION); if (typ == XID_EVENT || - (typ == QUERY_EVENT && + (typ == QUERY_EVENT && // COMMIT/ROLLBACK are never compressed (((Query_log_event *)ev)->is_commit() || ((Query_log_event *)ev)->is_rollback()))) rli->gtid_skip_flag= GTID_SKIP_NOT; diff --git a/sql/slave.cc b/sql/slave.cc index 62eb24da14cc3..8f0db28b8583c 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -6153,8 +6153,10 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) */ case QUERY_COMPRESSED_EVENT: inc_pos= event_len; - if (query_event_uncompress(rli->relay_log.description_event_for_queue, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, - buf, new_buf_arr, sizeof(new_buf_arr), &is_malloc, (char **)&new_buf, &event_len)) + if (query_event_uncompress(rli->relay_log.description_event_for_queue, + checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, + buf, new_buf_arr, sizeof(new_buf_arr), + &is_malloc, (char **)&new_buf, &event_len)) { char llbuf[22]; error = ER_BINLOG_UNCOMPRESS_ERROR; @@ -6175,8 +6177,10 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) case DELETE_ROWS_COMPRESSED_EVENT_V1: inc_pos = event_len; { - if (row_log_event_uncompress(rli->relay_log.description_event_for_queue, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, - buf, new_buf_arr, sizeof(new_buf_arr), &is_malloc, (char **)&new_buf, &event_len)) + if (row_log_event_uncompress(rli->relay_log.description_event_for_queue, + checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, + buf, new_buf_arr, sizeof(new_buf_arr), + &is_malloc, (char **)&new_buf, &event_len)) { char llbuf[22]; error = ER_BINLOG_UNCOMPRESS_ERROR; @@ -6207,7 +6211,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) DBUG_EXECUTE_IF("kill_slave_io_after_2_events", { if (mi->dbug_do_disconnect && - (LOG_EVENT_IS_QUERY((uchar)buf[EVENT_TYPE_OFFSET]) || + (LOG_EVENT_IS_QUERY((Log_event_type)(uchar)buf[EVENT_TYPE_OFFSET]) || ((uchar)buf[EVENT_TYPE_OFFSET] == TABLE_MAP_EVENT)) && (--mi->dbug_event_counter == 0)) { diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc index d92ac15822f6e..94619f14b8bda 100644 --- a/sql/sql_binlog.cc +++ b/sql/sql_binlog.cc @@ -82,6 +82,12 @@ static int check_event_type(int type, Relay_log_info *rli) case PRE_GA_WRITE_ROWS_EVENT: case PRE_GA_UPDATE_ROWS_EVENT: case PRE_GA_DELETE_ROWS_EVENT: + case WRITE_ROWS_COMPRESSED_EVENT_V1: + case UPDATE_ROWS_COMPRESSED_EVENT_V1: + case DELETE_ROWS_COMPRESSED_EVENT_V1: + case WRITE_ROWS_COMPRESSED_EVENT: + case UPDATE_ROWS_COMPRESSED_EVENT: + case DELETE_ROWS_COMPRESSED_EVENT: /* Row events are only allowed if a Format_description_event has already been seen. diff --git a/sql/sql_class.cc b/sql/sql_class.cc index a741a0f6d0144..2785c4682ea71 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -6961,7 +6961,6 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, flush the pending rows event if necessary. */ { - Log_event* ev = NULL; int error = 0; /* From be78eec30a881c91d3ccedc4812b3ff0755342b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sat, 9 Jul 2016 18:48:56 +0300 Subject: [PATCH 05/71] MDEV-6284: Rename .files -> .install --- CMakeLists.txt | 4 ++-- ...ibmariadbclient-dev.files => libmariadbclient-dev.install} | 0 .../{libmariadbclient18.files => libmariadbclient18.install} | 0 debian/{libmariadbd-dev.files => libmariadbd-dev.install} | 0 ...{mariadb-client-10.2.files => mariadb-client-10.2.install} | 0 ...lient-core-10.2.files => mariadb-client-core-10.2.install} | 0 debian/{mariadb-common.files => mariadb-common.install} | 0 ...-engine-10.2.files => mariadb-connect-engine-10.2.install} | 0 ...0.2.files => mariadb-cracklib-password-check-10.2.install} | 0 ...i-client-10.2.files => mariadb-gssapi-client-10.2.install} | 0 ...i-server-10.2.files => mariadb-gssapi-server-10.2.install} | 0 ...-engine-10.2.files => mariadb-oqgraph-engine-10.2.install} | 0 ...db-server-10.2.files.in => mariadb-server-10.2.install.in} | 0 ...erver-core-10.2.files => mariadb-server-core-10.2.install} | 0 debian/{mariadb-test-10.2.files => mariadb-test-10.2.install} | 0 debian/{mysql-common.files => mysql-common.install} | 0 16 files changed, 2 insertions(+), 2 deletions(-) rename debian/{libmariadbclient-dev.files => libmariadbclient-dev.install} (100%) rename debian/{libmariadbclient18.files => libmariadbclient18.install} (100%) rename debian/{libmariadbd-dev.files => libmariadbd-dev.install} (100%) rename debian/{mariadb-client-10.2.files => mariadb-client-10.2.install} (100%) rename debian/{mariadb-client-core-10.2.files => mariadb-client-core-10.2.install} (100%) rename debian/{mariadb-common.files => mariadb-common.install} (100%) rename debian/{mariadb-connect-engine-10.2.files => mariadb-connect-engine-10.2.install} (100%) rename debian/{mariadb-cracklib-password-check-10.2.files => mariadb-cracklib-password-check-10.2.install} (100%) rename debian/{mariadb-gssapi-client-10.2.files => mariadb-gssapi-client-10.2.install} (100%) rename debian/{mariadb-gssapi-server-10.2.files => mariadb-gssapi-server-10.2.install} (100%) rename debian/{mariadb-oqgraph-engine-10.2.files => mariadb-oqgraph-engine-10.2.install} (100%) rename debian/{mariadb-server-10.2.files.in => mariadb-server-10.2.install.in} (100%) rename debian/{mariadb-server-core-10.2.files => mariadb-server-core-10.2.install} (100%) rename debian/{mariadb-test-10.2.files => mariadb-test-10.2.install} (100%) rename debian/{mysql-common.files => mysql-common.install} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index d0e5cf874759b..54b3cbee939e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -437,8 +437,8 @@ CONFIGURE_FILE( IF(DEB) CONFIGURE_FILE( - ${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.2.files.in - ${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.2.files) + ${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.2.install.in + ${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.2.install) ENDIF(DEB) # Handle the "INFO_*" files. diff --git a/debian/libmariadbclient-dev.files b/debian/libmariadbclient-dev.install similarity index 100% rename from debian/libmariadbclient-dev.files rename to debian/libmariadbclient-dev.install diff --git a/debian/libmariadbclient18.files b/debian/libmariadbclient18.install similarity index 100% rename from debian/libmariadbclient18.files rename to debian/libmariadbclient18.install diff --git a/debian/libmariadbd-dev.files b/debian/libmariadbd-dev.install similarity index 100% rename from debian/libmariadbd-dev.files rename to debian/libmariadbd-dev.install diff --git a/debian/mariadb-client-10.2.files b/debian/mariadb-client-10.2.install similarity index 100% rename from debian/mariadb-client-10.2.files rename to debian/mariadb-client-10.2.install diff --git a/debian/mariadb-client-core-10.2.files b/debian/mariadb-client-core-10.2.install similarity index 100% rename from debian/mariadb-client-core-10.2.files rename to debian/mariadb-client-core-10.2.install diff --git a/debian/mariadb-common.files b/debian/mariadb-common.install similarity index 100% rename from debian/mariadb-common.files rename to debian/mariadb-common.install diff --git a/debian/mariadb-connect-engine-10.2.files b/debian/mariadb-connect-engine-10.2.install similarity index 100% rename from debian/mariadb-connect-engine-10.2.files rename to debian/mariadb-connect-engine-10.2.install diff --git a/debian/mariadb-cracklib-password-check-10.2.files b/debian/mariadb-cracklib-password-check-10.2.install similarity index 100% rename from debian/mariadb-cracklib-password-check-10.2.files rename to debian/mariadb-cracklib-password-check-10.2.install diff --git a/debian/mariadb-gssapi-client-10.2.files b/debian/mariadb-gssapi-client-10.2.install similarity index 100% rename from debian/mariadb-gssapi-client-10.2.files rename to debian/mariadb-gssapi-client-10.2.install diff --git a/debian/mariadb-gssapi-server-10.2.files b/debian/mariadb-gssapi-server-10.2.install similarity index 100% rename from debian/mariadb-gssapi-server-10.2.files rename to debian/mariadb-gssapi-server-10.2.install diff --git a/debian/mariadb-oqgraph-engine-10.2.files b/debian/mariadb-oqgraph-engine-10.2.install similarity index 100% rename from debian/mariadb-oqgraph-engine-10.2.files rename to debian/mariadb-oqgraph-engine-10.2.install diff --git a/debian/mariadb-server-10.2.files.in b/debian/mariadb-server-10.2.install.in similarity index 100% rename from debian/mariadb-server-10.2.files.in rename to debian/mariadb-server-10.2.install.in diff --git a/debian/mariadb-server-core-10.2.files b/debian/mariadb-server-core-10.2.install similarity index 100% rename from debian/mariadb-server-core-10.2.files rename to debian/mariadb-server-core-10.2.install diff --git a/debian/mariadb-test-10.2.files b/debian/mariadb-test-10.2.install similarity index 100% rename from debian/mariadb-test-10.2.files rename to debian/mariadb-test-10.2.install diff --git a/debian/mysql-common.files b/debian/mysql-common.install similarity index 100% rename from debian/mysql-common.files rename to debian/mysql-common.install From 148422ef6117e9588ccc78cbb5d4a93248672136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sat, 9 Jul 2016 18:51:08 +0300 Subject: [PATCH 06/71] MDEV-6284: Bump compat level and define native Debian format Compat level needs to match the debhelper version in Debian. Debian wheezy has 9, so there is no need to stay on ancient level 5. --- debian/compat | 2 +- debian/patches/{00list => series} | 0 debian/source/format | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) rename debian/patches/{00list => series} (100%) create mode 100644 debian/source/format diff --git a/debian/compat b/debian/compat index 7ed6ff82de6bc..ec635144f6004 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/debian/patches/00list b/debian/patches/series similarity index 100% rename from debian/patches/00list rename to debian/patches/series diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000000000..89ae9db8f88b8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) From a59655a347787d4d88b14619371aa31a667cf916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sat, 9 Jul 2016 22:03:02 +0300 Subject: [PATCH 07/71] MDEV-6284: Remove Debian policy breaking and empty RELEASE_* variables --- debian/autobake-deb.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index 5259a4fe152a9..7368bfcfc20c7 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -27,9 +27,6 @@ export MARIADB_OPTIONAL_DEBS="" # source ./VERSION UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}" -RELEASE_EXTRA="" - -RELEASE_NAME="" PATCHLEVEL="+maria" LOGSTRING="MariaDB build" @@ -69,9 +66,9 @@ fi # echo "Incrementing changelog and starting build scripts" -dch -b -D ${CODENAME} -v "${UPSTREAM}${PATCHLEVEL}-${RELEASE_NAME}${RELEASE_EXTRA:+-${RELEASE_EXTRA}}1~${CODENAME}" "Automatic build with ${LOGSTRING}." +dch -b -D ${CODENAME} -v "${UPSTREAM}${PATCHLEVEL}~${CODENAME}" "Automatic build with ${LOGSTRING}." -echo "Creating package version ${UPSTREAM}${PATCHLEVEL}-${RELEASE_NAME}${RELEASE_EXTRA:+-${RELEASE_EXTRA}}1~${CODENAME} ... " +echo "Creating package version ${UPSTREAM}${PATCHLEVEL}~${CODENAME} ... " # Build the package. # Pass -I so that .git and other unnecessary temporary and source control files From 73f1c655ada90ea58dec2440b6ab22736830db17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sun, 9 Oct 2016 23:39:01 +0300 Subject: [PATCH 08/71] MDEV-6284: Import most of downstream Debian packaging These changes update the contents and behaviour of current packages to match the current packaging in Debian official repos. Keep mtr test scope small. Updating maintainer scripts also required regenerating the translations. Rules based on modern dh_* buildtools. Update control file with new Debian conventions: - Provide virtual-mysql-* virtual packages - Recommends perl modules instead of Depends --- debian/additions/debian-start | 13 +- debian/additions/debian-start.inc.sh | 21 +- debian/additions/echo_stderr | 0 debian/control | 24 +- debian/libmariadbclient-dev.README.Maintainer | 1 - debian/libmariadbclient-dev.install | 7 +- debian/libmariadbclient-dev.manpages | 1 + debian/libmariadbclient18.install | 2 +- debian/libmariadbd-dev.install | 4 +- debian/libmariadbd18.install | 1 + debian/mariadb-client-10.2.README.Debian | 2 +- debian/mariadb-client-10.2.install | 23 +- debian/mariadb-client-10.2.manpages | 12 + debian/mariadb-client-10.2.menu | 4 +- debian/mariadb-client-core-10.2.install | 2 - debian/mariadb-client-core-10.2.manpages | 2 + debian/mariadb-common.install | 2 +- debian/mariadb-server-10.2.config | 9 +- debian/mariadb-server-10.2.dirs | 9 - debian/mariadb-server-10.2.install.in | 27 +- debian/mariadb-server-10.2.manpages | 25 ++ ...mariadb-server-10.2.mysql-server.logrotate | 5 +- debian/mariadb-server-10.2.mysql.default | 8 + debian/mariadb-server-10.2.mysql.init | 216 ++++++------ debian/mariadb-server-10.2.postinst | 114 ++++--- debian/mariadb-server-10.2.postrm | 42 +-- debian/mariadb-server-10.2.preinst | 136 +++++--- debian/mariadb-server-10.2.prerm | 4 +- debian/mariadb-server-10.2.templates | 27 +- debian/mariadb-server-core-10.2.install | 3 +- debian/mariadb-server-core-10.2.manpages | 3 + debian/mysql-common.install | 4 +- debian/po/ar.po | 108 +++--- debian/po/ca.po | 78 ++--- debian/po/cs.po | 104 +++--- debian/po/da.po | 106 +++--- debian/po/de.po | 100 +++--- debian/po/es.po | 107 +++--- debian/po/eu.po | 106 +++--- debian/po/fr.po | 97 +++--- debian/po/gl.po | 106 +++--- debian/po/it.po | 99 +++--- debian/po/ja.po | 99 +++--- debian/po/nb.po | 114 ++++--- debian/po/nl.po | 116 ++++--- debian/po/pt.po | 107 +++--- debian/po/pt_BR.po | 108 +++--- debian/po/ro.po | 114 ++++--- debian/po/ru.po | 97 +++--- debian/po/sv.po | 100 +++--- debian/po/templates.pot | 60 ++-- debian/po/tr.po | 78 ++--- debian/rules | 318 ++++++------------ 53 files changed, 1603 insertions(+), 1472 deletions(-) mode change 100644 => 100755 debian/additions/debian-start mode change 100644 => 100755 debian/additions/debian-start.inc.sh mode change 100644 => 100755 debian/additions/echo_stderr create mode 100644 debian/libmariadbclient-dev.manpages create mode 100644 debian/libmariadbd18.install create mode 100644 debian/mariadb-client-10.2.manpages create mode 100644 debian/mariadb-client-core-10.2.manpages create mode 100644 debian/mariadb-server-10.2.manpages create mode 100644 debian/mariadb-server-10.2.mysql.default create mode 100644 debian/mariadb-server-core-10.2.manpages diff --git a/debian/additions/debian-start b/debian/additions/debian-start old mode 100644 new mode 100755 index 9fd0030d0eccd..dea22c48f767e --- a/debian/additions/debian-start +++ b/debian/additions/debian-start @@ -1,27 +1,32 @@ #!/bin/bash # # This script is executed by "/etc/init.d/mysql" on every (re)start. -# +# # Changes to this file will be preserved when updating the Debian package. # source /usr/share/mysql/debian-start.inc.sh +if [ -f /etc/default/mysql ]; then + . /etc/default/mysql +fi + MYSQL="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf" MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" MYUPGRADE="/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf" MYCHECK="/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf" MYCHECK_SUBJECT="WARNING: mysqlcheck has found corrupt tables" MYCHECK_PARAMS="--all-databases --fast --silent" -MYCHECK_RCPT="root" +MYCHECK_RCPT="${MYCHECK_RCPT:-root}" + +## Checking for corrupt, not cleanly closed (only for MyISAM and Aria engines) and upgrade needing tables. # The following commands should be run when the server is up but in background # where they do not block the server start and in one shell instance so that # they run sequentially. They are supposed not to echo anything to stdout. # If you want to disable the check for crashed tables comment -# "check_for_crashed_tables" out. +# "check_for_crashed_tables" out. # (There may be no output to stdout inside the background process!) -echo "Checking for corrupt, not cleanly closed and upgrade needing tables." # Need to ignore SIGHUP, as otherwise a SIGHUP can sometimes abort the upgrade # process in the middle. diff --git a/debian/additions/debian-start.inc.sh b/debian/additions/debian-start.inc.sh old mode 100644 new mode 100755 index f50712882c12d..cfe519366136c --- a/debian/additions/debian-start.inc.sh +++ b/debian/additions/debian-start.inc.sh @@ -3,7 +3,7 @@ # This file is included by /etc/mysql/debian-start # -## Check all unclosed tables. +## Check MyISAM and Aria unclosed tables. # - Requires the server to be up. # - Is supposed to run silently in background. function check_for_crashed_tables() { @@ -11,20 +11,27 @@ function check_for_crashed_tables() { set -u # But do it in the background to not stall the boot process. - logger -p daemon.info -i -t$0 "Triggering myisam-recover for all MyISAM tables" + logger -p daemon.info -i -t$0 "Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables" # Checking for $? is unreliable so the size of the output is checked. # Some table handlers like HEAP do not support CHECK TABLE. tempfile=`tempfile` - # We have to use xargs in this case, because a for loop barfs on the - # spaces in the thing to be looped over. + + # We have to use xargs in this case, because a for loop barfs on the + # spaces in the thing to be looped over. + + # If a crashed table is encountered, the "mysql" command will return with a status different from 0 + set +e + LC_ALL=C $MYSQL --skip-column-names --batch -e ' select concat('\''select count(*) into @discard from `'\'', TABLE_SCHEMA, '\''`.`'\'', TABLE_NAME, '\''`'\'') - from information_schema.TABLES where ENGINE='\''MyISAM'\' | \ + from information_schema.TABLES where TABLE_SCHEMA<>'\''INFORMATION_SCHEMA'\'' and TABLE_SCHEMA<>'\''PERFORMANCE_SCHEMA'\'' and ( ENGINE='\''MyISAM'\'' or ENGINE='\''Aria'\'' )' | \ xargs -i $MYSQL --skip-column-names --silent --batch \ - --force -e "{}" >$tempfile - if [ -s $tempfile ]; then + --force -e "{}" &>$tempfile + set -e + + if [ -s "$tempfile" ]; then ( /bin/echo -e "\n" \ "Improperly closed tables are also reported if clients are accessing\n" \ diff --git a/debian/additions/echo_stderr b/debian/additions/echo_stderr old mode 100644 new mode 100755 diff --git a/debian/control b/debian/control index 1941b84c1485b..588f7d4e0ee07 100644 --- a/debian/control +++ b/debian/control @@ -71,9 +71,10 @@ Description: Virtual package to satisfy external depends Package: libmariadbd-dev Architecture: any Section: libdevel -Depends: libmariadbclient-dev (>= ${binary:Version}), ${misc:Depends} Provides: libmysqld-dev -Conflicts: libmysqld-dev +Pre-Depends: ${misc:Pre-Depends} +Depends: libmariadbd18 (= ${binary:Version}), libmariadbclient-dev (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} +Breaks: libmysqld-dev Replaces: libmysqld-dev Description: MariaDB embedded database, development files MariaDB is a fast, stable and true multi-user, multi-threaded SQL database @@ -81,7 +82,7 @@ Description: MariaDB embedded database, development files language in the world. The main goals of MariaDB are speed, robustness and ease of use. . - This package includes the embedded server library and header files. + This package includes the embedded server library development and header files. Package: libmariadbclient-dev Architecture: any @@ -193,15 +194,12 @@ Description: MariaDB database core client binaries Package: mariadb-client-10.2 Architecture: any Depends: debianutils (>=1.6), - libdbd-mysql-perl (>= 1.2202), - libdbi-perl, libmariadbclient18 (>= ${source:Version}), mariadb-client-core-10.2 (>= ${source:Version}), mariadb-common, ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends} -Suggests: libterm-readkey-perl Provides: mysql-client, mysql-client-4.1, mysql-client-5.1, @@ -234,6 +232,9 @@ Replaces: mariadb-client (<< ${source:Version}), mysql-client-5.5, mysql-client-5.6, virtual-mysql-client +Recommends: libdbd-mysql-perl (>= 1.2202), + libdbi-perl, + libterm-readkey-perl Description: MariaDB database client binaries MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -322,8 +323,11 @@ Package: mariadb-server-10.2 Architecture: any Suggests: mailx, mariadb-test, netcat-openbsd, tinyca Recommends: libhtml-template-perl -Pre-Depends: mariadb-common, adduser (>= 3.40), debconf -Depends: galera-3 (>=25.3), +Pre-Depends: adduser (>= 3.40), debconf, mariadb-common (>= ${source:Version}) +Depends: bsdutils, + coreutils, + findutils, + galera-3 (>=25.3), gawk, iproute, libdbi-perl, @@ -383,7 +387,7 @@ Description: MariaDB database server binaries Package: mariadb-server Architecture: all -Depends: mariadb-server-10.2 (= ${source:Version}), ${misc:Depends} +Depends: mariadb-server-10.2 (>= ${source:Version}), ${misc:Depends} Description: MariaDB database server (metapackage depending on the latest version) This is an empty package that depends on the current "best" version of mariadb-server (currently mariadb-server-10.2), as determined by the MariaDB @@ -398,7 +402,7 @@ Description: MariaDB database server (metapackage depending on the latest versio Package: mariadb-client Architecture: all -Depends: mariadb-client-10.2 (= ${source:Version}), ${misc:Depends} +Depends: mariadb-client-10.2 (>= ${source:Version}), ${misc:Depends} Description: MariaDB database client (metapackage depending on the latest version) This is an empty package that depends on the current "best" version of mariadb-client (currently mariadb-client-10.2), as determined by the MariaDB diff --git a/debian/libmariadbclient-dev.README.Maintainer b/debian/libmariadbclient-dev.README.Maintainer index f24cdcd519d60..99e1c662c146a 100644 --- a/debian/libmariadbclient-dev.README.Maintainer +++ b/debian/libmariadbclient-dev.README.Maintainer @@ -1,4 +1,3 @@ The examples directory includes files that might be needed by some developers: -- header files not installed by default - the example file udf_example.c diff --git a/debian/libmariadbclient-dev.install b/debian/libmariadbclient-dev.install index 77260e88d1cc4..51bcb6db94dc1 100644 --- a/debian/libmariadbclient-dev.install +++ b/debian/libmariadbclient-dev.install @@ -1,8 +1,9 @@ usr/bin/mysql_config -usr/include/mysql +usr/include/mysql/* usr/include/mariadb -usr/lib/mariadb/libmariadbclient.a -usr/lib/libmysqlservices.a +usr/lib/*/libmariadb.so +usr/lib/*/libmariadbclient.a +usr/lib/*/libmysqlservices.a usr/share/aclocal/mysql.m4 usr/share/pkgconfig/mariadb.pc usr/share/man/man1/mysql_config.1 diff --git a/debian/libmariadbclient-dev.manpages b/debian/libmariadbclient-dev.manpages new file mode 100644 index 0000000000000..3aac7f4b4a92c --- /dev/null +++ b/debian/libmariadbclient-dev.manpages @@ -0,0 +1 @@ +debian/tmp/usr/share/man/man1/mysql_config.1 diff --git a/debian/libmariadbclient18.install b/debian/libmariadbclient18.install index dfef3d26d0af7..1cb8681244e4b 100644 --- a/debian/libmariadbclient18.install +++ b/debian/libmariadbclient18.install @@ -1,3 +1,3 @@ usr/lib/mariadb/libmariadb.so.* -usr/lib/mysql/plugin/mysql_clear_password.so usr/lib/mysql/plugin/dialog.so +usr/lib/mysql/plugin/mysql_clear_password.so diff --git a/debian/libmariadbd-dev.install b/debian/libmariadbd-dev.install index 26cb8d0a606df..4608bf6e838cc 100644 --- a/debian/libmariadbd-dev.install +++ b/debian/libmariadbd-dev.install @@ -1,2 +1,2 @@ -usr/lib/mysql/*.a -usr/lib/mysql/*.la +usr/lib/*/libmysqld.a +usr/lib/*/libmysqld.so diff --git a/debian/libmariadbd18.install b/debian/libmariadbd18.install new file mode 100644 index 0000000000000..9ae9f9e172125 --- /dev/null +++ b/debian/libmariadbd18.install @@ -0,0 +1 @@ +usr/lib/*/libmysqld.so.18 diff --git a/debian/mariadb-client-10.2.README.Debian b/debian/mariadb-client-10.2.README.Debian index 64f0f50995107..b245638f9c95c 100644 --- a/debian/mariadb-client-10.2.README.Debian +++ b/debian/mariadb-client-10.2.README.Debian @@ -1,4 +1,4 @@ FAQ: -Q: My completion is gone, why? +Q: My completition is gone, why? A: You have "no-auto-rehash" in the "[mysql]" section of /etc/mysql/my.cnf! diff --git a/debian/mariadb-client-10.2.install b/debian/mariadb-client-10.2.install index 95e788dc8d80c..271f2a2f417ec 100644 --- a/debian/mariadb-client-10.2.install +++ b/debian/mariadb-client-10.2.install @@ -1,25 +1,12 @@ -usr/bin/innochecksum -usr/bin/innotop +debian/additions/innotop/innotop usr/bin/ +debian/additions/mysqlreport usr/bin/ +usr/bin/mysql_find_rows +usr/bin/mysql_fix_extensions +usr/bin/mysql_waitpid usr/bin/mysqlaccess usr/bin/mysqladmin usr/bin/mysqldump usr/bin/mysqldumpslow -usr/bin/mysql_find_rows -usr/bin/mysql_fix_extensions usr/bin/mysqlimport -usr/bin/mysqlreport usr/bin/mysqlshow usr/bin/mysqlslap -usr/bin/mysql_waitpid -usr/share/man/man1/innotop.1 -usr/share/man/man1/mysqlaccess.1 -usr/share/man/man1/mysqladmin.1 -usr/share/man/man1/mysqldump.1 -usr/share/man/man1/mysqldumpslow.1 -usr/share/man/man1/mysql_find_rows.1 -usr/share/man/man1/mysql_fix_extensions.1 -usr/share/man/man1/mysqlimport.1 -usr/share/man/man1/mysqlreport.1 -usr/share/man/man1/mysqlshow.1 -usr/share/man/man1/mysqlslap.1 -usr/share/man/man1/mysql_waitpid.1 diff --git a/debian/mariadb-client-10.2.manpages b/debian/mariadb-client-10.2.manpages new file mode 100644 index 0000000000000..504619785bcd2 --- /dev/null +++ b/debian/mariadb-client-10.2.manpages @@ -0,0 +1,12 @@ +debian/additions/innotop/innotop.1 +debian/tmp/usr/share/man/man1/mysqlaccess.1 +debian/tmp/usr/share/man/man1/mysqladmin.1 +debian/tmp/usr/share/man/man1/mysqldump.1 +debian/tmp/usr/share/man/man1/mysqldumpslow.1 +debian/tmp/usr/share/man/man1/mysql_find_rows.1 +debian/tmp/usr/share/man/man1/mysql_fix_extensions.1 +debian/tmp/usr/share/man/man1/mysqlimport.1 +debian/additions/mysqlreport.1 +debian/tmp/usr/share/man/man1/mysqlshow.1 +debian/tmp/usr/share/man/man1/mysqlslap.1 +debian/tmp/usr/share/man/man1/mysql_waitpid.1 diff --git a/debian/mariadb-client-10.2.menu b/debian/mariadb-client-10.2.menu index 1378555c423f8..c08678536d1f8 100644 --- a/debian/mariadb-client-10.2.menu +++ b/debian/mariadb-client-10.2.menu @@ -1,3 +1,3 @@ # According to /usr/share/menu/ policy 1.4, not /usr/share/doc/debian-policy/ -?package(innotop):needs="text" section="Applications/Data Management"\ - title="innotop" command="/usr/bin/innotop" +?package(mariadb-client-10.2):needs="text" section="Applications/Data Management"\ + title="Innotop" command="/usr/bin/innotop" diff --git a/debian/mariadb-client-core-10.2.install b/debian/mariadb-client-core-10.2.install index a2781309439dd..6308d769930c2 100644 --- a/debian/mariadb-client-core-10.2.install +++ b/debian/mariadb-client-core-10.2.install @@ -1,4 +1,2 @@ usr/bin/mysql usr/bin/mysqlcheck -usr/share/man/man1/mysql.1 -usr/share/man/man1/mysqlcheck.1 diff --git a/debian/mariadb-client-core-10.2.manpages b/debian/mariadb-client-core-10.2.manpages new file mode 100644 index 0000000000000..2be91d81f9a7c --- /dev/null +++ b/debian/mariadb-client-core-10.2.manpages @@ -0,0 +1,2 @@ +debian/tmp/usr/share/man/man1/mysql.1 +debian/tmp/usr/share/man/man1/mysqlcheck.1 diff --git a/debian/mariadb-common.install b/debian/mariadb-common.install index f37e46c45fee7..78dbc22b9f69f 100644 --- a/debian/mariadb-common.install +++ b/debian/mariadb-common.install @@ -1 +1 @@ -etc/mysql/conf.d/mariadb.cnf +debian/additions/mariadb.cnf etc/mysql/conf.d diff --git a/debian/mariadb-server-10.2.config b/debian/mariadb-server-10.2.config index 162017caf71ba..44640f2a4415a 100644 --- a/debian/mariadb-server-10.2.config +++ b/debian/mariadb-server-10.2.config @@ -1,18 +1,17 @@ -#!/bin/bash -e +#!/bin/bash + +set -e . /usr/share/debconf/confmodule if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } -CNF=/etc/mysql/my.cnf - # Beware that there are two ypwhich one of them needs the 2>/dev/null! if test -n "`which ypwhich 2>/dev/null`" && ypwhich >/dev/null 2>&1; then - db_input high mysql-server-5.1/nis_warning || true + db_input high mariadb-server-10.0/nis_warning || true db_go fi - # only ask this question on fresh installs, during "reconfiguration" and when # not upgrading from an existing 5.0 installation. # there is also an additional check for empty root passwords in the diff --git a/debian/mariadb-server-10.2.dirs b/debian/mariadb-server-10.2.dirs index 037d669e833cb..5057fe806c3ab 100644 --- a/debian/mariadb-server-10.2.dirs +++ b/debian/mariadb-server-10.2.dirs @@ -1,10 +1 @@ -etc/init.d -etc/logrotate.d -etc/mysql/conf.d -usr/bin -usr/sbin -usr/share/man/man8 -usr/share/mysql -usr/share/doc/mariadb-server-10.2 -var/run/mysqld var/lib/mysql-upgrade diff --git a/debian/mariadb-server-10.2.install.in b/debian/mariadb-server-10.2.install.in index d4e8746f023d2..8caa4c3b001fa 100644 --- a/debian/mariadb-server-10.2.install.in +++ b/debian/mariadb-server-10.2.install.in @@ -14,16 +14,31 @@ usr/lib/mysql/plugin/query_cache_info.so usr/lib/mysql/plugin/query_response_time.so usr/lib/mysql/plugin/semisync_master.so usr/lib/mysql/plugin/semisync_slave.so +usr/lib/mysql/plugin/auth_pam.so +usr/lib/mysql/plugin/auth_socket.so +usr/lib/mysql/plugin/file_key_management.so +usr/lib/mysql/plugin/ha_archive.so +usr/lib/mysql/plugin/ha_blackhole.so +usr/lib/mysql/plugin/ha_federated.so +usr/lib/mysql/plugin/ha_federatedx.so +usr/lib/mysql/plugin/ha_mroonga.so +usr/lib/mysql/plugin/ha_sphinx.so +usr/lib/mysql/plugin/handlersocket.so +usr/lib/mysql/plugin/locales.so +usr/lib/mysql/plugin/metadata_lock_info.so +usr/lib/mysql/plugin/query_cache_info.so +usr/lib/mysql/plugin/query_response_time.so +usr/lib/mysql/plugin/semisync_master.so +usr/lib/mysql/plugin/semisync_slave.so usr/lib/mysql/plugin/server_audit.so usr/lib/mysql/plugin/simple_password_check.so usr/lib/mysql/plugin/sql_errlog.so usr/lib/mysql/plugin/wsrep_info.so usr/lib/mysql/plugin/user_variables.so -usr/lib/libhsclient.so.* etc/apparmor.d/usr.sbin.mysqld usr/share/apport/package-hooks/source_mariadb-10.2.py -etc/mysql/debian-start -etc/mysql/conf.d/mysqld_safe_syslog.cnf +debian/additions/debian-start etc/mysql +debian/additions/mysqld_safe_syslog.cnf etc/mysql/conf.d usr/bin/msql2mysql usr/bin/my_print_defaults usr/bin/myisamchk @@ -56,8 +71,6 @@ usr/bin/wsrep_sst_rsync usr/bin/wsrep_sst_xtrabackup usr/bin/wsrep_sst_xtrabackup-v2 usr/share/doc/mariadb-server-10.2/mysqld.sym.gz -usr/share/doc/mariadb-server-10.2/INFO_SRC -usr/share/doc/mariadb-server-10.2/INFO_BIN usr/share/man/man1/msql2mysql.1 usr/share/man/man1/myisamchk.1 usr/share/man/man1/myisam_ftdump.1 @@ -79,8 +92,8 @@ usr/share/man/man1/resolveip.1 usr/share/man/man1/resolve_stack_dump.1 usr/share/man/man1/innochecksum.1 usr/share/man/man1/mysql_tzinfo_to_sql.1 -usr/share/mysql/debian-start.inc.sh -usr/share/mysql/echo_stderr +debian/additions/debian-start.inc.sh usr/share/mysql +debian/additions/echo_stderr usr/share/mysql usr/share/mysql/errmsg-utf8.txt usr/share/mysql/fill_help_tables.sql usr/share/mysql/maria_add_gis_sp_bootstrap.sql diff --git a/debian/mariadb-server-10.2.manpages b/debian/mariadb-server-10.2.manpages new file mode 100644 index 0000000000000..1825b7655da47 --- /dev/null +++ b/debian/mariadb-server-10.2.manpages @@ -0,0 +1,25 @@ +debian/tmp/usr/share/man/man1/aria_chk.1 +debian/tmp/usr/share/man/man1/aria_dump_log.1 +debian/tmp/usr/share/man/man1/aria_ftdump.1 +debian/tmp/usr/share/man/man1/aria_pack.1 +debian/tmp/usr/share/man/man1/aria_read_log.1 +debian/tmp/usr/share/man/man1/msql2mysql.1 +debian/tmp/usr/share/man/man1/myisamchk.1 +debian/tmp/usr/share/man/man1/myisam_ftdump.1 +debian/tmp/usr/share/man/man1/myisamlog.1 +debian/tmp/usr/share/man/man1/myisampack.1 +debian/tmp/usr/share/man/man1/my_print_defaults.1 +debian/tmp/usr/share/man/man1/mysqlbinlog.1 +debian/tmp/usr/share/man/man1/mysql_convert_table_format.1 +debian/tmp/usr/share/man/man1/mysqld_multi.1 +debian/tmp/usr/share/man/man1/mysqld_safe.1 +debian/tmp/usr/share/man/man1/mysqlhotcopy.1 +debian/tmp/usr/share/man/man1/mysql_install_db.1 +debian/tmp/usr/share/man/man1/mysql_plugin.1 +debian/tmp/usr/share/man/man1/mysql_secure_installation.1 +debian/tmp/usr/share/man/man1/mysql_setpermission.1 +debian/tmp/usr/share/man/man1/mysql_tzinfo_to_sql.1 +debian/tmp/usr/share/man/man1/perror.1 +debian/tmp/usr/share/man/man1/replace.1 +debian/tmp/usr/share/man/man1/resolveip.1 +debian/tmp/usr/share/man/man1/resolve_stack_dump.1 diff --git a/debian/mariadb-server-10.2.mysql-server.logrotate b/debian/mariadb-server-10.2.mysql-server.logrotate index a19e9ec46a2c9..2a9c3cd303126 100644 --- a/debian/mariadb-server-10.2.mysql-server.logrotate +++ b/debian/mariadb-server-10.2.mysql-server.logrotate @@ -1,8 +1,8 @@ -# - I put everything in one block and added sharedscripts, so that mysql gets +# - I put everything in one block and added sharedscripts, so that mysql gets # flush-logs'd only once. # Else the binary logs would automatically increase by n times every day. # - The error log is obsolete, messages go to syslog now. -/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mariadb-slow.log { +/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/mariadb-slow.log /var/log/mysql/error.log { daily rotate 7 missingok @@ -11,7 +11,6 @@ sharedscripts postrotate test -x /usr/bin/mysqladmin || exit 0 - if [ -f `my_print_defaults --mysqld | grep -oP "pid-file=\K[^$]+"` ]; then # If this fails, check debian.conf! mysqladmin --defaults-file=/etc/mysql/debian.cnf flush-logs diff --git a/debian/mariadb-server-10.2.mysql.default b/debian/mariadb-server-10.2.mysql.default new file mode 100644 index 0000000000000..22f08e54427af --- /dev/null +++ b/debian/mariadb-server-10.2.mysql.default @@ -0,0 +1,8 @@ +# The delay in seconds the init script waits for the server to be up and running after having started "mysqld_safe" to run the "/etc/mysql/debian-start" script. +# If the server is still not responding after the delay, the script won't be executed and an error will be thrown on the syslog. +# Default: 30 +#MYSQLD_STARTUP_TIMEOUT=30 + +# The email recipient(s) of the output of the check for crashed and improperly closed MyISAM and Aria tables done at each server start by the "/etc/mysql/debian-start" script. +# Default: root +#MYCHECK_RCPT="root" diff --git a/debian/mariadb-server-10.2.mysql.init b/debian/mariadb-server-10.2.mysql.init index d250ebd2e9e2e..0d8128cb7d31f 100644 --- a/debian/mariadb-server-10.2.mysql.init +++ b/debian/mariadb-server-10.2.mysql.init @@ -22,12 +22,16 @@ test -x /usr/sbin/mysqld || exit 0 . /lib/lsb/init-functions SELF=$(cd $(dirname $0); pwd -P)/$(basename $0) -CONF=/etc/mysql/my.cnf + MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" -# priority can be overridden and "-s" adds output to stderr +# priority can be overriden and "-s" adds output to stderr ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mysql -i" +if [ -f /etc/default/mysql ]; then + . /etc/default/mysql +fi + # Safeguard (relative paths, core dumps..) cd / umask 077 @@ -37,18 +41,15 @@ umask 077 # so break my scripts. export HOME=/etc/mysql/ -# Source default config file. -[ -r /etc/default/mariadb ] && . /etc/default/mariadb - ## Fetch a particular option from mysql's invocation. # # Usage: void mysqld_get_param option mysqld_get_param() { - /usr/sbin/mysqld --print-defaults \ - | tr " " "\n" \ - | grep -- "--$1" \ - | tail -n 1 \ - | cut -d= -f2 + /usr/sbin/mysqld --print-defaults \ + | tr " " "\n" \ + | grep -- "--$1" \ + | tail -n 1 \ + | cut -d= -f2 } ## Do some sanity checks before even trying to start mysqld. @@ -75,21 +76,21 @@ sanity_checks() { # # Usage: boolean mysqld_status [check_alive|check_dead] [warn|nowarn] mysqld_status () { - ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? )) - - ps_alive=0 - pidfile=`mysqld_get_param pid-file` - if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi - - if [ "$1" = "check_alive" -a $ping_alive = 1 ] || - [ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then - return 0 # EXIT_SUCCESS - else - if [ "$2" = "warn" ]; then - echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug - fi - return 1 # EXIT_FAILURE + ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? )) + + ps_alive=0 + pidfile=`mysqld_get_param pid-file` + if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi + + if [ "$1" = "check_alive" -a $ping_alive = 1 ] || + [ "$1" = "check_dead" -a $ping_alive = 0 -a $ps_alive = 0 ]; then + return 0 # EXIT_SUCCESS + else + if [ "$2" = "warn" ]; then + echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug fi + return 1 # EXIT_FAILURE + fi } # @@ -97,101 +98,96 @@ mysqld_status () { # case "${1:-''}" in + 'start') - sanity_checks; - # Start daemon - log_daemon_msg "Starting MariaDB database server" "mysqld" - if mysqld_status check_alive nowarn; then - log_progress_msg "already running" - log_end_msg 0 - else - # Could be removed during boot - test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld - - # Start MariaDB! - /usr/bin/mysqld_safe "${@:2}" > /dev/null 2>&1 & - - # 6s was reported in #352070 to be too little - for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-60}"); do - sleep 1 - if mysqld_status check_alive nowarn ; then break; fi - log_progress_msg "." - done - if mysqld_status check_alive warn; then - log_end_msg 0 - # Now start mysqlcheck or whatever the admin wants. - output=$(/etc/mysql/debian-start) - [ -n "$output" ] && log_action_msg "$output" - else - log_end_msg 1 - log_failure_msg "Please take a look at the syslog" - fi - fi - ;; + sanity_checks; + # Start daemon + log_daemon_msg "Starting MariaDB database server" "mysqld" + if mysqld_status check_alive nowarn; then + log_progress_msg "already running" + log_end_msg 0 + else + # Could be removed during boot + test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld + + # Start MariaDB! + /usr/bin/mysqld_safe "${@:2}" 2>&1 >/dev/null | $ERR_LOGGER & + + for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do + sleep 1 + if mysqld_status check_alive nowarn ; then break; fi + log_progress_msg "." + done + if mysqld_status check_alive warn; then + log_end_msg 0 + # Now start mysqlcheck or whatever the admin wants. + output=$(/etc/mysql/debian-start) + if [ -n "$output" ]; then + log_action_msg "$output" + fi + else + log_end_msg 1 + log_failure_msg "Please take a look at the syslog" + fi + fi + ;; 'stop') - # * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible - # at least for cron, we can rely on it here, too. (although we have - # to specify it explicit as e.g. sudo environments points to the normal - # users home and not /root) - log_daemon_msg "Stopping MariaDB database server" "mysqld" - if ! mysqld_status check_dead nowarn; then - set +e - shutdown_out=`$MYADMIN shutdown 2>&1`; r=$? - set -e - if [ "$r" -ne 0 ]; then - log_end_msg 1 - [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out" - log_daemon_msg "Killing MariaDB database server by signal" "mysqld" - killall -15 mysqld - server_down= - for i in `seq 1 600`; do - sleep 1 - if mysqld_status check_dead nowarn; then server_down=1; break; fi - done - if test -z "$server_down"; then killall -9 mysqld; fi - fi - fi - - if ! mysqld_status check_dead warn; then - log_end_msg 1 - log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.2/README.Debian.gz!" - exit -1 - else - log_end_msg 0 - fi - ;; + # * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible + # at least for cron, we can rely on it here, too. (although we have + # to specify it explicit as e.g. sudo environments points to the normal + # users home and not /root) + log_daemon_msg "Stopping MariaDB database server" "mysqld" + if ! mysqld_status check_dead nowarn; then + set +e + shutdown_out=`$MYADMIN shutdown 2>&1`; r=$? + set -e + if [ "$r" -ne 0 ]; then + log_end_msg 1 + [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out" + log_daemon_msg "Killing MariaDB database server by signal" "mysqld" + killall -15 mysqld + server_down= + for i in `seq 1 600`; do + sleep 1 + if mysqld_status check_dead nowarn; then server_down=1; break; fi + done + if test -z "$server_down"; then killall -9 mysqld; fi + fi + fi + + if ! mysqld_status check_dead warn; then + log_end_msg 1 + log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.2/README.Debian.gz!" + exit -1 + else + log_end_msg 0 + fi + ;; 'restart') - set +e; $SELF stop; set -e - $SELF start - ;; + set +e; $SELF stop; set -e + shift + $SELF start "${@}" + ;; 'reload'|'force-reload') - log_daemon_msg "Reloading MariaDB database server" "mysqld" - $MYADMIN reload - log_end_msg 0 - ;; + log_daemon_msg "Reloading MariaDB database server" "mysqld" + $MYADMIN reload + log_end_msg 0 + ;; 'status') - if mysqld_status check_alive nowarn; then - log_action_msg "$($MYADMIN version)" - else - log_action_msg "MariaDB is stopped." - exit 3 - fi - ;; - - 'bootstrap') - # Bootstrap the cluster, start the first node - # that initiates the cluster - log_daemon_msg "Bootstrapping the cluster" "mysqld" - $SELF start "${@:2}" --wsrep-new-cluster - ;; + if mysqld_status check_alive nowarn; then + log_action_msg "$($MYADMIN version)" + else + log_action_msg "MariaDB is stopped." + exit 3 + fi + ;; *) - echo "Usage: $SELF start|stop|restart|reload|force-reload|status|bootstrap" - exit 1 - ;; + echo "Usage: $SELF start|stop|restart|reload|force-reload|status" + exit 1 + ;; esac - diff --git a/debian/mariadb-server-10.2.postinst b/debian/mariadb-server-10.2.postinst index 0244046c5a343..b07fc4abf583c 100644 --- a/debian/mariadb-server-10.2.postinst +++ b/debian/mariadb-server-10.2.postinst @@ -4,7 +4,7 @@ if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } - + export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin # This command can be used as pipe to syslog. With "-s" it also logs to stderr. @@ -55,83 +55,95 @@ EOF # In case the server wasn't running at all it should be ok if the stop # script fails. I can't tell at this point because of the cleaned /var/run. set +e; invoke stop; set -e - + case "$1" in configure) - mysql_datadir=/usr/share/mysql - mysql_statedir=/var/lib/mysql + mysql_statedir=/usr/share/mysql + mysql_datadir=/var/lib/mysql + mysql_logdir=/var/log/mysql mysql_rundir=/var/run/mysqld - mysql_logdir=/var/log mysql_cfgdir=/etc/mysql - mysql_newlogdir=/var/log/mysql mysql_upgradedir=/var/lib/mysql-upgrade - # first things first, if the following symlink exists, it is a preserved - # copy the old data dir from a mysql upgrade that would have otherwise - # been replaced by an empty mysql dir. this should restore it. + # If the following symlink exists, it is a preserved copy the old data dir + # created by the preinst script during a upgrade that would have otherwise + # been replaced by an empty mysql dir. This should restore it. for dir in DATADIR LOGDIR; do - if [ "$dir" = "DATADIR" ]; then targetdir=$mysql_statedir; else targetdir=$mysql_newlogdir; fi - savelink="$mysql_upgradedir/$dir.link" - if [ -L "$savelink" ]; then - # If the targetdir was a symlink before we upgraded it is supposed - # to be either still be present or not existing anymore now. - if [ -L "$targetdir" ]; then - rm "$savelink" - elif [ ! -d "$targetdir" ]; then - mv "$savelink" "$targetdir" - else - # this should never even happen, but just in case... - mysql_tmp=`mktemp -d -t mysql-symlink-restore-XXXXXX` - echo "this is very strange! see $mysql_tmp/README..." >&2 - mv "$targetdir" "$mysql_tmp" - cat << EOF > "$mysql_tmp/README" - -if you're reading this, it's most likely because you had replaced /var/lib/mysql + + if [ "$dir" = "DATADIR" ]; then + targetdir=$mysql_datadir + else + targetdir=$mysql_logdir + fi + + savelink="$mysql_upgradedir/$dir.link" + if [ -L "$savelink" ]; then + # If the targetdir was a symlink before we upgraded it is supposed + # to be either still be present or not existing anymore now. + if [ -L "$targetdir" ]; then + rm "$savelink" + elif [ ! -d "$targetdir" ]; then + mv "$savelink" "$targetdir" + else + # this should never even happen, but just in case... + mysql_tmp=`mktemp -d -t mysql-symlink-restore-XXXXXX` + echo "this is very strange! see $mysql_tmp/README..." >&2 + mv "$targetdir" "$mysql_tmp" + cat << EOF > "$mysql_tmp/README" + +Ff you're reading this, it's most likely because you had replaced /var/lib/mysql with a symlink, then upgraded to a new version of mysql, and then dpkg -removed your symlink (see #182747 and others). the mysql packages noticed -that this happened, and as a workaround have restored it. however, because +removed your symlink (see #182747 and others). The mysql packages noticed +that this happened, and as a workaround have restored it. However, because /var/lib/mysql seems to have been re-created in the meantime, and because -we don't want to rm -rf something we don't know as much about, we're going -to leave this unexpected directory here. if your database looks normal, +we don't want to rm -rf something we don't know as much about, we are going +to leave this unexpected directory here. If your database looks normal, and this is not a symlink to your database, you should be able to blow this all away. EOF - fi fi - rmdir $mysql_upgradedir 2>/dev/null || true + fi + rmdir $mysql_upgradedir 2>/dev/null || true + done - + # Ensure the existence and right permissions for the database and # log files. - if [ ! -d "$mysql_statedir/mysql" -a ! -L "$mysql_statedir/mysql" ]; then - # Debian: beware of the bashisms... - /bin/bash /usr/bin/mysql_install_db --rpm --user=mysql --disable-log-bin 2>&1 | $ERR_LOGGER - fi - if [ ! -d "$mysql_newlogdir" -a ! -L "$mysql_newlogdir" ]; then mkdir "$mysql_newlogdir"; fi + if [ ! -d "$mysql_statedir" -a ! -L "$mysql_statedir" ]; then mkdir "$mysql_statedir"; fi + if [ ! -d "$mysql_datadir" -a ! -L "$mysql_datadir" ]; then mkdir "$mysql_datadir" ; fi + if [ ! -d "$mysql_logdir" -a ! -L "$mysql_logdir" ]; then mkdir "$mysql_logdir" ; fi # When creating an ext3 jounal on an already mounted filesystem like e.g. # /var/lib/mysql, you get a .journal file that is not modifyable by chown. - # The mysql_datadir must not be writable by the mysql user under any + # The mysql_statedir must not be writable by the mysql user under any # circumstances as it contains scripts that are executed by root. set +e - chown -R 0:0 $mysql_datadir - chown -R mysql $mysql_statedir - chown -R mysql $mysql_rundir - chown -R mysql:adm $mysql_newlogdir; chmod 2750 $mysql_newlogdir; - for i in log err; do - touch $mysql_logdir/mysql.$i - chown mysql:adm $mysql_logdir/mysql.$i - chmod 0640 $mysql_logdir/mysql.$i - done + chown -R 0:0 $mysql_statedir + chown -R mysql $mysql_datadir + chown -R mysql:adm $mysql_logdir + chmod 2750 $mysql_logdir set -e # This is important to avoid dataloss when there is a removed # mysql-server version from Woody lying around which used the same # data directory and then somewhen gets purged by the admin. - db_set mysql-server/postrm_remove_database false || true + db_set mariadb-server/postrm_remove_database false || true + + # Clean up old flags before setting new one + rm -f $mysql_datadir/debian-*.flag + # Flag data dir to avoid downgrades + touch $mysql_datadir/debian-10.2.flag + + # initiate databases. Output is not allowed by debconf :-( + # This will fail if we are upgrading an existing database; in this case + # mysql_upgrade, called from the /etc/init.d/mysql start script, will + # handle things. + # Debian: beware of the bashisms... + # Debian: can safely run on upgrades with existing databases + set +e + bash /usr/bin/mysql_install_db --rpm --cross-bootstrap --user=mysql --disable-log-bin 2>&1 | $ERR_LOGGER + set -e - # To avoid downgrades. - touch $mysql_statedir/debian-10.2.flag ## On every reconfiguration the maintenance user is recreated. # diff --git a/debian/mariadb-server-10.2.postrm b/debian/mariadb-server-10.2.postrm index 7cee5150ef974..f8a95df54ea8a 100644 --- a/debian/mariadb-server-10.2.postrm +++ b/debian/mariadb-server-10.2.postrm @@ -1,9 +1,6 @@ #!/bin/bash -e -# It is possible that Debconf has already been removed, too. -if [ -f /usr/share/debconf/confmodule ]; then - . /usr/share/debconf/confmodule -fi +. /usr/share/debconf/confmodule if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } @@ -46,41 +43,36 @@ esac # # - Do NOT purge logs or data if another mysql-sever* package is installed (#307473) # - Remove the mysql user only after all his owned files are purged. -# +# if [ "$1" = "purge" -a ! \( -x /usr/sbin/mysqld -o -L /usr/sbin/mysqld \) ]; then # we remove the mysql user only after all his owned files are purged rm -f /var/log/mysql.{log,err}{,.0,.[1234567].gz} rm -rf /var/log/mysql - db_input high mysql-server-5.1/postrm_remove_databases || true + db_input high mariadb-server-10.2/postrm_remove_databases || true db_go || true - db_get mysql-server-5.1/postrm_remove_databases || true + db_get mariadb-server-10.2/postrm_remove_databases || true if [ "$RET" = "true" ]; then # never remove the debian.cnf when the databases are still existing # else we ran into big trouble on the next install! rm -f /etc/mysql/debian.cnf - rm -rf /var/lib/mysql - rm -rf /var/run/mysqld + # Remove all contents from /var/lib/mysql except if it's a + # directory with file system data. See #829491 for details and + # #608938 for potential mysql-server leftovers which erroneously + # had been renamed. + find /var/lib/mysql -mindepth 1 \ + -not -path '*/lost+found/*' -not -name 'lost+found' \ + -not -path '*/lost@002bfound/*' -not -name 'lost@002bfound' \ + -delete + # "|| true" still needed as rmdir still exits with non-zero if + # /var/lib/mysql is a mount point + rmdir --ignore-fail-on-non-empty /var/lib/mysql || true + rm -rf /var/run/mysqld # this directory is created by the init script, don't leave behind userdel mysql || true fi - # (normally) Automatically added by dh_installinit - if [ "$1" = "purge" ] ; then - update-rc.d mysql remove >/dev/null || exit 0 - fi - # (normally) End automatically added section -fi - -# (normally) Automatically added by dh_installdebconf -if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then - . /usr/share/debconf/confmodule - db_purge fi -# (normally) End automatically added section -if [ "$1" = "purge" ] ; then - rm -f /etc/apparmor.d/force-complain/usr.sbin.mysqld >/dev/null 2>&1 || true -fi -# no DEBHELPER here, "update-rc.d remove" fails if mysql-server-5.1 is installed +#DEBHELPER# exit 0 diff --git a/debian/mariadb-server-10.2.preinst b/debian/mariadb-server-10.2.preinst index ee0723ea85da2..9804b1ccd6e53 100644 --- a/debian/mariadb-server-10.2.preinst +++ b/debian/mariadb-server-10.2.preinst @@ -14,9 +14,8 @@ ${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" -DATADIR=/var/lib/mysql -LOGDIR=/var/log/mysql -UPGRADEDIR=/var/lib/mysql-upgrade +mysql_datadir=/var/lib/mysql +mysql_upgradedir=/var/lib/mysql-upgrade # Try to stop the server in a sane way. If it does not success let the admin # do it himself. No database directories should be removed while the server @@ -33,13 +32,13 @@ stop_server() { $cmd errno=$? set -e - + # 0=ok, 100=no init script (fresh install) if [ "$errno" != 0 -a "$errno" != 100 ]; then echo "${cmd/ */} returned $errno" 1>&2 echo "There is a MySQL server running, but we failed in our attempts to stop it." 1>&2 echo "Stop it yourself and try again!" 1>&2 - db_stop + db_stop exit 1 fi } @@ -47,31 +46,80 @@ stop_server() { ################################ main() ########################## this_version=10.2 +max_upgradeable_version=5.6 + +# Check if a flag file is found that indicates a previous MariaDB or MySQL +# version was installed. If multiple flags are found, check which one was +# the biggest version number. +for flag in $mysql_datadir/debian-*.flag +do + + # The for loop leaves $flag as the query string if there are no results, + # so the check below is needed to stop further processing when there are + # no real results. + if [ $flag = "$mysql_datadir/debian-*.flag" ] + then + break + fi + + flag_version=`echo $flag | sed 's/.*debian-\([0-9\.]\+\).flag/\1/'` + + # Initialize value if empty + if [ -z "$found_version" ] + then + found_version=$flag_version + fi -# Safe the user from stupidities. -show_downgrade_warning=0 -for i in `ls $DATADIR/debian-*.flag 2>/dev/null`; do - found_version=`echo $i | sed 's/.*debian-\([0-9\.]\+\).flag/\1/'` - if dpkg --compare-versions "$this_version" '<<' "$found_version"; then - show_downgrade_warning=1 - break; + # Update value if now bigger then before + if dpkg --compare-versions "$flag_version" '>>' "$found_version" + then + found_version=$flag_version fi + done -if [ "$show_downgrade_warning" = 1 ]; then - db_fset mariadb-server-$this_version/really_downgrade seen false || true - db_input medium mariadb-server-$this_version/really_downgrade || true - db_go - db_get mariadb-server-$this_version/really_downgrade || true - if [ "$RET" = "true" ]; then - rm -f $DATADIR/debian-*.flag - touch $DATADIR/debian-$this_version.flag - else - echo "Aborting downgrade from (at least) $found_version to $this_version." 1>&2 - echo "If are sure you want to downgrade to $this_version, remove the file" 1>&2 - echo "$DATADIR/debian-*.flag and try installing again." 1>&2 - db_stop - exit 1 + + +# If an upgrade is detected, proceed with it automatically without +# requiring any user interaction. +# +# However, if the user attempts to downgrade, warn about the incompatibility. +# Downgrade is detected if the flag version is bigger than $this_version +# (e.g. 10.1 > 10.0) or the flag version is smaller than 10.0 but bigger +# than $max_upgradeable_version. +if [ ! -z "$found_version" ] +then + + echo "$mysql_datadir: found previous version $found_version" + + if dpkg --compare-versions "$found_version" '>>' "$this_version" + then + downgrade_detected=true fi + + if dpkg --compare-versions "$found_version" '>>' "$max_upgradeable_version" \ + && dpkg --compare-versions "$found_version" '<<' "10.0" + then + downgrade_detected=true + fi + +fi + + +# Don't abort dpkg if downgrade is detected (as was done previously). +# Instead simply move the old datadir and create a new for this_version. +if [ ! -z "$downgrade_detected" ] +then + db_input critical mariadb-server-10.2/old_data_directory_saved || true + db_go + echo "The file $mysql_datadir/debian-$found_version.flag indicates a" 1>&2 + echo "version that cannot automatically be upgraded. Therefore the" 1>&2 + echo "previous data directory will be renamed to $mysql_datadir-$found_version and" 1>&2 + echo "a new data directory will be initialized at $mysql_datadir." 1>&2 + echo "Please manually export/import your data (e.g. with mysqldump) if needed." 1>&2 + mv -f $mysql_datadir $mysql_datadir-$found_version + # Also move away the old debian.cnf file that included credentials that are + # no longer valid + mv -f /etc/mysql/debian.cnf /etc/mysql/debian.cnf-$found_version fi # to be sure @@ -86,9 +134,9 @@ fi # # Now we have to ensure the following state: -# /etc/passwd: mysql:x:100:101:MySQL Server:/var/lib/mysql:/bin/false +# /etc/passwd: mysql:x:100:101:MySQL Server:/nonexistent:/bin/false # /etc/group: mysql:x:101: -# +# # Sadly there could any state be present on the system so we have to # modify everything carefully i.e. not doing a chown before creating # the user etc... @@ -107,7 +155,8 @@ if ! getent passwd mysql >/dev/null; then --system \ --disabled-login \ --ingroup mysql \ - --home $DATADIR \ + --no-create-home \ + --home /nonexistent \ --gecos "MySQL Server" \ --shell /bin/false \ mysql >/dev/null @@ -121,47 +170,36 @@ set -e for dir in DATADIR LOGDIR; do checkdir=`eval echo "$"$dir` if [ -L "$checkdir" ]; then - mkdir -p "$UPGRADEDIR" - cp -d "$checkdir" "$UPGRADEDIR/$dir.link" + mkdir -p "$mysql_upgradedir" + cp -dT "$checkdir" "$mysql_upgradedir/$dir.link" fi done # creating mysql home directory -if [ ! -d $DATADIR -a ! -L $DATADIR ]; then - mkdir $DATADIR +if [ ! -d $mysql_datadir -a ! -L $mysql_datadir ]; then + mkdir $mysql_datadir fi # checking disc space -if LC_ALL=C BLOCKSIZE= df --portability $DATADIR/. | tail -n 1 | awk '{ exit ($4>1000) }'; then - echo "ERROR: There's not enough space in $DATADIR/" 1>&2 +if LC_ALL=C BLOCKSIZE= df --portability $mysql_datadir/. | tail -n 1 | awk '{ exit ($4>1000) }'; then + echo "ERROR: There's not enough space in $mysql_datadir/" 1>&2 db_stop exit 1 fi # Since the home directory was created before putting the user into -# the mysql group and moreover we cannot guarantee that the +# the mysql group and moreover we cannot guarantee that the # permissions were correctly *before* calling this script, we fix them now. # In case we use NIS and no mysql user is present then this script should # better fail now than later.. # The "set +e" is necessary as e.g. a ".journal" of a ext3 partition is # not chgrp'able (#318435). set +e -chown mysql:mysql $DATADIR -find $DATADIR -follow -not -group mysql -print0 2>/dev/null \ +chown mysql:mysql $mysql_datadir +find $mysql_datadir -follow -not -group mysql -print0 2>/dev/null \ | xargs -0 --no-run-if-empty chgrp mysql set -e -# Some files below /etc/ were possibly in the mysql-server-5.0/etch package -# before. They get overwritten by current ones to avoid unnecessary dpkg questions. -while read md5 file; do - if [ "`md5sum $file 2>/dev/null`" = "$md5 $file" ]; then - cp /usr/share/mysql-common/internal-use-only/`echo $file | sed 's/_g'` $file - fi -done <\n" "Language-Team: Arabic \n" @@ -25,40 +25,35 @@ msgstr "" ": n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n" ": n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" -msgstr "هل فعلاً تريد التثبيط؟" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -msgstr "هناك ملف مسمى /var/lib/mysql/debian-*.flag موجود على هذا النظام." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -#, fuzzy -#| msgid "" -#| "Such file is an indication that a mariadb-server package with a higher " -#| "version has been installed earlier." msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"هذا الملف دلالة على أن نسخة أحدث من حزمة mariadb-server تم تثبيتها مسبقاً." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" -"ليست هناك أية ضمانة أن النسخة التي تقوم بتثبيتها ستكون قادرة على استخدام " -"قواعد البيانات الحالية." #. Type: note #. Description @@ -111,31 +106,15 @@ msgstr "" "إن كنت تقوم بإزالة حزمة MariaDB كي تقوم لاحقاً بتثبيت نسخة أحدث أو إن كانت " "حزمة mariadb-server مختلفة تستخدمها، فيجب إبقاء البيانات." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "Start the MariaDB server on boot?" -msgstr "تشغيل خادم MariaDB عند الإقلاع؟" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"يمكن تشغيل خادم MariaDB آلياً وقت الإقلاع أو يدوياً باستخدام الأمر '/etc/init." -"d/mysql start'." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "كلمة المرور الجديدة لمستخد \"root\" الخاص بـMariaDB:" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -145,7 +124,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -153,7 +132,7 @@ msgstr "إن ترك الحقل فارغاً، فلن يتم تغيير كلمة #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "New password for the MariaDB \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -161,13 +140,13 @@ msgstr "كلمة المرور الجديدة لمستخد \"root\" الخاص ب #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "تعذر تعيين كلمة مرور للمستخدم \"root\" الخاص بـMariaDB." #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -179,7 +158,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "You should check the account's password after tha package installation." @@ -188,7 +167,7 @@ msgstr "يجب عليك التحقق من كلمة مرور الحساب عقب #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " @@ -197,21 +176,54 @@ msgid "" "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." msgstr "" -"الرجاء قراءة الملف /usr/share/doc/mariadb-server-10.2/README.Debian للمزيد من " -"المعلومات." +"الرجاء قراءة الملف /usr/share/doc/mariadb-server-10.2/README.Debian للمزيد " +"من المعلومات." #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" +#~ msgid "Really proceed with downgrade?" +#~ msgstr "هل فعلاً تريد التثبيط؟" + +#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +#~ msgstr "هناك ملف مسمى /var/lib/mysql/debian-*.flag موجود على هذا النظام." + +#, fuzzy +#~| msgid "" +#~| "Such file is an indication that a mariadb-server package with a higher " +#~| "version has been installed earlier." +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "هذا الملف دلالة على أن نسخة أحدث من حزمة mariadb-server تم تثبيتها مسبقاً." + +#~ msgid "" +#~ "There is no guarantee that the version you're currently installing will " +#~ "be able to use the current databases." +#~ msgstr "" +#~ "ليست هناك أية ضمانة أن النسخة التي تقوم بتثبيتها ستكون قادرة على استخدام " +#~ "قواعد البيانات الحالية." + +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "تشغيل خادم MariaDB عند الإقلاع؟" + +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "يمكن تشغيل خادم MariaDB آلياً وقت الإقلاع أو يدوياً باستخدام الأمر '/etc/" +#~ "init.d/mysql start'." + #~ msgid "" #~ "To use MariaDB, the following entries for users and groups should be " #~ "added to the system:" diff --git a/debian/po/ca.po b/debian/po/ca.po index 6f82d771279ea..771658d65aa3c 100644 --- a/debian/po/ca.po +++ b/debian/po/ca.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-4.1\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2004-01-31 19:20GMT\n" "Last-Translator: Aleix Badia i Bosch \n" "Language-Team: Debian L10n Catalan \n" @@ -15,32 +15,34 @@ msgstr "" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" +msgid "The old data directory will be saved at new location" msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" #. Type: note @@ -90,35 +92,15 @@ msgid "" "the data should be kept." msgstr "" -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -#, fuzzy -#| msgid "Should MySQL start on boot?" -msgid "Start the MariaDB server on boot?" -msgstr "Voleu que el MariaDB s'inici a l'arrencada ?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -#, fuzzy -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"El MariaDB es pot executar a l'arrencada o noms si executeu manualment '/" -"etc/init.d/mysql start'. Seleccioneu 's' si voleu que s'inicialitzi " -"automticament." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -126,25 +108,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "If this field is left blank, the password will not be changed." msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -153,13 +135,13 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "You should check the account's password after the package installation." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." @@ -167,16 +149,30 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" +#, fuzzy +#~| msgid "Should MySQL start on boot?" +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "Voleu que el MariaDB s'inici a l'arrencada ?" + +#, fuzzy +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "El MariaDB es pot executar a l'arrencada o noms si executeu manualment '/" +#~ "etc/init.d/mysql start'. Seleccioneu 's' si voleu que s'inicialitzi " +#~ "automticament." + #, fuzzy #~ msgid "" #~ "To use mysql you must install an equivalent user and group to the " diff --git a/debian/po/cs.po b/debian/po/cs.po index cf30159d17991..526f03c99ad70 100644 --- a/debian/po/cs.po +++ b/debian/po/cs.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2007-05-01 13:01+0200\n" "Last-Translator: Miroslav Kure \n" "Language-Team: Czech \n" @@ -24,40 +24,35 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" -msgstr "Opravdu pokračovat v degradaci?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -msgstr "V systému existuje soubor /var/lib/mysql/debian-*.flag." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -#, fuzzy -#| msgid "" -#| "Such file is an indication that a mariadb-server package with a higher " -#| "version has been installed earlier." msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"To znamená, že již byl nainstalován balík mariadb-server s vyšší verzí." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" -"Neexistuje žádná záruka, že momentálně instalovaná verze bude umět pracovat " -"se stávajícími databázemi." #. Type: note #. Description @@ -114,31 +109,15 @@ msgstr "" "MariaDB, nebo pokud tato data souběžně využívá jiný balík mariadb-server, " "měli byste data ponechat." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "Start the MariaDB server on boot?" -msgstr "Spustit MariaDB server při startu systému?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"MariaDB se může spouštět automaticky při startu systému, nebo ručně příkazem " -"'/etc/init.d/mysql start'." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "Nové heslo MariaDB uživatele \"root\":" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -148,7 +127,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -156,7 +135,7 @@ msgstr "Ponecháte-li pole prázdné, heslo se nezmění." #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "New password for the MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -164,13 +143,13 @@ msgstr "Nové heslo MariaDB uživatele \"root\":" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Nelze nastavit heslo MariaDB uživatele \"root\"" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -182,7 +161,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "You should check the account's password after tha package installation." @@ -191,7 +170,7 @@ msgstr "Po instalaci balíku byste měli heslo ověřit." #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " @@ -204,16 +183,49 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" +#~ msgid "Really proceed with downgrade?" +#~ msgstr "Opravdu pokračovat v degradaci?" + +#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +#~ msgstr "V systému existuje soubor /var/lib/mysql/debian-*.flag." + +#, fuzzy +#~| msgid "" +#~| "Such file is an indication that a mariadb-server package with a higher " +#~| "version has been installed earlier." +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "To znamená, že již byl nainstalován balík mariadb-server s vyšší verzí." + +#~ msgid "" +#~ "There is no guarantee that the version you're currently installing will " +#~ "be able to use the current databases." +#~ msgstr "" +#~ "Neexistuje žádná záruka, že momentálně instalovaná verze bude umět " +#~ "pracovat se stávajícími databázemi." + +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "Spustit MariaDB server při startu systému?" + +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "MariaDB se může spouštět automaticky při startu systému, nebo ručně " +#~ "příkazem '/etc/init.d/mysql start'." + #~ msgid "" #~ "To use MariaDB, the following entries for users and groups should be " #~ "added to the system:" diff --git a/debian/po/da.po b/debian/po/da.po index 917465943afdd..74117e57dba1e 100644 --- a/debian/po/da.po +++ b/debian/po/da.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-4.1\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2007-05-30 22:41+0200\n" "Last-Translator: Claus Hindsgaul \n" "Language-Team: Danish\n" @@ -25,42 +25,35 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" -msgstr "nsker du virkelig at fortstte nedgraderingen?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." msgstr "" -"Der er en fil med navnet /var/lib/mysql/debian-*.flag p dette system." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -#, fuzzy -#| msgid "" -#| "Such file is an indication that a mariadb-server package with a higher " -#| "version has been installed earlier." msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"Sdan en fil tyder p at der tidligere har vret installeret en hjere " -"version af mariadb-server-pakken." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" -"Det kan ikke garanteres at den version, du er ved at installere, kan benytte " -"data fra de eksisterende databaser." #. Type: note #. Description @@ -117,31 +110,15 @@ msgstr "" "eller hvis en anden mariadb-server-pakke allerede benytter den, br dataene " "bevares." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "Start the MariaDB server on boot?" -msgstr "Start MariaDB-serveren under systemopstart?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"MariaDB-serveren kan enten startes op automatisk under systemopstarten, " -"eller manuelt med kommandoen '/etc/init.d/mysql start'." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "Ny adgangskode for MariaDB's \"root\"-bruger:" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -151,7 +128,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -159,7 +136,7 @@ msgstr "Hvis du lader dette felt st #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "New password for the MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -167,13 +144,13 @@ msgstr "Ny adgangskode for MariaDB's \"root\"-bruger:" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Kunne ikke stte adgangskoden for MariaDB's \"root\"-bruger" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -186,13 +163,13 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "You should check the account's password after the package installation." msgstr "Du br tjekke kontoens adgangskode efter pakkeinstallationen." #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " @@ -206,16 +183,51 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" +#~ msgid "Really proceed with downgrade?" +#~ msgstr "nsker du virkelig at fortstte nedgraderingen?" + +#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +#~ msgstr "" +#~ "Der er en fil med navnet /var/lib/mysql/debian-*.flag p dette system." + +#, fuzzy +#~| msgid "" +#~| "Such file is an indication that a mariadb-server package with a higher " +#~| "version has been installed earlier." +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "Sdan en fil tyder p at der tidligere har vret installeret en hjere " +#~ "version af mariadb-server-pakken." + +#~ msgid "" +#~ "There is no guarantee that the version you're currently installing will " +#~ "be able to use the current databases." +#~ msgstr "" +#~ "Det kan ikke garanteres at den version, du er ved at installere, kan " +#~ "benytte data fra de eksisterende databaser." + +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "Start MariaDB-serveren under systemopstart?" + +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "MariaDB-serveren kan enten startes op automatisk under systemopstarten, " +#~ "eller manuelt med kommandoen '/etc/init.d/mysql start'." + #~ msgid "" #~ "To use MariaDB, the following entries for users and groups should be " #~ "added to the system:" diff --git a/debian/po/de.po b/debian/po/de.po index c39c1abeb8fd0..4a0ec4282d46f 100644 --- a/debian/po/de.po +++ b/debian/po/de.po @@ -16,7 +16,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1_5.1.37-1_de\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2009-08-27 22:41+0200\n" "Last-Translator: Thomas Mueller \n" "Language-Team: german \n" @@ -27,39 +27,35 @@ msgstr "" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" -msgstr "Möchten Sie wirklich eine ältere Version einspielen?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." msgstr "" -"Auf diesem System existiert eine Datei mit dem Namen /var/lib/mysql/debian-*." -"flag" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"Diese Datei ist ein Hinweis darauf, dass früher ein MariaDB-Server-Paket mit " -"einer höheren Version installiert war." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" -"Es kann nicht garantiert werden, dass die gegenwärtig zu installierende " -"Version dessen Daten benutzen kann." #. Type: note #. Description @@ -115,31 +111,15 @@ msgstr "" "ein anderes mariadb-server-Paket dieses bereits benutzt, sollten die Daten " "behalten werden." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "Start the MariaDB server on boot?" -msgstr "Soll der MariaDB-Server automatisch beim Booten starten?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"Der MariaDB-Dienst kann entweder automatisch beim Systemstart oder manuell " -"durch Eingabe des Befehls »/etc/init.d/mysql start« gestartet werden." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "Neues Passwort für den MariaDB »root«-Benutzer:" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -149,25 +129,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "If this field is left blank, the password will not be changed." msgstr "Wenn dieses Feld freigelassen wird, wird das Passwort nicht geändert." #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "Wiederholen Sie das Passwort für den MariaDB-»root«-Benutzer:" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Konnte für den MariaDB-»root«-Benutzer kein Passwort setzen" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -180,7 +160,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "You should check the account's password after the package installation." msgstr "" "Sie sollten das Passwort des administrativen Benutzers nach der " @@ -188,7 +168,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mariadb-server-5.1/README.Debian file for " @@ -202,15 +182,47 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "Passwort-Eingabefehler" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" "Die beiden von Ihnen eingegebenen Passwörter sind nicht identisch. Bitte " "erneut versuchen." +#~ msgid "Really proceed with downgrade?" +#~ msgstr "Möchten Sie wirklich eine ältere Version einspielen?" + +#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +#~ msgstr "" +#~ "Auf diesem System existiert eine Datei mit dem Namen /var/lib/mysql/" +#~ "debian-*.flag" + +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "Diese Datei ist ein Hinweis darauf, dass früher ein MariaDB-Server-Paket " +#~ "mit einer höheren Version installiert war." + +#~ msgid "" +#~ "There is no guarantee that the version you're currently installing will " +#~ "be able to use the current databases." +#~ msgstr "" +#~ "Es kann nicht garantiert werden, dass die gegenwärtig zu installierende " +#~ "Version dessen Daten benutzen kann." + +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "Soll der MariaDB-Server automatisch beim Booten starten?" + +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "Der MariaDB-Dienst kann entweder automatisch beim Systemstart oder " +#~ "manuell durch Eingabe des Befehls »/etc/init.d/mysql start« gestartet " +#~ "werden." diff --git a/debian/po/es.po b/debian/po/es.po index cb3d101460b22..cbf727c153031 100644 --- a/debian/po/es.po +++ b/debian/po/es.po @@ -41,7 +41,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1_5.0.24-3\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2007-05-28 22:21+0200\n" "Last-Translator: Javier Fernández-Sanguino \n" "Language-Team: Debian l10 Spanish \n" @@ -50,42 +50,35 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" -msgstr "¿Desea realmente continuar con la desactualización?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." msgstr "" -"Existe un archivo con el nombre /var/lib/mysql/debian-*.flag en este sistema." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -#, fuzzy -#| msgid "" -#| "Such file is an indication that a mariadb-server package with a higher " -#| "version has been installed earlier." msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"Este fichero indica que se instaló previamente una versión superior del " -"paquete mariadb-server." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" -"No se puede garantizar que la versión que está instalando pueda usar la base " -"de datos actual." #. Type: note #. Description @@ -143,31 +136,15 @@ msgstr "" "MariaDB más reciente o si hay un paquete «mariadb-server» distinto que los " "está utilizando." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "Start the MariaDB server on boot?" -msgstr "¿Debería ejecutarse el servidor MariaDB al iniciarse el sistema?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"El servidor MariaDB puede iniciarse en el momento de arranque del sistema o " -"manualmente si escribe la orden «/etc/init.d/mysql start»." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "Nueva contraseña para el usuario «root» de MariaDB:" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -177,7 +154,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -185,7 +162,7 @@ msgstr "No se modificará la contraseña si deja el espacio en blanco." #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "New password for the MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -193,13 +170,13 @@ msgstr "Nueva contraseña para el usuario «root» de MariaDB:" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "No se pudo fijar la contraseña para el usuario «root» de MariaDB" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -212,7 +189,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "You should check the account's password after the package installation." msgstr "" "Debería comprobar la contraseña de la cuenta después de la instalación del " @@ -220,7 +197,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " @@ -234,16 +211,52 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" +#~ msgid "Really proceed with downgrade?" +#~ msgstr "¿Desea realmente continuar con la desactualización?" + +#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +#~ msgstr "" +#~ "Existe un archivo con el nombre /var/lib/mysql/debian-*.flag en este " +#~ "sistema." + +#, fuzzy +#~| msgid "" +#~| "Such file is an indication that a mariadb-server package with a higher " +#~| "version has been installed earlier." +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "Este fichero indica que se instaló previamente una versión superior del " +#~ "paquete mariadb-server." + +#~ msgid "" +#~ "There is no guarantee that the version you're currently installing will " +#~ "be able to use the current databases." +#~ msgstr "" +#~ "No se puede garantizar que la versión que está instalando pueda usar la " +#~ "base de datos actual." + +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "¿Debería ejecutarse el servidor MariaDB al iniciarse el sistema?" + +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "El servidor MariaDB puede iniciarse en el momento de arranque del sistema " +#~ "o manualmente si escribe la orden «/etc/init.d/mysql start»." + #~ msgid "" #~ "To use MariaDB, the following entries for users and groups should be " #~ "added to the system:" diff --git a/debian/po/eu.po b/debian/po/eu.po index 3b538bb074e83..22b0f337fd173 100644 --- a/debian/po/eu.po +++ b/debian/po/eu.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: eu\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2009-07-29 11:59+0200\n" "Last-Translator: Piarres Beobide \n" "Language-Team: Euskara \n" @@ -18,41 +18,35 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: KBabel 1.11.4\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" -msgstr "Benetan bertsio zaharragora itzuli nahi duzu?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -msgstr "Sisteman badago /var/lib/mysql/debian-*.flag izeneko fitxategi bat." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -#, fuzzy -#| msgid "" -#| "Such file is an indication that a mariadb-server package with a higher " -#| "version has been installed earlier." msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"Fitxategi honek aurretik bertsio berriagoko mysql-zerbitzari pakete bat " -"instalatu dela adierazten du." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" -"Ezin da ziurtatu instalatzen ari zaren bertsio honek dauden datubaseak " -"erabili ahal izango dituenik." #. Type: note #. Description @@ -109,31 +103,15 @@ msgstr "" "bazara, edo beste mariadb-server pakete bat berau erabiltzen ari bada, " "datuak mantendu egin beharko lirateke." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "Start the MariaDB server on boot?" -msgstr "Abioan MariaDB zerbitzaria abiarazi?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"Sistema abioan MariaDB automatikoki abiarazi daiteke edo eskuz '/etc/init.d/" -"mysql start' eginaz." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "MariaDB \"root\" erabiltzailearen pasahitz berria:" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -143,7 +121,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -151,19 +129,19 @@ msgstr "Eremua hau zurian utziaz gero ez da pasahitza aldatuko." #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "Errepikatu MariaDB \"root\" erabiltzailearen pasahitza:" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Ezin da MariaDB \"root\" erabiltzailearen pasahitza ezarri" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -175,14 +153,14 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "You should check the account's password after the package installation." msgstr "" "Kontuaren pasahitza egiaztatu beharko zenuke paketea instalatu aurretik." #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " @@ -196,16 +174,50 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "Pasahitz sarrera errorea" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "Idatzi dituzun bi pasahitzak ez dira berdina. Mesedez saiatu berriz." +#~ msgid "Really proceed with downgrade?" +#~ msgstr "Benetan bertsio zaharragora itzuli nahi duzu?" + +#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +#~ msgstr "Sisteman badago /var/lib/mysql/debian-*.flag izeneko fitxategi bat." + +#, fuzzy +#~| msgid "" +#~| "Such file is an indication that a mariadb-server package with a higher " +#~| "version has been installed earlier." +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "Fitxategi honek aurretik bertsio berriagoko mysql-zerbitzari pakete bat " +#~ "instalatu dela adierazten du." + +#~ msgid "" +#~ "There is no guarantee that the version you're currently installing will " +#~ "be able to use the current databases." +#~ msgstr "" +#~ "Ezin da ziurtatu instalatzen ari zaren bertsio honek dauden datubaseak " +#~ "erabili ahal izango dituenik." + +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "Abioan MariaDB zerbitzaria abiarazi?" + +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "Sistema abioan MariaDB automatikoki abiarazi daiteke edo eskuz '/etc/init." +#~ "d/mysql start' eginaz." + #~ msgid "" #~ "To use MariaDB, the following entries for users and groups should be " #~ "added to the system:" diff --git a/debian/po/fr.po b/debian/po/fr.po index 2c29513ac0ad0..cae8d7e903b68 100644 --- a/debian/po/fr.po +++ b/debian/po/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: fr\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2009-08-08 14:56+0200\n" "Last-Translator: Christian Perrier \n" "Language-Team: French \n" @@ -20,35 +20,35 @@ msgstr "" "X-Generator: Lokalize 0.3\n" "Plural-Forms: Plural-Forms: nplurals=2; plural=n>1;\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" -msgstr "Faut-il vraiment revenir à la version précédente ?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -msgstr "Un fichier /var/lib/mysql/debian-*.flag est présent sur ce système." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"Cela indique qu'une version plus récente du paquet mariadb-server a été " -"précédemment installée." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." -msgstr "Il n'est pas garanti que cette version puisse en utiliser les données." +"Please manually export/import your data (e.g. with mysqldump) if needed." +msgstr "" #. Type: note #. Description @@ -103,31 +103,15 @@ msgstr "" "Si vous prévoyez d'installer une version plus récente de MariaDB ou si un " "autre paquet mariadb-server les utilise déjà, vous devriez les conserver." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "Start the MariaDB server on boot?" -msgstr "Faut-il lancer MariaDB au démarrage ?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"MariaDB peut être lancé soit au démarrage, soit en entrant la commande « /" -"etc/init.d/mysql start »." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "Nouveau mot de passe du superutilisateur de MariaDB :" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -137,26 +121,26 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "If this field is left blank, the password will not be changed." msgstr "Si ce champ est laissé vide, le mot de passe ne sera pas changé." #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "Confirmation du mot de passe du superutilisateur de MariaDB :" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "" "Impossible de changer le mot de passe de l'utilisateur « root » de MariaDB" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -168,7 +152,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "You should check the account's password after the package installation." msgstr "" "Vous devriez vérifier le mot de passe de ce compte après l'installation du " @@ -176,7 +160,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " @@ -190,18 +174,47 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "Erreur de saisie du mot de passe" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" "Le mot de passe et sa confirmation ne sont pas identiques. Veuillez " "recommencer." +#~ msgid "Really proceed with downgrade?" +#~ msgstr "Faut-il vraiment revenir à la version précédente ?" + +#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +#~ msgstr "Un fichier /var/lib/mysql/debian-*.flag est présent sur ce système." + +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "Cela indique qu'une version plus récente du paquet mariadb-server a été " +#~ "précédemment installée." + +#~ msgid "" +#~ "There is no guarantee that the version you're currently installing will " +#~ "be able to use the current databases." +#~ msgstr "" +#~ "Il n'est pas garanti que cette version puisse en utiliser les données." + +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "Faut-il lancer MariaDB au démarrage ?" + +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "MariaDB peut être lancé soit au démarrage, soit en entrant la commande « /" +#~ "etc/init.d/mysql start »." + #~ msgid "" #~ "To use MySQL, the following entries for users and groups should be added " #~ "to the system:" diff --git a/debian/po/gl.po b/debian/po/gl.po index 8b0dca67223e5..64b5a8d7458f9 100644 --- a/debian/po/gl.po +++ b/debian/po/gl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2007-04-20 09:44+0200\n" "Last-Translator: Jacobo Tarrio \n" "Language-Team: Galician \n" @@ -15,41 +15,35 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" -msgstr "¿Quere pasar a unha versión anterior?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -msgstr "Neste sistema hai un ficheiro chamado /var/lib/mysql/debian-*.flag." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -#, fuzzy -#| msgid "" -#| "Such file is an indication that a mariadb-server package with a higher " -#| "version has been installed earlier." msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"Este ficheiro indica que antes se instalou un paquete mariadb-server cunha " -"versión superior." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" -"Non se pode garantir que a versión que está a instalar poida empregar as " -"bases de datos actuais." #. Type: note #. Description @@ -107,31 +101,15 @@ msgstr "" "recente ou se xa hai un paquete mariadb-server diferente a empregalo, " "debería conservar os datos." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "Start the MariaDB server on boot?" -msgstr "¿Iniciar o servidor MariaDB co ordenador?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"Pódese iniciar automaticamente o servidor MariaDB ao iniciar o ordenador, ou " -"manualmente coa orde \"/etc/init.d/mysql start\"." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "Novo contrasinal para o usuario \"root\" de MariaDB:" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -141,7 +119,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -149,7 +127,7 @@ msgstr "Se deixa o campo en branco, non se ha cambiar o contrasinal." #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "New password for the MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -157,13 +135,13 @@ msgstr "Novo contrasinal para o usuario \"root\" de MariaDB:" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Non se puido establecer o contrasinal do usuario \"root\" de MariaDB" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -175,7 +153,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "You should check the account's password after tha package installation." @@ -184,7 +162,7 @@ msgstr "Debería comprobar o contrasinal da conta trala instalación do paquete. #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " @@ -198,16 +176,50 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" +#~ msgid "Really proceed with downgrade?" +#~ msgstr "¿Quere pasar a unha versión anterior?" + +#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +#~ msgstr "Neste sistema hai un ficheiro chamado /var/lib/mysql/debian-*.flag." + +#, fuzzy +#~| msgid "" +#~| "Such file is an indication that a mariadb-server package with a higher " +#~| "version has been installed earlier." +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "Este ficheiro indica que antes se instalou un paquete mariadb-server " +#~ "cunha versión superior." + +#~ msgid "" +#~ "There is no guarantee that the version you're currently installing will " +#~ "be able to use the current databases." +#~ msgstr "" +#~ "Non se pode garantir que a versión que está a instalar poida empregar as " +#~ "bases de datos actuais." + +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "¿Iniciar o servidor MariaDB co ordenador?" + +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "Pódese iniciar automaticamente o servidor MariaDB ao iniciar o ordenador, " +#~ "ou manualmente coa orde \"/etc/init.d/mysql start\"." + #~ msgid "" #~ "To use MariaDB, the following entries for users and groups should be " #~ "added to the system:" diff --git a/debian/po/it.po b/debian/po/it.po index 076f03c9b7583..7fe2c994a0864 100644 --- a/debian/po/it.po +++ b/debian/po/it.po @@ -2,12 +2,12 @@ # Copyright (C) 2009 Software in the Public Interest # This file is distributed under the same license as the mysql-dfsg-5.1 package. # Luca Monducci , 2006 - 2009. -# +# msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1 5.1.37 italian debconf templates\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2009-08-08 11:03+0200\n" "Last-Translator: Luca Monducci \n" "Language-Team: Italian \n" @@ -16,38 +16,35 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" -msgstr "Procedere realmente con l'abbassamento di versione?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." msgstr "" -"Su questo sistema esiste un file con nome /var/lib/mysql/debian-*.flag." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"Quel file indica che in precedenza è stata installata una versione superiore " -"del pacchetto mariadb-server." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" -"Non è garantito che la versione che si sta installando sia in grado di usare " -"i database presenti." #. Type: note #. Description @@ -103,31 +100,15 @@ msgstr "" "recente oppure se sono già in uso da un altro pacchetto mariadb-server, i " "dati non devono essere eliminati." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "Start the MariaDB server on boot?" -msgstr "Lanciare il server MariaDB all'avvio?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"Il server MariaDB può essere lanciato automaticamente all'avvio del sistema " -"oppure manualmente con il comando «/etc/init.d/mysql start»." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "Nuova password per l'utente «root» di MariaDB:" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -137,25 +118,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "If this field is left blank, the password will not be changed." msgstr "Se questo campo è lasciato vuoto, la password non viene cambiata." #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "Ripetere la password per l'utente «root» di MariaDB:" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Impossibile impostare la password per l'utente «root» di MariaDB" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -168,14 +149,14 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "You should check the account's password after the package installation." msgstr "" "Al termine dell'installazione si deve verificare la password dell'account." #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " @@ -189,13 +170,43 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "Errore di inserimento della password" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "Le due password inserite sono diverse. Riprovare." +#~ msgid "Really proceed with downgrade?" +#~ msgstr "Procedere realmente con l'abbassamento di versione?" + +#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +#~ msgstr "" +#~ "Su questo sistema esiste un file con nome /var/lib/mysql/debian-*.flag." + +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "Quel file indica che in precedenza è stata installata una versione " +#~ "superiore del pacchetto mariadb-server." + +#~ msgid "" +#~ "There is no guarantee that the version you're currently installing will " +#~ "be able to use the current databases." +#~ msgstr "" +#~ "Non è garantito che la versione che si sta installando sia in grado di " +#~ "usare i database presenti." + +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "Lanciare il server MariaDB all'avvio?" + +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "Il server MariaDB può essere lanciato automaticamente all'avvio del " +#~ "sistema oppure manualmente con il comando «/etc/init.d/mysql start»." diff --git a/debian/po/ja.po b/debian/po/ja.po index 30b54ff447d37..1d4d5d3689631 100644 --- a/debian/po/ja.po +++ b/debian/po/ja.po @@ -16,7 +16,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1 5.1.37-1\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2009-09-01 08:25+0900\n" "Last-Translator: Hideki Yamane (Debian-JP) \n" "Language-Team: Japanese \n" @@ -25,39 +25,35 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" -msgstr "本当にダウングレードを実行しますか?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." msgstr "" -"このシステムには /var/lib/mysql/debian-*.flag という名前のファイルが存在して" -"います。" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"このファイルが意味するのは、以前により新しいバージョンの mariadb-server パッ" -"ケージがインストールされていたことを示します。" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" -"このデータベースを現在インストールしようとしているバージョンで使えるかどうか" -"は保証できません。" #. Type: note #. Description @@ -111,31 +107,15 @@ msgstr "" "ケージを削除しようとしている、あるいは別の mariadb-server パッケージを既に" "使っている場合、データは保持する必要があります。" -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "Start the MariaDB server on boot?" -msgstr "MariaDB をシステム起動時に開始しますか?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"MariaDB の起動方法について、システム起動時に自動的に開始するか、あるいは '/" -"etc/init.d/mysql start' と手で入力して起動するかを選べます。" - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "MariaDB の \"root\" ユーザに対する新しいパスワード:" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -145,25 +125,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "If this field is left blank, the password will not be changed." msgstr "この値を空のままにしておいた場合は、パスワードは変更されません。" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "MariaDB の \"root\" ユーザに対する新しいパスワード:" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "MariaDB の \"root\" ユーザのパスワードを設定できません" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -175,14 +155,14 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "You should check the account's password after the package installation." msgstr "" "パッケージのインストール後、アカウントのパスワードを確認する必要があります。" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " @@ -195,13 +175,44 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "パスワード入力エラー" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "入力された二つのパスワードが一致しません。再入力してください。" +#~ msgid "Really proceed with downgrade?" +#~ msgstr "本当にダウングレードを実行しますか?" + +#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +#~ msgstr "" +#~ "このシステムには /var/lib/mysql/debian-*.flag という名前のファイルが存在" +#~ "しています。" + +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "このファイルが意味するのは、以前により新しいバージョンの mariadb-server " +#~ "パッケージがインストールされていたことを示します。" + +#~ msgid "" +#~ "There is no guarantee that the version you're currently installing will " +#~ "be able to use the current databases." +#~ msgstr "" +#~ "このデータベースを現在インストールしようとしているバージョンで使えるかどう" +#~ "かは保証できません。" + +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "MariaDB をシステム起動時に開始しますか?" + +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "MariaDB の起動方法について、システム起動時に自動的に開始するか、あるいは " +#~ "'/etc/init.d/mysql start' と手で入力して起動するかを選べます。" diff --git a/debian/po/nb.po b/debian/po/nb.po index c3230913e01e2..ca8fd6e041d73 100644 --- a/debian/po/nb.po +++ b/debian/po/nb.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql_nb\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2007-02-18 12:13+0100\n" "Last-Translator: Bjørn Steensrud \n" "Language-Team: Norwegian Bokmål \n" @@ -17,43 +17,34 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.2\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -#, fuzzy -#| msgid "Do you really want to downgrade?" -msgid "Really proceed with downgrade?" -msgstr "Er du sikker på at du vil nedgradere?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -#, fuzzy -#| msgid "" -#| "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates " -#| "that a mysql-server package with a higher version has been installed " -#| "before. It can not be guaranteed that this version can use its data." msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"ADVARSEL: Fila /var/lib/mysql/debian-*.flag finnes. Dette viser at en " -"mariadb-server-pakke med et høyere versjonsnummer har vært installert før. " -"Det kan ikke garanteres at denne versjonen kan bruke data fra den høyere " -"versjonen." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" #. Type: note @@ -111,31 +102,9 @@ msgstr "" "beholdes hvis det bare skal installeres en høyere MariaDB-versjon, eller " "hvis en annen mariadb-server-pakke allerede bruker den." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -#, fuzzy -#| msgid "Should MySQL start on boot?" -msgid "Start the MariaDB server on boot?" -msgstr "Skal MariaDB startes ved maskinoppstart?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -#, fuzzy -#| msgid "" -#| "The MySQL can start automatically on boot time or only if you manually " -#| "type '/etc/init.d/mysql start'." -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"MariaDB kan startes automatisk når maskinen starter, eller bare hvis du " -"skriver «/etc/init.d/mysql start»." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "New password for MySQL \"root\" user:" msgid "New password for the MariaDB \"root\" user:" @@ -143,7 +112,7 @@ msgstr "Nytt passord for MariaDBs «root»-bruker:" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "" #| "It is highly recommended that you set a password for the MySQL " @@ -157,13 +126,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "If this field is left blank, the password will not be changed." msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "New password for MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -171,7 +140,7 @@ msgstr "Nytt passord for MariaDBs «root»-bruker:" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "Unable to set password for MySQL \"root\" user" msgid "Unable to set password for the MariaDB \"root\" user" @@ -179,7 +148,7 @@ msgstr "Klarer ikke angi passord for MariaDBs «root»-bruker" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "It seems an error occurred while setting the password for the MySQL " @@ -198,13 +167,13 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "You should check the account's password after the package installation." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." @@ -212,16 +181,51 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" +#, fuzzy +#~| msgid "Do you really want to downgrade?" +#~ msgid "Really proceed with downgrade?" +#~ msgstr "Er du sikker på at du vil nedgradere?" + +#, fuzzy +#~| msgid "" +#~| "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates " +#~| "that a mysql-server package with a higher version has been installed " +#~| "before. It can not be guaranteed that this version can use its data." +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "ADVARSEL: Fila /var/lib/mysql/debian-*.flag finnes. Dette viser at en " +#~ "mariadb-server-pakke med et høyere versjonsnummer har vært installert " +#~ "før. Det kan ikke garanteres at denne versjonen kan bruke data fra den " +#~ "høyere versjonen." + +#, fuzzy +#~| msgid "Should MySQL start on boot?" +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "Skal MariaDB startes ved maskinoppstart?" + +#, fuzzy +#~| msgid "" +#~| "The MySQL can start automatically on boot time or only if you manually " +#~| "type '/etc/init.d/mysql start'." +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "MariaDB kan startes automatisk når maskinen starter, eller bare hvis du " +#~ "skriver «/etc/init.d/mysql start»." + #~ msgid "" #~ "Support MySQL connections from hosts running Debian \"sarge\" or older?" #~ msgstr "" diff --git a/debian/po/nl.po b/debian/po/nl.po index 900fcaa582248..b05a30d720d54 100644 --- a/debian/po/nl.po +++ b/debian/po/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1 5.0.30-1\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2006-02-19 10:20+0100\n" "Last-Translator: Thijs Kinkhorst \n" "Language-Team: Debian-Dutch \n" @@ -16,44 +16,34 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -#, fuzzy -#| msgid "Do you really want to downgrade?" -msgid "Really proceed with downgrade?" -msgstr "Wilt u echt een oude versie herstellen?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -#, fuzzy -#| msgid "" -#| "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates " -#| "that a mysql-server package with a higher version has been installed " -#| "before. It can not be guaranteed that this version can use its data." msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"Waarschuwing: waarschijnlijk is een hogere versie van het mariadb-server " -"pakket geïnstalleerd geweest (het bestand /var/lib/mysql/debian-*.flag " -"bestaat). Er is geen garantie dat de gegevensbestanden, bewerkt met die " -"hogere versie, kunnen worden gebruikt met de versie van mysql die u nu " -"installeert." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" #. Type: note @@ -112,31 +102,9 @@ msgstr "" "een ander mariadb-serverpakket de datamap al gebruikt, dan zou de data " "moeten worden behouden." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -#, fuzzy -#| msgid "Should MySQL start on boot?" -msgid "Start the MariaDB server on boot?" -msgstr "Moet MariaDB starten als de computer start?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -#, fuzzy -#| msgid "" -#| "The MySQL can start automatically on boot time or only if you manually " -#| "type '/etc/init.d/mysql start'." -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"MariaDB kan automatisch starten bij het starten van de computer, of slechts " -"wanneer u '/etc/init.d/mysql start' handmatig uitvoert." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "New password for MySQL \"root\" user:" msgid "New password for the MariaDB \"root\" user:" @@ -144,7 +112,7 @@ msgstr "Nieuw wachtwoord voor de MariaDB \"root\"-gebruiker:" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "" #| "It is highly recommended that you set a password for the MySQL " @@ -158,13 +126,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "If this field is left blank, the password will not be changed." msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "New password for MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -172,7 +140,7 @@ msgstr "Nieuw wachtwoord voor de MariaDB \"root\"-gebruiker:" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "Unable to set password for MySQL \"root\" user" msgid "Unable to set password for the MariaDB \"root\" user" @@ -180,7 +148,7 @@ msgstr "Kan het wachtwoord voor de MariaDB \"root\"-gebruiker niet instellen" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "It seems an error occurred while setting the password for the MySQL " @@ -199,13 +167,13 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "You should check the account's password after the package installation." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." @@ -213,16 +181,52 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" +#, fuzzy +#~| msgid "Do you really want to downgrade?" +#~ msgid "Really proceed with downgrade?" +#~ msgstr "Wilt u echt een oude versie herstellen?" + +#, fuzzy +#~| msgid "" +#~| "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates " +#~| "that a mysql-server package with a higher version has been installed " +#~| "before. It can not be guaranteed that this version can use its data." +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "Waarschuwing: waarschijnlijk is een hogere versie van het mariadb-server " +#~ "pakket geïnstalleerd geweest (het bestand /var/lib/mysql/debian-*.flag " +#~ "bestaat). Er is geen garantie dat de gegevensbestanden, bewerkt met die " +#~ "hogere versie, kunnen worden gebruikt met de versie van mysql die u nu " +#~ "installeert." + +#, fuzzy +#~| msgid "Should MySQL start on boot?" +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "Moet MariaDB starten als de computer start?" + +#, fuzzy +#~| msgid "" +#~| "The MySQL can start automatically on boot time or only if you manually " +#~| "type '/etc/init.d/mysql start'." +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "MariaDB kan automatisch starten bij het starten van de computer, of " +#~ "slechts wanneer u '/etc/init.d/mysql start' handmatig uitvoert." + #~ msgid "" #~ "Support MySQL connections from hosts running Debian \"sarge\" or older?" #~ msgstr "" diff --git a/debian/po/pt.po b/debian/po/pt.po index d612b83f943a0..069d74348edf4 100644 --- a/debian/po/pt.po +++ b/debian/po/pt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2007-05-05 21:01+0100\n" "Last-Translator: Miguel Figueiredo \n" "Language-Team: Portuguese \n" @@ -16,41 +16,35 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" -msgstr "Deseja mesmo fazer downgrade?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -msgstr "Existe um ficheiro chamado /var/lib/mysql/debian-*.flag neste sistema." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -#, fuzzy -#| msgid "" -#| "Such file is an indication that a mariadb-server package with a higher " -#| "version has been installed earlier." msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"Tal ficheiro significa que anteriormente foi instalado um pacote mariadb-" -"server com um número de versão superior." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" -"Não existe nenhuma garantia que a versão que está actualmente a instalar " -"seja capaz de utilizar as bases de dados actuais." #. Type: note #. Description @@ -107,31 +101,15 @@ msgstr "" "versão mais recente ou se um pacote mariadb-server já está os está a " "utilizar, os dados devem ser mantidos." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "Start the MariaDB server on boot?" -msgstr "Iniciar o servidor MariaDB no arranque?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"O MariaDB pode ser automaticamente lançado no arranque ou manualmente " -"através do comando '/etc/init.d/mysql start'." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "Nova palavra-passe para o utilizador \"root\" do MariaDB:" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -141,7 +119,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -150,7 +128,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "New password for the MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -158,7 +136,7 @@ msgstr "Nova palavra-passe para o utilizador \"root\" do MariaDB:" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "" "Não foi possível definir a palavra-passe para o utilizador \"root\" do " @@ -166,7 +144,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -179,7 +157,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "You should check the account's password after tha package installation." @@ -189,7 +167,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " @@ -203,16 +181,51 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" +#~ msgid "Really proceed with downgrade?" +#~ msgstr "Deseja mesmo fazer downgrade?" + +#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +#~ msgstr "" +#~ "Existe um ficheiro chamado /var/lib/mysql/debian-*.flag neste sistema." + +#, fuzzy +#~| msgid "" +#~| "Such file is an indication that a mariadb-server package with a higher " +#~| "version has been installed earlier." +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "Tal ficheiro significa que anteriormente foi instalado um pacote mariadb-" +#~ "server com um número de versão superior." + +#~ msgid "" +#~ "There is no guarantee that the version you're currently installing will " +#~ "be able to use the current databases." +#~ msgstr "" +#~ "Não existe nenhuma garantia que a versão que está actualmente a instalar " +#~ "seja capaz de utilizar as bases de dados actuais." + +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "Iniciar o servidor MariaDB no arranque?" + +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "O MariaDB pode ser automaticamente lançado no arranque ou manualmente " +#~ "através do comando '/etc/init.d/mysql start'." + #~ msgid "" #~ "To use MariaDB, the following entries for users and groups should be " #~ "added to the system:" diff --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po index 46ffefb825986..03d564da79b95 100644 --- a/debian/po/pt_BR.po +++ b/debian/po/pt_BR.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2007-04-21 15:59-0300\n" "Last-Translator: André Luís Lopes \n" "Language-Team: Debian-BR Project \n" @@ -19,41 +19,35 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "pt_BR utf-8\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" -msgstr "Realmente proceder com o rebaixamento de versão?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -msgstr "Um arquivo de nome /var/lib/mysql/debian-*.flag existe no sistema." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -#, fuzzy -#| msgid "" -#| "Such file is an indication that a mariadb-server package with a higher " -#| "version has been installed earlier." msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"A presença de um arquivo como este é uma indicação de que um pacote mariadb-" -"server com um número de versão mais alto já foi instalado anteriormente." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" -"Não há garantias de que a versão que você está instalando no momento " -"conseguirá utilizar as bases de dados existentes." #. Type: note #. Description @@ -110,31 +104,15 @@ msgstr "" "versão mais recente ou, caso uma versão diferente do pacote mariadb-server " "esteja sendo utilizada, os dados deverão ser mantidos." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "Start the MariaDB server on boot?" -msgstr "Iniciar o servidor MariaDB junto a inicialização da máquina?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"O servidor MariaDB pode ser iniciado automaticamente junto a inicialização " -"da máquina ou manualmente com o comando '/etc/init.d/mysql start'." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "Nova senha para o usuário \"root\" do MariaDB:" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -144,7 +122,7 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "If that field is left blank, the password will not be changed." msgid "If this field is left blank, the password will not be changed." @@ -152,7 +130,7 @@ msgstr "Caso este campo seja deixado em branco, a senha não sera mudada." #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "New password for the MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -160,13 +138,13 @@ msgstr "Nova senha para o usuário \"root\" do MariaDB:" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Impossível definir senha para o usuário \"root\" do MariaDB" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -179,7 +157,7 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "You should check the account's password after tha package installation." @@ -188,7 +166,7 @@ msgstr "Você deverá checar a senha dessa conta após a instalação deste paco #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mysql-server-5.1/README.Debian file for " @@ -202,16 +180,52 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" +#~ msgid "Really proceed with downgrade?" +#~ msgstr "Realmente proceder com o rebaixamento de versão?" + +#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +#~ msgstr "Um arquivo de nome /var/lib/mysql/debian-*.flag existe no sistema." + +#, fuzzy +#~| msgid "" +#~| "Such file is an indication that a mariadb-server package with a higher " +#~| "version has been installed earlier." +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "A presença de um arquivo como este é uma indicação de que um pacote " +#~ "mariadb-server com um número de versão mais alto já foi instalado " +#~ "anteriormente." + +#~ msgid "" +#~ "There is no guarantee that the version you're currently installing will " +#~ "be able to use the current databases." +#~ msgstr "" +#~ "Não há garantias de que a versão que você está instalando no momento " +#~ "conseguirá utilizar as bases de dados existentes." + +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "Iniciar o servidor MariaDB junto a inicialização da máquina?" + +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "O servidor MariaDB pode ser iniciado automaticamente junto a " +#~ "inicialização da máquina ou manualmente com o comando '/etc/init.d/mysql " +#~ "start'." + #~ msgid "" #~ "To use MariaDB, the following entries for users and groups should be " #~ "added to the system:" diff --git a/debian/po/ro.po b/debian/po/ro.po index c960e3d2eb433..45ed4aff10b03 100644 --- a/debian/po/ro.po +++ b/debian/po/ro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: po-debconf://mysql-dfsg\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2006-12-20 21:27+0200\n" "Last-Translator: stan ioan-eugen \n" "Language-Team: romanian \n" @@ -17,43 +17,34 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -#, fuzzy -#| msgid "Do you really want to downgrade?" -msgid "Really proceed with downgrade?" -msgstr "Sunteţi sigur că doriţi să instalaţi o versiune mai veche?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -#, fuzzy -#| msgid "" -#| "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates " -#| "that a mysql-server package with a higher version has been installed " -#| "before. It can not be guaranteed that this version can use its data." msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"AVERTISMENT: Fişierul /var/lib/mysql/debian-*.flag există. Acest lucru " -"indică faptul că anterior a fost instalată o versiune nouă a pachetului " -"mariadb-server. Nu se poate garanta că versiunea instalată acum poate folosi " -"datele versiunii instalate anterior." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" #. Type: note @@ -111,31 +102,9 @@ msgstr "" "doar să instalaţi o versiune nouă MariaDB sau datele sunt folosite de către " "un alt pachet mariadb-server, atunci ar trebui păstraţi datele." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -#, fuzzy -#| msgid "Should MySQL start on boot?" -msgid "Start the MariaDB server on boot?" -msgstr "Doriţi ca MariaDB să pornească la initializarea sistemului?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -#, fuzzy -#| msgid "" -#| "The MySQL can start automatically on boot time or only if you manually " -#| "type '/etc/init.d/mysql start'." -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"MariaDB poate porni automat la iniţializarea sistemului sau doar dacă rulaţi " -"comanda „/etc/init.d/mysql start”." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "New password for MySQL \"root\" user:" msgid "New password for the MariaDB \"root\" user:" @@ -143,7 +112,7 @@ msgstr "Noua parolă pentru utilizatorul „root” al MariaDB:" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 #, fuzzy #| msgid "" #| "It is highly recommended that you set a password for the MySQL " @@ -157,13 +126,13 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "If this field is left blank, the password will not be changed." msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 #, fuzzy #| msgid "New password for MySQL \"root\" user:" msgid "Repeat password for the MariaDB \"root\" user:" @@ -171,7 +140,7 @@ msgstr "Noua parolă pentru utilizatorul „root” al MariaDB:" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "Unable to set password for MySQL \"root\" user" msgid "Unable to set password for the MariaDB \"root\" user" @@ -179,7 +148,7 @@ msgstr "Nu s-a putut stabili parola pentru utilizatorul „root” al MariaDB" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "It seems an error occurred while setting the password for the MySQL " @@ -198,13 +167,13 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "You should check the account's password after the package installation." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." @@ -212,16 +181,51 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" +#, fuzzy +#~| msgid "Do you really want to downgrade?" +#~ msgid "Really proceed with downgrade?" +#~ msgstr "Sunteţi sigur că doriţi să instalaţi o versiune mai veche?" + +#, fuzzy +#~| msgid "" +#~| "WARNING: The file /var/lib/mysql/debian-*.flag exists. This indicates " +#~| "that a mysql-server package with a higher version has been installed " +#~| "before. It can not be guaranteed that this version can use its data." +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "AVERTISMENT: Fişierul /var/lib/mysql/debian-*.flag există. Acest lucru " +#~ "indică faptul că anterior a fost instalată o versiune nouă a pachetului " +#~ "mariadb-server. Nu se poate garanta că versiunea instalată acum poate " +#~ "folosi datele versiunii instalate anterior." + +#, fuzzy +#~| msgid "Should MySQL start on boot?" +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "Doriţi ca MariaDB să pornească la initializarea sistemului?" + +#, fuzzy +#~| msgid "" +#~| "The MySQL can start automatically on boot time or only if you manually " +#~| "type '/etc/init.d/mysql start'." +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "MariaDB poate porni automat la iniţializarea sistemului sau doar dacă " +#~ "rulaţi comanda „/etc/init.d/mysql start”." + #~ msgid "Cannot upgrade if ISAM tables are present!" #~ msgstr "Nu se poate face actualizarea dacă sunt prezente tabele ISAM!" diff --git a/debian/po/ru.po b/debian/po/ru.po index 096e9babe0965..213f64f625376 100644 --- a/debian/po/ru.po +++ b/debian/po/ru.po @@ -18,7 +18,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1 5.1.37-1\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2009-08-06 20:27+0400\n" "Last-Translator: Yuri Kozlov \n" "Language-Team: Russian \n" @@ -30,37 +30,35 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" -msgstr "Действительно установить более старую версию?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -msgstr "В системе найден файл /var/lib/mysql/debian-*.flag." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"Это означает, что ранее уже был установлен пакет mariadb-server более новой " -"версии." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" -"Нет гарантий, что версия, которая устанавливается сейчас, будет способна " -"работать с имеющимися базами данных." #. Type: note #. Description @@ -113,31 +111,15 @@ msgstr "" "есть другие пакеты mariadb-server, использующие этот каталог, то данные " "лучше сохранить." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "Start the MariaDB server on boot?" -msgstr "Запускать MariaDB при загрузке системы?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"Сервер MariaDB можно запускать автоматически при загрузке системы или " -"вручную по команде '/etc/init.d/mysql start'." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "Новый пароль для MariaDB пользователя \"root\":" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -147,25 +129,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "If this field is left blank, the password will not be changed." msgstr "Если оставить поле пустым, то пароль изменён не будет." #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "Повторите ввод пароля для MariaDB пользователя \"root\":" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Невозможно задать пароль MariaDB пользователю \"root\"" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -177,13 +159,13 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "You should check the account's password after the package installation." msgstr "Проверьте пароль учётной записи после установки пакета." #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " @@ -196,13 +178,42 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "Ошибка ввода пароля" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "Два введённых пароля не одинаковы. Повторите ввод." +#~ msgid "Really proceed with downgrade?" +#~ msgstr "Действительно установить более старую версию?" + +#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +#~ msgstr "В системе найден файл /var/lib/mysql/debian-*.flag." + +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "Это означает, что ранее уже был установлен пакет mariadb-server более " +#~ "новой версии." + +#~ msgid "" +#~ "There is no guarantee that the version you're currently installing will " +#~ "be able to use the current databases." +#~ msgstr "" +#~ "Нет гарантий, что версия, которая устанавливается сейчас, будет способна " +#~ "работать с имеющимися базами данных." + +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "Запускать MariaDB при загрузке системы?" + +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "Сервер MariaDB можно запускать автоматически при загрузке системы или " +#~ "вручную по команде '/etc/init.d/mysql start'." diff --git a/debian/po/sv.po b/debian/po/sv.po index 522403a049ead..b7aff17f1a648 100644 --- a/debian/po/sv.po +++ b/debian/po/sv.po @@ -1,14 +1,14 @@ # Translation of mysql-dfsg-5.1 debconf template to Swedish # Copyright (C) 2009 Martin Bagge # This file is distributed under the same license as the mysql-dfsg-5.1 package. -# +# # Andreas Henriksson , 2007 # Martin Bagge , 2009 msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-5.1 5.0.21-3\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2009-09-08 21:42+0100\n" "Last-Translator: Martin Bagge \n" "Language-Team: Swedish \n" @@ -19,37 +19,35 @@ msgstr "" "X-Poedit-Language: Swedish\n" "X-Poedit-Country: Sweden\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" -msgstr "Vill du verkligen genomföra nedgraderingen?" +msgid "The old data directory will be saved at new location" +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." -msgstr "En fil med namnet /var/lib/mysql/debian-*.flag hittades i systemet." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." +msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -"En sådan fil är en indikation på att paketet mariadb-server med ett högre " -"versionsnummer har installerats tidigare." -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" -"Det finns ingen garanti för att den version som du håller på att installera " -"kommer att kunna använda de aktuella databaserna." #. Type: note #. Description @@ -105,31 +103,15 @@ msgstr "" "en nyare version eller om en annan mariadb-server redan använder filerna ska " "de inte raderas." -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "Start the MariaDB server on boot?" -msgstr "Ska MariaDB startas vid systemets uppstart?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"MariaDB-servern kan startas vid systemets uppstart eller manuellt med " -"kommandot \"/etc/init.d/mysql start\"." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "Nytt lösenord för MariaDBs \"root\"-användare:" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -139,25 +121,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "If this field is left blank, the password will not be changed." msgstr "Om detta fält lämnas tom kommer lösenordet inte att ändras." #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "Repetera lösenordet för MariaDBs \"root\"-användare:" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "Kunde inte sätta lösenord för MariaDBs \"root\"-användare" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -170,13 +152,13 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "You should check the account's password after the package installation." msgstr "Du bör kontrollera kontots lösenord efter installationen av paketet." #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 #, fuzzy #| msgid "" #| "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " @@ -190,16 +172,46 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "Fel vid inmatning av lösenord" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "De två lösenorden du angav stämde inte överrens. Prova igen." +#~ msgid "Really proceed with downgrade?" +#~ msgstr "Vill du verkligen genomföra nedgraderingen?" + +#~ msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +#~ msgstr "En fil med namnet /var/lib/mysql/debian-*.flag hittades i systemet." + +#~ msgid "" +#~ "Such a file is an indication that a mariadb-server package with a higher " +#~ "version has been installed previously." +#~ msgstr "" +#~ "En sådan fil är en indikation på att paketet mariadb-server med ett högre " +#~ "versionsnummer har installerats tidigare." + +#~ msgid "" +#~ "There is no guarantee that the version you're currently installing will " +#~ "be able to use the current databases." +#~ msgstr "" +#~ "Det finns ingen garanti för att den version som du håller på att " +#~ "installera kommer att kunna använda de aktuella databaserna." + +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "Ska MariaDB startas vid systemets uppstart?" + +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "MariaDB-servern kan startas vid systemets uppstart eller manuellt med " +#~ "kommandot \"/etc/init.d/mysql start\"." + #~ msgid "" #~ "To use MySQL, the following entries for users and groups should be added " #~ "to the system:" diff --git a/debian/po/templates.pot b/debian/po/templates.pot index 7032c34bc20d1..258dcde2c811b 100644 --- a/debian/po/templates.pot +++ b/debian/po/templates.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: mariadb-10.2\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,32 +17,34 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" +msgid "The old data directory will be saved at new location" msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" #. Type: note @@ -90,29 +92,15 @@ msgid "" "the data should be kept." msgstr "" -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "Start the MariaDB server on boot?" -msgstr "" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -120,25 +108,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "If this field is left blank, the password will not be changed." msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -147,13 +135,13 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "You should check the account's password after the package installation." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." @@ -161,12 +149,12 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" diff --git a/debian/po/tr.po b/debian/po/tr.po index 81c20ba3b3e44..079a7198d8bd6 100644 --- a/debian/po/tr.po +++ b/debian/po/tr.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: mysql-dfsg-4.1\n" "Report-Msgid-Bugs-To: mariadb-10.2@packages.debian.org\n" -"POT-Creation-Date: 2012-01-12 13:08+0100\n" +"POT-Creation-Date: 2016-10-08 01:26+0300\n" "PO-Revision-Date: 2004-06-05 08:53+0300\n" "Last-Translator: Gürkan Aslan \n" "Language-Team: Turkish \n" @@ -16,32 +16,34 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "Really proceed with downgrade?" +msgid "The old data directory will be saved at new location" msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 -msgid "A file named /var/lib/mysql/debian-*.flag exists on this system." +msgid "" +"A file named /var/lib/mysql/debian-*.flag exists on this system. The number " +"indicates a database binary format version that cannot automatically be " +"upgraded (or downgraded)." msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"Such a file is an indication that a mariadb-server package with a higher " -"version has been installed previously." +"Therefore the previous data directory will be renamed to /var/lib/mysql-* " +"and a new data directory will be initialized at /var/lib/mysql." msgstr "" -#. Type: boolean +#. Type: note #. Description #: ../mariadb-server-10.2.templates:2001 msgid "" -"There is no guarantee that the version you're currently installing will be " -"able to use the current databases." +"Please manually export/import your data (e.g. with mysqldump) if needed." msgstr "" #. Type: note @@ -91,35 +93,15 @@ msgid "" "the data should be kept." msgstr "" -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -#, fuzzy -#| msgid "Should MySQL start on boot?" -msgid "Start the MariaDB server on boot?" -msgstr "MariaDB açılış sırasında başlatılsın mı?" - -#. Type: boolean -#. Description -#: ../mariadb-server-10.2.templates:5001 -#, fuzzy -msgid "" -"The MariaDB server can be launched automatically at boot time or manually " -"with the '/etc/init.d/mysql start' command." -msgstr "" -"MariaDB açılış sırasında veya '/etc/init.d/mysql start' komutunu vermeniz " -"halinde elle başlatılabilir. Eğer açılışta otomatik olarak başlatılmasını " -"istiyorsanız burada 'evet'i seçin." - #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "New password for the MariaDB \"root\" user:" msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "" "While not mandatory, it is highly recommended that you set a password for " "the MariaDB administrative \"root\" user." @@ -127,25 +109,25 @@ msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:6001 +#: ../mariadb-server-10.2.templates:5001 msgid "If this field is left blank, the password will not be changed." msgstr "" #. Type: password #. Description -#: ../mariadb-server-10.2.templates:7001 +#: ../mariadb-server-10.2.templates:6001 msgid "Repeat password for the MariaDB \"root\" user:" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "Unable to set password for the MariaDB \"root\" user" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "An error occurred while setting the password for the MariaDB administrative " "user. This may have happened because the account already has a password, or " @@ -154,13 +136,13 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "You should check the account's password after the package installation." msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:8001 +#: ../mariadb-server-10.2.templates:7001 msgid "" "Please read the /usr/share/doc/mariadb-server-10.2/README.Debian file for " "more information." @@ -168,16 +150,30 @@ msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "Password input error" msgstr "" #. Type: error #. Description -#: ../mariadb-server-10.2.templates:9001 +#: ../mariadb-server-10.2.templates:8001 msgid "The two passwords you entered were not the same. Please try again." msgstr "" +#, fuzzy +#~| msgid "Should MySQL start on boot?" +#~ msgid "Start the MariaDB server on boot?" +#~ msgstr "MariaDB açılış sırasında başlatılsın mı?" + +#, fuzzy +#~ msgid "" +#~ "The MariaDB server can be launched automatically at boot time or manually " +#~ "with the '/etc/init.d/mysql start' command." +#~ msgstr "" +#~ "MariaDB açılış sırasında veya '/etc/init.d/mysql start' komutunu vermeniz " +#~ "halinde elle başlatılabilir. Eğer açılışta otomatik olarak başlatılmasını " +#~ "istiyorsanız burada 'evet'i seçin." + #~ msgid "" #~ "To use mysql you must install an equivalent user and group to the " #~ "following and ensure yourself that /var/lib/mysql has the right " diff --git a/debian/rules b/debian/rules index 1f88b3f4847ee..6919fcc14b424 100755 --- a/debian/rules +++ b/debian/rules @@ -1,182 +1,132 @@ #!/usr/bin/make -f export DH_VERBOSE=1 -export DEB_BUILD_HARDENING=1 -PACKAGE=mariadb-10.2 +# enable Debian Hardening +# see: https://wiki.debian.org/Hardening +export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk -include /usr/share/dpatch/dpatch.make - -TMP=$(CURDIR)/debian/tmp/ - -ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH) -ARCH_OS = $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH) +ARCH_OS := $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS) +BUILDDIR := builddir DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEBVERSION = $(shell dpkg-parsechangelog | awk '/^Version: / { print $$2 }' | sed 's/^.*-//' ) - +DEB_BUILD_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM) +DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH) +DEBVERSION := $(shell dpkg-parsechangelog | awk '/^Version: / { print $$2 }' | sed 's/^.*-//' ) DEB_SOURCE_PACKAGE ?= $(strip $(shell egrep '^Source: ' debian/control | cut -f 2 -d ':')) DEB_VERSION ?= $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') DEB_NOEPOCH_VERSION ?= $(shell echo $(DEB_VERSION) | cut -d: -f2-) DEB_UPSTREAM_VERSION ?= $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//') DEB_UPSTREAM_VERSION_MAJOR_MINOR := $(shell echo $(DEB_UPSTREAM_VERSION) | sed -r -n 's/^([0-9]+\.[0-9]+).*/\1/p') +DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) +DISTRIBUTION := $(shell lsb_release -i -s) +RELEASE := $(shell lsb_release -r -s) +TMP:=$(CURDIR)/debian/tmp -DISTRIBUTION = $(shell lsb_release -i -s) -RELEASE = $(shell lsb_release -r -s) - -MAKE_J = -j$(shell if [ -f /proc/cpuinfo ] ; then grep -c processor.* /proc/cpuinfo ; else echo 1 ; fi) -ifeq (${MAKE_J}, -j0) - MAKE_J = -j1 -endif +CC := $(DEB_HOST_GNU_TYPE)-gcc +CXX := $(DEB_HOST_GNU_TYPE)-g++ # Parallel build support as advised # at https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-options ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) MAKEFLAGS += -j $(NUMJOBS) +else + # NUMJOBS cannot be empty as it is used as a parameter to mtr, default to 1. + NUMJOBS = 1 endif - -USE_ASSEMBLER=--enable-assembler - -BUILDDIR = builddir -builddir = $(BUILDDIR) - -# This causes seg11 crashes if LDAP is used for groups in /etc/nsswitch.conf -# so it is disabled by default although, according to MySQL, it brings >10% -# performance gain if enabled. See #299382. -ifeq ($(STATIC_MYSQLD), 1) - USE_STATIC_MYSQLD=--with-mysqld-ldflags=-all-static +# Ignore test suite exit code on unstable platforms +ifneq (,$(filter $(ARCH), mips mipsel)) + TESTSUITE_FAIL_CMD:=true +else + TESTSUITE_FAIL_CMD:=exit 1 endif -configure: patch configure-stamp -configure-stamp: - @echo "RULES.$@" - dh_testdir - -ifneq ($(ARCH_OS),hurd) - if [ ! -d /proc/self ]; then echo "/proc IS NEEDED" 1>&2; exit 1; fi +# Skip TokuDB if arch is not amd64 +ifneq ($(ARCH), amd64) + CMAKEFLAGS += -DWITHOUT_TOKUDB=true endif - ( test -d $(builddir) || mkdir $(builddir) ) && cd $(builddir) && \ - sh -c 'PATH=$${MYSQL_BUILD_PATH:-"/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin"} \ - CC=$${MYSQL_BUILD_CC:-gcc} \ - CFLAGS=$${MYSQL_BUILD_CFLAGS:-"-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wno-uninitialized"} \ - CXX=$${MYSQL_BUILD_CXX:-g++} \ - CXXFLAGS=$${MYSQL_BUILD_CXXFLAGS:-"-O2 -fno-omit-frame-pointer -g -pipe -Wall -Wno-uninitialized"} \ - cmake .. \ - -DMYSQL_SERVER_SUFFIX="-$(DEBVERSION)" \ - -DBUILD_CONFIG=mysql_release \ - -DCOMPILATION_COMMENT="mariadb.org binary distribution" \ - -DSYSTEM_TYPE="debian-linux-gnu" \ - -DDEB=ubuntu' - - touch $@ - -build: build-stamp +# Add support for verbose builds +MAKEFLAGS += VERBOSE=1 -build-stamp: configure +override_dh_auto_clean: @echo "RULES.$@" dh_testdir - - cd $(builddir) && $(MAKE) $(MAKE_J) $(AM_EXTRA_MAKEFLAGS) - -ifeq ($(findstring nocheck,$(DEB_BUILD_OPTIONS)),) - if [ ! -f testsuite-stamp ] ; then \ - cd $(builddir)/mysql-test && ./mtr --force --mem --parallel=$(NUMJOBS) --skip-rpl --suite=main; \ - fi -endif - - touch testsuite-stamp - - touch build-stamp - -clean: clean-patched unpatch - rm -rf debian/patched -clean-patched: - @echo "RULES.clean-patched" - dh_testdir dh_testroot - rm -f configure-stamp* - rm -f build-stamp* - rm -f testsuite-stamp - # - [ ! -f Makefile ] || $(MAKE) clean [ ! -d mysql-test/var ] || rm -rf mysql-test/var - # rm -rf $(BUILDDIR) + debconf-updatepo # Update po-files when clean runs before each build - debconf-updatepo - dh_clean -v - +override_dh_prep: + # Don't clean /tmp/ away, it is needed by all binary packages -install: build +override_dh_auto_configure: @echo "RULES.$@" dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - # some self written manpages which hopefully - # gets overwritten sooner or later with upstreams - mkdir -p $(TMP)/usr/share/man/man1/ - mkdir -p $(TMP)/usr/share/man/man8/ - cp debian/additions/*.1 $(TMP)/usr/share/man/man1/ - mkdir -p $(TMP)/etc/mysql/conf.d/ - cp debian/additions/mysqld_safe_syslog.cnf $(TMP)/etc/mysql/conf.d/ + # Versioned symbols are only available on Linux. + # Remove symbols file on kFreeBSD builds so that + # dpkg-gensymbols will not fail the build. +ifneq (,$(filter $(ARCH), kfreebsd-i386 kfreebsd-amd64)) + rm debian/libmariadbclient18.symbols +endif - # make install (trailing slash needed for innobase) - cd $(builddir) && $(MAKE) install DESTDIR=$(TMP)/ - # - # After installing, remove rpath to make lintian happy. - set +e; \ - find ./debian/tmp/ -type f -print0 \ - | xargs -0 --no-run-if-empty chrpath -k 2>/dev/null \ - | fgrep RPATH= \ - | cut -d: -f 1 \ - | xargs --no-run-if-empty chrpath -d; \ - set -e + mkdir -p $(BUILDDIR) && cd $(BUILDDIR) && \ + sh -c 'PATH=$${MYSQL_BUILD_PATH:-"/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin"} \ + CC=${CC} \ + CXX=${CXX} \ + cmake -DCMAKE_INSTALL_PREFIX=/usr \ + $(CMAKEFLAGS) \ + -DCOMPILATION_COMMENT="mariadb.org binary distribution" \ + -DMYSQL_SERVER_SUFFIX="-$(DEBVERSION)" \ + -DSYSTEM_TYPE="debian-$(DEB_BUILD_GNU_SYSTEM)" \ + -DCMAKE_SYSTEM_PROCESSOR=$(DEB_BUILD_ARCH) \ + -DBUILD_CONFIG=mysql_release \ + -DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \ + -DINSTALL_PLUGINDIR=lib/mysql/plugin \ + -DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test \ + -DDEB=$(DISTRIBUTION) ..' + touch $@ - # libmysqlclient-dev: forgotten header file since 3.23.25? - cp $(BUILDDIR)/include/my_config.h $(TMP)/usr/include/mysql/ - cp include/my_dir.h $(TMP)/usr/include/mysql/ +# This is needed, otherwise 'make test' will run before binaries have been built +override_dh_auto_build: + @echo "RULES.$@" + # Print build env info to help debug builds on different platforms + dpkg-architecture + cd $(BUILDDIR) && $(MAKE) + touch $@ - # mysql-common: We provide our own version of this package for - # completeness, but we can use an existing version; mariadb-specic - # stuff is in mariadb-common - install -d $(TMP)/etc/mysql - install -m 0644 debian/additions/my.cnf $(TMP)/etc/mysql/my.cnf +override_dh_auto_test: + @echo "RULES.$@" + dh_testdir + # Skip unstable tests if such are defined for arch + [ ! -f debian/unstable-tests.$(ARCH) ] || cat debian/unstable-tests.$(ARCH) >> mysql-test/unstable-tests + # Run testsuite +ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) + cd $(BUILDDIR)/mysql-test && ./mtr --force --mem --parallel=$(NUMJOBS) --skip-rpl --suite=main --skip-test-list=unstable-tests || $(TESTSUITE_FAIL_CMD) ; +endif - # mariadb-common: MariaDB-specific config stuff. - install -d $(TMP)/etc/mysql/conf.d - install -m 0644 debian/additions/mariadb.cnf $(TMP)/etc/mysql/conf.d/mariadb.cnf +override_dh_auto_install: + @echo "RULES.$@" + dh_testdir + dh_testroot - # mariadb-client - install -m 0755 debian/additions/mysqlreport $(TMP)/usr/bin/ - install -m 0755 debian/additions/innotop/innotop $(TMP)/usr/bin/ - install -m 0644 debian/additions/innotop/innotop.1 $(TMP)/usr/share/man/man1/ + # If TokuDB plugin was not built skip the package + [ -f $(BUILDDIR)/storage/tokudb/ha_tokudb.so ] || sed -i -e "/Package: mariadb-plugin-tokudb/,+12d" debian/control - # mariadb-server - install -m 0755 $(BUILDDIR)/scripts/mysqld_safe $(TMP)/usr/bin/mysqld_safe - mkdir -p $(TMP)/usr/share/doc/mariadb-server-10.2/examples - # We have a sane my.cnf, cruft not needed (remove my-*.cnf and config-*.cnf) - # $(TMP)/usr/share/mysql/*cnf $(TMP)/usr/share/doc/mariadb-server-10.2/examples/ - rm -vf $(TMP)/usr/share/mysql/my-*.cnf \ - $(TMP)/usr/share/mysql/config-*.cnf \ - $(TMP)/usr/share/mysql/mi_test_all* \ - $(TMP)/usr/share/mysql/mysql-log-rotate \ - $(TMP)/usr/share/mysql/mysql.server \ - $(TMP)/usr/share/mysql/binary-configure - nm -n $(BUILDDIR)/sql/mysqld |gzip -9 > $(TMP)/usr/share/doc/mariadb-server-10.2/mysqld.sym.gz - install -m 0755 debian/additions/echo_stderr $(TMP)/usr/share/mysql/ - install -m 0755 debian/additions/debian-start $(TMP)/etc/mysql/ - install -m 0755 debian/additions/debian-start.inc.sh $(TMP)/usr/share/mysql/ + # If Mroonga plugin was not built skip the package + [ -f $(BUILDDIR)/storage/mroonga/ha_mroonga.so ] || sed -i -e "/Package: mariadb-plugin-mroonga/,+11d" debian/control - install -m 0644 $(builddir)/Docs/INFO_SRC $(TMP)/usr/share/doc/mariadb-server-10.2/INFO_SRC - install -m 0644 $(builddir)/Docs/INFO_BIN $(TMP)/usr/share/doc/mariadb-server-10.2/INFO_BIN + # make install + cd $(BUILDDIR) && $(MAKE) install DESTDIR=$(TMP) - # mariadb-test - mv $(TMP)/usr/mysql-test $(TMP)/usr/share/mysql + # nm numeric soft is not enough, therefore extra sort in command + # to satisfy Debian reproducible build requirements + nm --defined-only $(BUILDDIR)/sql/mysqld | LC_ALL=C sort | gzip -n -9 > $(TMP)/usr/share/doc/mariadb-server-10.2/mysqld.sym.gz # For 5.0 -> 10.2 transition d=$(TMP)/usr/share/mysql-common/internal-use-only/; \ @@ -185,98 +135,28 @@ install: build cp debian/mariadb-server-10.2.mysql-server.logrotate $$d/_etc_logrotate.d_mysql-server; \ cp debian/additions/debian-start $$d/_etc_mysql_debian-start; - # install AppArmor profile + # rename and install AppArmor profile install -D -m 644 debian/apparmor-profile $(TMP)/etc/apparmor.d/usr.sbin.mysqld # install Apport hook install -D -m 644 debian/mariadb-server-10.2.py $(TMP)/usr/share/apport/package-hooks/source_mariadb-10.2.py - autorm=debian/autorm-file; \ - rm -f $$autorm; \ - ignore=''; \ - for p in $$MARIADB_OPTIONAL_DEBS; do \ - p=mariadb-$$p; \ - dh_movefiles --package=$$p || echo "../$$p*.deb" >> $$autorm; \ - ignore="$$ignore --no-package=$$p"; \ - done; \ - sh -c "dh_movefiles $$ignore" - -# Build architecture-independent files here. -binary-indep: build install - @echo "RULES.binary-indep" - dh_testdir -i - dh_testroot -i - dh_installdebconf -i - dh_installdocs -i - dh_installexamples -i - dh_installmenu -i - dh_installlogrotate -i - dh_installinit -i - dh_installcron -i - dh_installman -i - dh_installinfo -i - dh_installlogcheck -i - dh_installchangelogs -i - dh_link -i - dh_compress -i - dh_fixperms -i - dh_installdeb -i - dh_perl -i - dh_gencontrol -i - dh_md5sums -i - dh_builddeb -i - -# Build architecture-dependent files here. -binary-arch: build install - @echo "RULES.binary-arch" - dh_testdir - dh_testroot + touch $@ - dh_installdebconf -a - dh_installdocs -a - dh_installexamples -a - dh_installmenu -a - dh_installlogrotate -a --name mysql-server - if [ -x /usr/bin/dh_systemd_enable -a -f debian/mariadb-server-10.2/lib/systemd/system/mariadb.service ]; then dh_systemd_enable -pmariadb-server-10.2 mariadb.service; fi - if [ -x /usr/bin/dh_systemd_enable -a -f debian/mariadb-server-10.2/lib/systemd/system/mariadb@.service ]; then dh_systemd_enable --no-enable -pmariadb-server-10.2 mariadb@.service; fi - # Start mysql in runlevel 19 before 20 where apache, proftpd etc gets - # started which might depend on a running database server. - dh_installinit -a --name=mysql -- defaults 19 21 - if [ -x /usr/bin/dh_systemd_start -a -f debian/mariadb-server-10.2/lib/systemd/system/mariadb.service ]; then dh_systemd_start -pmariadb-server-10.2 --restart-after-upgrade mariadb.service; fi - dh_installcron -a --name mysql-server - dh_installman -a - dh_installinfo -a - dh_installlogcheck -a - dh_installchangelogs -a - dh_strip -a - dh_link -a # .so muss nach .so.1.2.3 installier werden! - dh_compress -a --exclude=INFO_BIN - dh_fixperms -a - dh_makeshlibs -a - dh_makeshlibs -plibmariadbclient18 -V'libmariadbclient18 (>= 5.5.1-1)' - dh_installdeb -a - dh_perl -a - dh_shlibdeps -a -l debian/libmariadbclient18/usr/lib -L libmariadbclient18 - dh_gencontrol -a - dh_md5sums -a - dh_builddeb -a +override_dh_installlogrotate-arch: + dh_installlogrotate --name mysql-server -source diff: - @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false +# Start mysql at sequence number 19 before 20 where apache, proftpd etc gets +# started which might depend on a running database server. +override_dh_installinit-arch: + dh_installinit --name=mysql -- defaults 19 21 -binary: binary-indep binary-arch +override_dh_installcron-arch: + dh_installcron --name mysql-server get-orig-source: - @wget -nv -T10 -t3 \ - -O /tmp/mysql-$(DEB_UPSTREAM_VERSION).tar.gz \ - http://ftp.gwdg.de/pub/misc/mysql/Downloads/MySQL-$(DEB_UPSTREAM_VERSION_MAJOR_MINOR)/mysql-$(DEB_UPSTREAM_VERSION).tar.gz - @tar xfz /tmp/mysql-$(DEB_UPSTREAM_VERSION).tar.gz -C /tmp - @rm -rf /tmp/mysql-$(DEB_UPSTREAM_VERSION)/Docs - @rm -rf /tmp/mysql-$(DEB_UPSTREAM_VERSION)/debian - @mv /tmp/mysql-$(DEB_UPSTREAM_VERSION) /tmp/$(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION).orig - @cd /tmp ; tar czf $(DEB_SOURCE_PACKAGE)_$(DEB_UPSTREAM_VERSION).orig.tar.gz $(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION).orig - @rm -f /tmp/mysql-$(DEB_UPSTREAM_VERSION).tar.gz - @rm -rf /tmp/$(DEB_SOURCE_PACKAGE)-$(DEB_UPSTREAM_VERSION).orig + uscan --force-download --verbose -.PHONY: clean clean-patched configure build binary binary-indep binary-arch install patch unpatch +%: + dh $@ --parallel # vim: ts=8 From 1494a96bf404e207100903382a878104449aa53c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Fri, 7 Oct 2016 17:03:08 +0300 Subject: [PATCH 09/71] MDEV-6284: Make mariadb-test package versionless There is no need for a separate mariadb-test metapackage and a versioned mariadb-test-* package. Simply make it versionless and make it depend on the client and server packages that stem from same source version. --- debian/control | 68 +++++++--------- debian/mariadb-test-10.2.dirs | 80 ------------------- ...test-10.2.install => mariadb-test.install} | 0 ...adb-test-10.2.links => mariadb-test.links} | 0 4 files changed, 30 insertions(+), 118 deletions(-) delete mode 100644 debian/mariadb-test-10.2.dirs rename debian/{mariadb-test-10.2.install => mariadb-test.install} (100%) rename debian/{mariadb-test-10.2.links => mariadb-test.links} (100%) diff --git a/debian/control b/debian/control index 588f7d4e0ee07..914d12b93ba99 100644 --- a/debian/control +++ b/debian/control @@ -287,38 +287,6 @@ Description: MariaDB database core server files . This package includes the core server files, as used by Akonadi. -Package: mariadb-test-10.2 -Architecture: any -Depends: mariadb-client-10.2 (= ${binary:Version}), - mariadb-server-10.2 (= ${binary:Version}), - ${misc:Depends}, - ${shlibs:Depends} -Suggests: patch -Conflicts: mariadb-galera-server-5.5 (<< 5.5.33), - mariadb-server-5.5 (<< 5.5.33), - mariadb-test (<< ${source:Version}), - mariadb-test-10.0, - mariadb-test-10.1, - mariadb-test-5.1, - mariadb-test-5.2, - mariadb-test-5.3, - virtual-mysql-testsuite -Replaces: mariadb-test (<< ${source:Version}), - mariadb-test-10.0, - mariadb-test-10.1, - mariadb-test-5.1, - mariadb-test-5.2, - mariadb-test-5.3, - virtual-mysql-testsuite -Provides: virtual-mysql-testsuite -Description: MariaDB database regression test suite - MariaDB is a fast, stable and true multi-user, multi-threaded SQL database - server. SQL (Structured Query Language) is the most popular database query - language in the world. The main goals of MariaDB are speed, robustness and - ease of use. - . - This package includes the regression test suite. - Package: mariadb-server-10.2 Architecture: any Suggests: mailx, mariadb-test, netcat-openbsd, tinyca @@ -410,12 +378,36 @@ Description: MariaDB database client (metapackage depending on the latest versio you want, as this is the one considered to be in the best shape. Package: mariadb-test -Architecture: all -Depends: mariadb-test-10.2 (= ${source:Version}), ${misc:Depends} -Description: MariaDB database regression test suite (metapackage for the latest version) - This is an empty package that depends on the current "best" version of - mariadb-test (currently mariadb-test-10.2), as determined by the MariaDB - maintainers. +Architecture: any +Depends: mariadb-client-10.2 (= ${binary:Version}), + mariadb-server-10.2 (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Breaks: mariadb-test-10.1, + mariadb-test-10.0, + mariadb-test-5.5, + mysql-testsuite, + mysql-testsuite-5.5, + mysql-testsuite-5.6, + mysql-testsuite-5.7, + virtual-mysql-testsuite +Replaces: mariadb-test-10.1, + mariadb-test-10.0, + mariadb-test-5.5, + mysql-testsuite, + mysql-testsuite-5.5, + mysql-testsuite-5.6, + mysql-testsuite-5.7, + virtual-mysql-testsuite +Provides: virtual-mysql-testsuite +Suggests: patch +Description: MariaDB database regression test suite + MariaDB is a fast, stable and true multi-user, multi-threaded SQL database + server. SQL (Structured Query Language) is the most popular database query + language in the world. The main goals of MariaDB are speed, robustness and + ease of use. + . + This package includes the regression test suite. Package: mariadb-connect-engine-10.2 Architecture: any diff --git a/debian/mariadb-test-10.2.dirs b/debian/mariadb-test-10.2.dirs deleted file mode 100644 index b21c5b780f708..0000000000000 --- a/debian/mariadb-test-10.2.dirs +++ /dev/null @@ -1,80 +0,0 @@ -usr/bin -usr/share/man/man1 -usr/share/mysql/mysql-test -usr/share/mysql/mysql-test/extra -usr/share/mysql/mysql-test/extra/binlog_tests -usr/share/mysql/mysql-test/extra/rpl_tests -usr/share/mysql/mysql-test/lib -usr/share/mysql/mysql-test/lib/My -usr/share/mysql/mysql-test/lib/My/SafeProcess -usr/share/mysql/mysql-test/lib/My/File -usr/share/mysql/mysql-test/lib/v1 -usr/share/mysql/mysql-test/lib/v1/My -usr/share/mysql/mysql-test/collections -usr/share/mysql/mysql-test/t -usr/share/mysql/mysql-test/r -usr/share/mysql/mysql-test/include -usr/share/mysql/mysql-test/suite -usr/share/mysql/mysql-test/suite/parts -usr/share/mysql/mysql-test/suite/parts/inc -usr/share/mysql/mysql-test/suite/parts/t -usr/share/mysql/mysql-test/suite/parts/r -usr/share/mysql/mysql-test/suite/bugs -usr/share/mysql/mysql-test/suite/bugs/t -usr/share/mysql/mysql-test/suite/bugs/r -usr/share/mysql/mysql-test/suite/bugs/data -usr/share/mysql/mysql-test/suite/rpl -usr/share/mysql/mysql-test/suite/rpl/t -usr/share/mysql/mysql-test/suite/rpl/r -usr/share/mysql/mysql-test/suite/rpl/include -usr/share/mysql/mysql-test/suite/innodb -usr/share/mysql/mysql-test/suite/innodb/t -usr/share/mysql/mysql-test/suite/innodb/r -usr/share/mysql/mysql-test/suite/innodb/include -usr/share/mysql/mysql-test/suite/manual -usr/share/mysql/mysql-test/suite/manual/t -usr/share/mysql/mysql-test/suite/manual/r -usr/share/mysql/mysql-test/suite/stress -usr/share/mysql/mysql-test/suite/stress/t -usr/share/mysql/mysql-test/suite/stress/r -usr/share/mysql/mysql-test/suite/stress/include -usr/share/mysql/mysql-test/suite/jp -usr/share/mysql/mysql-test/suite/jp/t -usr/share/mysql/mysql-test/suite/jp/r -usr/share/mysql/mysql-test/suite/jp/include -usr/share/mysql/mysql-test/suite/jp/std_data -usr/share/mysql/mysql-test/suite/maria -usr/share/mysql/mysql-test/suite/funcs_2 -usr/share/mysql/mysql-test/suite/funcs_2/lib -usr/share/mysql/mysql-test/suite/funcs_2/t -usr/share/mysql/mysql-test/suite/funcs_2/charset -usr/share/mysql/mysql-test/suite/funcs_2/r -usr/share/mysql/mysql-test/suite/funcs_2/include -usr/share/mysql/mysql-test/suite/funcs_2/data -usr/share/mysql/mysql-test/suite/binlog -usr/share/mysql/mysql-test/suite/binlog/t -usr/share/mysql/mysql-test/suite/binlog/r -usr/share/mysql/mysql-test/suite/binlog/std_data -usr/share/mysql/mysql-test/suite/federated -usr/share/mysql/mysql-test/suite/funcs_1 -usr/share/mysql/mysql-test/suite/funcs_1/cursors -usr/share/mysql/mysql-test/suite/funcs_1/bitdata -usr/share/mysql/mysql-test/suite/funcs_1/views -usr/share/mysql/mysql-test/suite/funcs_1/storedproc -usr/share/mysql/mysql-test/suite/funcs_1/triggers -usr/share/mysql/mysql-test/suite/funcs_1/lib -usr/share/mysql/mysql-test/suite/funcs_1/t -usr/share/mysql/mysql-test/suite/funcs_1/r -usr/share/mysql/mysql-test/suite/funcs_1/include -usr/share/mysql/mysql-test/suite/funcs_1/datadict -usr/share/mysql/mysql-test/suite/vcol -usr/share/mysql/mysql-test/suite/vcol/inc -usr/share/mysql/mysql-test/suite/vcol/t -usr/share/mysql/mysql-test/suite/vcol/r -usr/share/mysql/mysql-test/suite/oqgraph -usr/share/mysql/mysql-test/suite/oqgraph/t -usr/share/mysql/mysql-test/suite/oqgraph/r -usr/share/mysql/mysql-test/suite/oqgraph/include -usr/share/mysql/mysql-test/std_data -usr/share/mysql/mysql-test/std_data/parts -usr/share/mysql/mysql-test/std_data/funcs_1 diff --git a/debian/mariadb-test-10.2.install b/debian/mariadb-test.install similarity index 100% rename from debian/mariadb-test-10.2.install rename to debian/mariadb-test.install diff --git a/debian/mariadb-test-10.2.links b/debian/mariadb-test.links similarity index 100% rename from debian/mariadb-test-10.2.links rename to debian/mariadb-test.links From 0a1dbe842657c7617f59770273c8004a034d312c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sun, 10 Jul 2016 23:36:05 +0300 Subject: [PATCH 10/71] MDEV-6284: Split mariadb-test-data out of mariadb-test --- debian/control | 28 +++++++++++++++++++++ debian/mariadb-test-data.install | 16 ++++++++++++ debian/mariadb-test.install | 43 ++++++++++++++++++-------------- debian/mariadb-test.manpages | 4 +++ 4 files changed, 72 insertions(+), 19 deletions(-) create mode 100644 debian/mariadb-test-data.install create mode 100644 debian/mariadb-test.manpages diff --git a/debian/control b/debian/control index 914d12b93ba99..ef195a1ad4f66 100644 --- a/debian/control +++ b/debian/control @@ -381,6 +381,7 @@ Package: mariadb-test Architecture: any Depends: mariadb-client-10.2 (= ${binary:Version}), mariadb-server-10.2 (= ${binary:Version}), + mariadb-test-data (= ${source:Version}), ${misc:Depends}, ${shlibs:Depends} Breaks: mariadb-test-10.1, @@ -409,6 +410,33 @@ Description: MariaDB database regression test suite . This package includes the regression test suite. +Package: mariadb-test-data +Architecture: all +Depends: ${misc:Depends} +Breaks: mariadb-test-10.1, + mariadb-test-10.0, + mariadb-test-5.5, + mariadb-test-data-10.0, + mysql-testsuite, + mysql-testsuite-5.5, + mysql-testsuite-5.6, + mysql-testsuite-5.7 +Replaces: mariadb-test-10.1, + mariadb-test-10.0, + mariadb-test-5.5, + mariadb-test-data-10.0, + mysql-testsuite, + mysql-testsuite-5.5, + mysql-testsuite-5.6, + mysql-testsuite-5.7 +Description: MariaDB database regression test suite - data files + MariaDB is a fast, stable and true multi-user, multi-threaded SQL database + server. SQL (Structured Query Language) is the most popular database query + language in the world. The main goals of MariaDB are speed, robustness and + ease of use. + . + This package has the architecture independent data files for the test suite. + Package: mariadb-connect-engine-10.2 Architecture: any Depends: libxml2, diff --git a/debian/mariadb-test-data.install b/debian/mariadb-test-data.install new file mode 100644 index 0000000000000..84d01dc31f1ee --- /dev/null +++ b/debian/mariadb-test-data.install @@ -0,0 +1,16 @@ +usr/share/mysql/mysql-test/collections +usr/share/mysql/mysql-test/extra +usr/share/mysql/mysql-test/include +usr/share/mysql/mysql-test/lib +usr/share/mysql/mysql-test/mysql-test-run.pl +usr/share/mysql/mysql-test/disabled.def +usr/share/mysql/mysql-test/valgrind.supp +usr/share/mysql/mysql-test/mysql-stress-test.pl +usr/share/mysql/mysql-test/README +usr/share/mysql/mysql-test/README.stress +usr/share/mysql/mysql-test/unstable-tests +usr/share/mysql/mysql-test/plugin +usr/share/mysql/mysql-test/r +usr/share/mysql/mysql-test/std_data +usr/share/mysql/mysql-test/suite +usr/share/mysql/mysql-test/t diff --git a/debian/mariadb-test.install b/debian/mariadb-test.install index dbb551a94075f..873cd07cc92d4 100644 --- a/debian/mariadb-test.install +++ b/debian/mariadb-test.install @@ -1,23 +1,28 @@ +usr/bin/mysql_client_test +usr/bin/mysql_client_test_embedded +usr/bin/mysqltest +usr/bin/mysqltest_embedded +usr/lib/mysql/plugin/adt_null.so +usr/lib/mysql/plugin/auth_0x0100.so +usr/lib/mysql/plugin/auth_test_plugin.so +usr/lib/mysql/plugin/daemon_example.ini +usr/lib/mysql/plugin/dialog_examples.so usr/lib/mysql/plugin/debug_key_management.so usr/lib/mysql/plugin/example_key_management.so -usr/lib/mysql/plugin/dialog_examples.so -usr/lib/mysql/plugin/auth_test_plugin.so -usr/lib/mysql/plugin/qa_auth_interface.so -usr/lib/mysql/plugin/qa_auth_server.so -usr/lib/mysql/plugin/qa_auth_client.so -usr/lib/mysql/plugin/auth_0x0100.so -usr/lib/mysql/plugin/mypluglib.so -usr/lib/mysql/plugin/ha_test_sql_discovery.so usr/lib/mysql/plugin/ha_example.so -usr/lib/mysql/plugin/daemon_example.ini +usr/lib/mysql/plugin/ha_test_sql_discovery.so usr/lib/mysql/plugin/libdaemon_example.so -usr/lib/mysql/plugin/adt_null.so -usr/bin/mysql_client_test -usr/bin/mysql_client_test_embedded -usr/bin/mysqltest_embedded -usr/share/man/man1/mysql_client_test.1 -usr/share/man/man1/mysql_client_test_embedded.1 -usr/bin/mysqltest -usr/share/man/man1/mysqltest.1 -usr/share/man/man1/mysqltest_embedded.1 -usr/share/mysql/mysql-test +usr/lib/mysql/plugin/mypluglib.so +usr/lib/mysql/plugin/qa_auth_client.so +usr/lib/mysql/plugin/qa_auth_interface.so +usr/lib/mysql/plugin/qa_auth_server.so +usr/share/mysql/mysql-test/README +usr/share/mysql/mysql-test/README.gcov +usr/share/mysql/mysql-test/README.stress +usr/share/mysql/mysql-test/disabled.def +usr/share/mysql/mysql-test/lib +usr/share/mysql/mysql-test/mysql-stress-test.pl +usr/share/mysql/mysql-test/mysql-test-run.pl +usr/share/mysql/mysql-test/purify.supp +usr/share/mysql/mysql-test/suite.pm +usr/share/mysql/mysql-test/valgrind.supp diff --git a/debian/mariadb-test.manpages b/debian/mariadb-test.manpages new file mode 100644 index 0000000000000..33ce8710ea7fe --- /dev/null +++ b/debian/mariadb-test.manpages @@ -0,0 +1,4 @@ +debian/tmp/usr/share/man/man1/mysql_client_test.1 +debian/tmp/usr/share/man/man1/mysql_client_test_embedded.1 +debian/tmp/usr/share/man/man1/mysqltest.1 +debian/tmp/usr/share/man/man1/mysqltest_embedded.1 From e58e7b50529d236bb50d808412d1ffef80f2da5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sun, 9 Oct 2016 14:42:17 +0300 Subject: [PATCH 11/71] MDEV-6284: Rename plugin packages to match new Debian convention --- debian/control | 32 +++++++++---------- ...install => mariadb-plugin-connect.install} | 0 ...db-plugin-cracklib-password-check.install} | 0 ...l => mariadb-plugin-gssapi-client.install} | 0 ...l => mariadb-plugin-gssapi-server.install} | 0 ...install => mariadb-plugin-oqgraph.install} | 0 6 files changed, 16 insertions(+), 16 deletions(-) rename debian/{mariadb-connect-engine-10.2.install => mariadb-plugin-connect.install} (100%) rename debian/{mariadb-cracklib-password-check-10.2.install => mariadb-plugin-cracklib-password-check.install} (100%) rename debian/{mariadb-gssapi-client-10.2.install => mariadb-plugin-gssapi-client.install} (100%) rename debian/{mariadb-gssapi-server-10.2.install => mariadb-plugin-gssapi-server.install} (100%) rename debian/{mariadb-oqgraph-engine-10.2.install => mariadb-plugin-oqgraph.install} (100%) diff --git a/debian/control b/debian/control index ef195a1ad4f66..14374182fe3c7 100644 --- a/debian/control +++ b/debian/control @@ -437,43 +437,43 @@ Description: MariaDB database regression test suite - data files . This package has the architecture independent data files for the test suite. -Package: mariadb-connect-engine-10.2 +Package: mariadb-plugin-connect Architecture: any Depends: libxml2, mariadb-server-10.2, unixodbc, ${misc:Depends}, ${shlibs:Depends} +Breaks: mariadb-connect-engine-10.1, mariadb-connect-engine-10.2 +Replaces: mariadb-connect-engine-10.1, mariadb-connect-engine-10.2 Description: Connect storage engine for MariaDB Connect engine supports a number of file formats (dbf, xml, txt, bin, etc), connections to ODBC tables and remote MySQL tables, as well as a number of other interesting features. This package contains the Connect plugin for MariaDB. -Package: mariadb-oqgraph-engine-10.2 +Package: mariadb-plugin-oqgraph Architecture: any Depends: libjudydebian1, mariadb-server-10.2, ${misc:Depends}, ${shlibs:Depends} +Breaks: mariadb-oqgraph-engine-10.1, mariadb-oqgraph-engine-10.2 +Replaces: mariadb-oqgraph-engine-10.1, mariadb-oqgraph-engine-10.2 Description: OQGraph storage engine for MariaDB The OQGraph engine is a computation engine plugin for handling hierarchies (trees) and graphs (friend-of-a-friend, etc) cleanly through standard SQL. This package contains the OQGraph plugin for MariaDB. -Package: mariadb-gssapi-server-10.2 +Package: mariadb-plugin-gssapi-server +Section: database Architecture: any -Depends: libgssapi-krb5-2, - mariadb-server-10.2, - ${misc:Depends}, - ${shlibs:Depends} -Conflicts: mariadb-gssapi-server-10.1 -Replaces: mariadb-gssapi-server-10.1 +Depends: libgssapi-krb5-2, mariadb-server-10.2 +Breaks: mariadb-gssapi-server-10.1, mariadb-gssapi-server-10.2 +Replaces: mariadb-gssapi-server-10.1, mariadb-gssapi-server-10.2 Description: GSSAPI authentication plugin for MariaDB server -Package: mariadb-gssapi-client-10.2 +Package: mariadb-plugin-gssapi-client +Section: database Architecture: any -Depends: libgssapi-krb5-2, - mariadb-client-10.2, - ${misc:Depends}, - ${shlibs:Depends} -Conflicts: mariadb-gssapi-client-10.1 -Replaces: mariadb-gssapi-client-10.1 +Depends: libgssapi-krb5-2, mariadb-client-10.2 +Breaks: mariadb-gssapi-client-10.1, mariadb-gssapi-client-10.2 +Replaces: mariadb-gssapi-client-10.1, mariadb-gssapi-client-10.2 Description: GSSAPI authentication plugin for MariaDB client diff --git a/debian/mariadb-connect-engine-10.2.install b/debian/mariadb-plugin-connect.install similarity index 100% rename from debian/mariadb-connect-engine-10.2.install rename to debian/mariadb-plugin-connect.install diff --git a/debian/mariadb-cracklib-password-check-10.2.install b/debian/mariadb-plugin-cracklib-password-check.install similarity index 100% rename from debian/mariadb-cracklib-password-check-10.2.install rename to debian/mariadb-plugin-cracklib-password-check.install diff --git a/debian/mariadb-gssapi-client-10.2.install b/debian/mariadb-plugin-gssapi-client.install similarity index 100% rename from debian/mariadb-gssapi-client-10.2.install rename to debian/mariadb-plugin-gssapi-client.install diff --git a/debian/mariadb-gssapi-server-10.2.install b/debian/mariadb-plugin-gssapi-server.install similarity index 100% rename from debian/mariadb-gssapi-server-10.2.install rename to debian/mariadb-plugin-gssapi-server.install diff --git a/debian/mariadb-oqgraph-engine-10.2.install b/debian/mariadb-plugin-oqgraph.install similarity index 100% rename from debian/mariadb-oqgraph-engine-10.2.install rename to debian/mariadb-plugin-oqgraph.install From d495bf42807c301da579e5de2ffcb39ea73df928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sun, 9 Oct 2016 14:43:34 +0300 Subject: [PATCH 12/71] MDEV-6284: Spliy Mroonga, Spider and TokuDB into their own packages Also each package has it's own maintainer scripts to install and uninstall them. --- debian/additions/mariadb.cnf | 2 ++ debian/control | 40 ++++++++++++++++++++++++++ debian/mariadb-plugin-connect.install | 2 +- debian/mariadb-plugin-mroonga.install | 3 ++ debian/mariadb-plugin-mroonga.postinst | 12 ++++++++ debian/mariadb-plugin-mroonga.prerm | 12 ++++++++ debian/mariadb-plugin-oqgraph.install | 1 + debian/mariadb-plugin-spider.install | 2 ++ debian/mariadb-plugin-spider.postinst | 12 ++++++++ debian/mariadb-plugin-tokudb.install | 4 +++ 10 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 debian/mariadb-plugin-mroonga.install create mode 100644 debian/mariadb-plugin-mroonga.postinst create mode 100644 debian/mariadb-plugin-mroonga.prerm create mode 100644 debian/mariadb-plugin-spider.install create mode 100644 debian/mariadb-plugin-spider.postinst create mode 100644 debian/mariadb-plugin-tokudb.install diff --git a/debian/additions/mariadb.cnf b/debian/additions/mariadb.cnf index 927e9d1ce8856..da21212faef53 100644 --- a/debian/additions/mariadb.cnf +++ b/debian/additions/mariadb.cnf @@ -15,3 +15,5 @@ #collation-server = utf8_general_ci #character_set_server = utf8 #collation_server = utf8_general_ci +# Import all .cnf files from configuration directory +!includedir /etc/mysql/mariadb.conf.d/ diff --git a/debian/control b/debian/control index 14374182fe3c7..d7b24c6ce8088 100644 --- a/debian/control +++ b/debian/control @@ -318,6 +318,7 @@ Conflicts: mariadb-server (<< ${source:Version}), mariadb-server-5.2, mariadb-server-5.3, mariadb-server-5.5, + mariadb-tokudb-engine-10.1, mariadb-tokudb-engine-10.0, mariadb-tokudb-engine-5.5, mysql-server (<< ${source:Version}), @@ -336,6 +337,7 @@ Replaces: libmariadbclient-dev (<< 5.5.0), mariadb-server-5.2, mariadb-server-5.3, mariadb-server-5.5, + mariadb-tokudb-engine-10.1, mariadb-tokudb-engine-10.0, mariadb-tokudb-engine-5.5, mysql-server (<< ${source:Version}), @@ -462,6 +464,44 @@ Description: OQGraph storage engine for MariaDB (trees) and graphs (friend-of-a-friend, etc) cleanly through standard SQL. This package contains the OQGraph plugin for MariaDB. +Package: mariadb-plugin-tokudb +Architecture: any +Depends: mariadb-server-10.2|mariadb-galera-server-10.2, + ${misc:Depends}, + ${shlibs:Depends} +Breaks: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) +Replaces: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) +Description: TokuDB storage engine for MariaDB + The TokuDB storage engine is for use in high-performance and write-intensive + environments, offering increased compression and better performance based + on fractal indexes. + This package contains the TokuDB plugin for MariaDB. + +Package: mariadb-plugin-mroonga +Architecture: any +Depends: mariadb-server-10.2|mariadb-galera-server-10.2, + ${misc:Depends}, + ${shlibs:Depends} +Breaks: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) +Replaces: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) +Description: Mroonga storage engine for MariaDB + Mroonga (formerly named Groonga Storage Engine) is a storage engine that + provides fast CJK-ready full text searching using column store. + This package contains the Mroonga plugin for MariaDB. + +Package: mariadb-plugin-spider +Architecture: any +Depends: mariadb-server-10.2|mariadb-galera-server-10.2, + ${misc:Depends}, + ${shlibs:Depends} +Breaks: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) +Replaces: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) +Description: Spider storage engine for MariaDB + The Spider storage engine with built-in sharding features. It supports + partitioning and xa transactions, and allows tables of different MariaDB + instances to be handled as if they were on the same insctance. It refers to one + possible implementation of ISO/IEC 9075-9:2008 SQL/MED. + Package: mariadb-plugin-gssapi-server Section: database Architecture: any diff --git a/debian/mariadb-plugin-connect.install b/debian/mariadb-plugin-connect.install index 0b042607c3687..8a7aee412dfad 100644 --- a/debian/mariadb-plugin-connect.install +++ b/debian/mariadb-plugin-connect.install @@ -1,2 +1,2 @@ -usr/lib/mysql/plugin/ha_connect.so etc/mysql/conf.d/connect.cnf +usr/lib/mysql/plugin/ha_connect.so diff --git a/debian/mariadb-plugin-mroonga.install b/debian/mariadb-plugin-mroonga.install new file mode 100644 index 0000000000000..c28fde2fd181c --- /dev/null +++ b/debian/mariadb-plugin-mroonga.install @@ -0,0 +1,3 @@ +usr/lib/mysql/plugin/ha_mroonga.so +usr/share/mysql/mroonga/install.sql +usr/share/mysql/mroonga/uninstall.sql diff --git a/debian/mariadb-plugin-mroonga.postinst b/debian/mariadb-plugin-mroonga.postinst new file mode 100644 index 0000000000000..70b8929250f0a --- /dev/null +++ b/debian/mariadb-plugin-mroonga.postinst @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +# Install Mroonga +# No user or password parameter is required with new MariaDB that +# has unix socket authentication support by default. +mysql < /usr/share/mysql/mroonga/install.sql || true +# Always exit with success instead of leaving dpkg in a broken state + + +#DEBHELPER# diff --git a/debian/mariadb-plugin-mroonga.prerm b/debian/mariadb-plugin-mroonga.prerm new file mode 100644 index 0000000000000..3f1a1c58e8e00 --- /dev/null +++ b/debian/mariadb-plugin-mroonga.prerm @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +# Install Mroonga +# No user or password parameter is required with new MariaDB that +# has unix socket authentication support by default. +mysql < /usr/share/mysql/mroonga/uninstall.sql || true +# Always exit with success instead of leaving dpkg in a broken state + + +#DEBHELPER# diff --git a/debian/mariadb-plugin-oqgraph.install b/debian/mariadb-plugin-oqgraph.install index f67b0cd9d1326..5e2a892d9e9a3 100644 --- a/debian/mariadb-plugin-oqgraph.install +++ b/debian/mariadb-plugin-oqgraph.install @@ -1 +1,2 @@ +etc/mysql/conf.d/oqgraph.cnf etc/mysql/mariadb.conf.d usr/lib/mysql/plugin/ha_oqgraph.so diff --git a/debian/mariadb-plugin-spider.install b/debian/mariadb-plugin-spider.install new file mode 100644 index 0000000000000..89652fe2f3c26 --- /dev/null +++ b/debian/mariadb-plugin-spider.install @@ -0,0 +1,2 @@ +usr/lib/mysql/plugin/ha_spider.so +usr/share/mysql/install_spider.sql diff --git a/debian/mariadb-plugin-spider.postinst b/debian/mariadb-plugin-spider.postinst new file mode 100644 index 0000000000000..5e43d38226cbe --- /dev/null +++ b/debian/mariadb-plugin-spider.postinst @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +# Install Spider +# No user or password parameter is required with new MariaDB that +# has unix socket authentication support by default. +mysql < /usr/share/mysql/install_spider.sql || true +# Always exit with success instead of leaving dpkg in a broken state + + +#DEBHELPER# diff --git a/debian/mariadb-plugin-tokudb.install b/debian/mariadb-plugin-tokudb.install new file mode 100644 index 0000000000000..487c9df712058 --- /dev/null +++ b/debian/mariadb-plugin-tokudb.install @@ -0,0 +1,4 @@ +etc/mysql/conf.d/tokudb.cnf etc/mysql/mariadb.conf.d +usr/bin/tokuftdump +usr/lib/mysql/plugin/ha_tokudb.so +usr/share/doc/mariadb-server-10.2/README.md usr/share/doc/mariadb-plugin-tokudb/README.md From 1877a8cdb4bce5c14e4f92a08b959b84cc123c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sun, 9 Oct 2016 16:48:17 +0300 Subject: [PATCH 13/71] MDEV-6284: Remove CMakeLists.txt hack that mangled the server install file For Debian the rules file is the main makefile and assuming that a upstream makefile will mangle the Debian packaging files creates false alerts from static analysis tools and other problems. --- CMakeLists.txt | 6 ------ debian/control | 15 +++++++++++++++ debian/mariadb-plugin-cassandra.install | 2 ++ ...0.2.install.in => mariadb-server-10.2.install} | 4 ---- debian/rules | 8 ++++++++ storage/cassandra/CMakeLists.txt | 1 - storage/spider/CMakeLists.txt | 1 - storage/tokudb/CMakeLists.txt | 1 - 8 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 debian/mariadb-plugin-cassandra.install rename debian/{mariadb-server-10.2.install.in => mariadb-server-10.2.install} (97%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54b3cbee939e9..b19b796621f50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -435,12 +435,6 @@ CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/cmake/info_macros.cmake.in ${CMAKE_BINARY_DIR}/info_macros.cmake @ONLY) -IF(DEB) - CONFIGURE_FILE( - ${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.2.install.in - ${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.2.install) -ENDIF(DEB) - # Handle the "INFO_*" files. INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake) # Source: This can be done during the cmake phase, all information is diff --git a/debian/control b/debian/control index d7b24c6ce8088..37f5b07f3414b 100644 --- a/debian/control +++ b/debian/control @@ -489,6 +489,21 @@ Description: Mroonga storage engine for MariaDB provides fast CJK-ready full text searching using column store. This package contains the Mroonga plugin for MariaDB. +Package: mariadb-plugin-cassandra +Architecture: any +Depends: mariadb-server-10.2, + ${misc:Depends}, + ${shlibs:Depends} +Breaks: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) +Replaces: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) +Description: Cassandra storage engine for MariaDB + The Cassandra Storage Engine allows access to data in a Cassandra cluster from + MariaDB, combining the best of SQL and no-SQL worlds. Cassandra SE (storage + engine) makes Cassandra's column family appear as a table in MariaDB that you + can insert to, update, and select from. You can write joins against this table, + it is possible to join data that's stored in MariaDB with data that's stored in + Cassandra. + Package: mariadb-plugin-spider Architecture: any Depends: mariadb-server-10.2|mariadb-galera-server-10.2, diff --git a/debian/mariadb-plugin-cassandra.install b/debian/mariadb-plugin-cassandra.install new file mode 100644 index 0000000000000..ca195058a17c9 --- /dev/null +++ b/debian/mariadb-plugin-cassandra.install @@ -0,0 +1,2 @@ +etc/mysql/conf.d/cassandra.cnf etc/mysql/mariadb.conf.d +usr/lib/mysql/plugin/ha_cassandra.so diff --git a/debian/mariadb-server-10.2.install.in b/debian/mariadb-server-10.2.install similarity index 97% rename from debian/mariadb-server-10.2.install.in rename to debian/mariadb-server-10.2.install index 8caa4c3b001fa..e0b12402c1f40 100644 --- a/debian/mariadb-server-10.2.install.in +++ b/debian/mariadb-server-10.2.install @@ -104,7 +104,3 @@ usr/share/mysql/mysql_system_tables.sql usr/share/mysql/mysql_performance_tables.sql usr/share/mysql/mysql_test_data_timezone.sql usr/share/mysql/wsrep_notify -@CASSANDRA_DEB_FILES@ -@SPIDER_DEB_FILES@ -@TOKUDB_DEB_FILES@ -@SYSTEMD_DEB_FILES@ diff --git a/debian/rules b/debian/rules index 6919fcc14b424..0ef9138541bb0 100755 --- a/debian/rules +++ b/debian/rules @@ -121,6 +121,14 @@ override_dh_auto_install: # If Mroonga plugin was not built skip the package [ -f $(BUILDDIR)/storage/mroonga/ha_mroonga.so ] || sed -i -e "/Package: mariadb-plugin-mroonga/,+11d" debian/control + # If libthrift-dev was available (manually installed, as it is + # not in Debian) and ha_cassandra.so was thus built, create package, + # otherwise skip it. + [ -f $(BUILDDIR)/storage/cassandra/ha_cassandra.so ] || sed -i -e "/Package: mariadb-plugin-cassandra/,+14d" debian/control + + # If Spider plugin was not built skip the package + [ -f $(BUILDDIR)/storage/spider/ha_spider.so ] || sed -i -e "/Package: mariadb-plugin-spider/,+12d" debian/control + # make install cd $(BUILDDIR) && $(MAKE) install DESTDIR=$(TMP) diff --git a/storage/cassandra/CMakeLists.txt b/storage/cassandra/CMakeLists.txt index df097c90a47aa..a5d58234d9798 100644 --- a/storage/cassandra/CMakeLists.txt +++ b/storage/cassandra/CMakeLists.txt @@ -50,7 +50,6 @@ SET(cassandra_sources LINK_DIRECTORIES(${LINK_DIR}) IF(CASSANDRASE_OK) - SET(CASSANDRA_DEB_FILES "usr/lib/mysql/plugin/ha_cassandra.so" PARENT_SCOPE) MYSQL_ADD_PLUGIN(cassandra ${cassandra_sources} STORAGE_ENGINE MODULE_ONLY LINK_LIBRARIES thrift COMPONENT cassandra-engine) ENDIF(CASSANDRASE_OK) diff --git a/storage/spider/CMakeLists.txt b/storage/spider/CMakeLists.txt index 402c74b2cde28..14c50f35bd9a6 100644 --- a/storage/spider/CMakeLists.txt +++ b/storage/spider/CMakeLists.txt @@ -41,7 +41,6 @@ ELSE() ${CMAKE_SOURCE_DIR}/storage/spider/scripts/install_spider.sql DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server ) - SET(SPIDER_DEB_FILES "usr/lib/mysql/plugin/ha_spider.so usr/share/mysql/install_spider.sql" PARENT_SCOPE) MYSQL_ADD_PLUGIN(spider ${SPIDER_SOURCES} STORAGE_ENGINE MODULE_ONLY MODULE_OUTPUT_NAME "ha_spider") ENDIF() diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt index 765e6733a9834..fd3bf90f8c44a 100644 --- a/storage/tokudb/CMakeLists.txt +++ b/storage/tokudb/CMakeLists.txt @@ -35,7 +35,6 @@ ENDIF() MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-vla" DEBUG) ############################################ -SET(TOKUDB_DEB_FILES "usr/lib/mysql/plugin/ha_tokudb.so\netc/mysql/conf.d/tokudb.cnf\nusr/bin/tokuftdump" PARENT_SCOPE) MARK_AS_ADVANCED(BUILDNAME) MARK_AS_ADVANCED(BUILD_TESTING) MARK_AS_ADVANCED(CMAKE_TOKUDB_REVISION) From b2dffcbfeaa8c9cf07e7e56152c878253e7179f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sun, 9 Oct 2016 15:51:01 +0300 Subject: [PATCH 14/71] MDEV-6284: Fix issues detected by Lintian --- debian/control | 19 +++++++------------ debian/mariadb-server-10.2.install | 3 --- debian/mariadb-test-data.install | 7 ------- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/debian/control b/debian/control index 37f5b07f3414b..3398090aecc5c 100644 --- a/debian/control +++ b/debian/control @@ -2,13 +2,11 @@ Source: mariadb-10.2 Section: database Priority: optional Maintainer: MariaDB Developers -Uploaders: MariaDB Developers Build-Depends: bison, chrpath, cmake (>= 2.7), - debhelper, + debhelper (>= 9), dh-apparmor, - dpatch, libaio-dev, libboost-dev, libjemalloc-dev (>= 3.0.0~) [linux-any], @@ -34,8 +32,7 @@ Vcs-Browser: https://github.com/MariaDB/server/ Package: libmariadbclient18 Architecture: any Section: libs -Depends: libmysqlclient18 (= ${binary:Version}), - mariadb-common, +Depends: mariadb-common, ${misc:Depends}, ${shlibs:Depends} Conflicts: mariadb-galera-server-10.0 (<< 10.0.5), @@ -466,7 +463,7 @@ Description: OQGraph storage engine for MariaDB Package: mariadb-plugin-tokudb Architecture: any -Depends: mariadb-server-10.2|mariadb-galera-server-10.2, +Depends: mariadb-server-10.2, ${misc:Depends}, ${shlibs:Depends} Breaks: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) @@ -479,7 +476,7 @@ Description: TokuDB storage engine for MariaDB Package: mariadb-plugin-mroonga Architecture: any -Depends: mariadb-server-10.2|mariadb-galera-server-10.2, +Depends: mariadb-server-10.2, ${misc:Depends}, ${shlibs:Depends} Breaks: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) @@ -506,7 +503,7 @@ Description: Cassandra storage engine for MariaDB Package: mariadb-plugin-spider Architecture: any -Depends: mariadb-server-10.2|mariadb-galera-server-10.2, +Depends: mariadb-server-10.2, ${misc:Depends}, ${shlibs:Depends} Breaks: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) @@ -518,17 +515,15 @@ Description: Spider storage engine for MariaDB possible implementation of ISO/IEC 9075-9:2008 SQL/MED. Package: mariadb-plugin-gssapi-server -Section: database Architecture: any -Depends: libgssapi-krb5-2, mariadb-server-10.2 +Depends: libgssapi-krb5-2, mariadb-server-10.2, ${misc:Depends}, ${shlibs:Depends} Breaks: mariadb-gssapi-server-10.1, mariadb-gssapi-server-10.2 Replaces: mariadb-gssapi-server-10.1, mariadb-gssapi-server-10.2 Description: GSSAPI authentication plugin for MariaDB server Package: mariadb-plugin-gssapi-client -Section: database Architecture: any -Depends: libgssapi-krb5-2, mariadb-client-10.2 +Depends: libgssapi-krb5-2, mariadb-client-10.2, ${misc:Depends}, ${shlibs:Depends} Breaks: mariadb-gssapi-client-10.1, mariadb-gssapi-client-10.2 Replaces: mariadb-gssapi-client-10.1, mariadb-gssapi-client-10.2 Description: GSSAPI authentication plugin for MariaDB client diff --git a/debian/mariadb-server-10.2.install b/debian/mariadb-server-10.2.install index e0b12402c1f40..989724fbc086c 100644 --- a/debian/mariadb-server-10.2.install +++ b/debian/mariadb-server-10.2.install @@ -56,7 +56,6 @@ usr/bin/mysql_plugin usr/bin/mysql_secure_installation usr/bin/mysql_setpermission usr/bin/mysql_tzinfo_to_sql -usr/bin/mysql_upgrade usr/bin/mysqlbinlog usr/bin/mysqld_multi usr/bin/mysqld_safe @@ -85,12 +84,10 @@ usr/share/man/man1/mysqlhotcopy.1 usr/share/man/man1/mysql_install_db.1 usr/share/man/man1/mysql_secure_installation.1 usr/share/man/man1/mysql_setpermission.1 -usr/share/man/man1/mysql_upgrade.1 usr/share/man/man1/perror.1 usr/share/man/man1/replace.1 usr/share/man/man1/resolveip.1 usr/share/man/man1/resolve_stack_dump.1 -usr/share/man/man1/innochecksum.1 usr/share/man/man1/mysql_tzinfo_to_sql.1 debian/additions/debian-start.inc.sh usr/share/mysql debian/additions/echo_stderr usr/share/mysql diff --git a/debian/mariadb-test-data.install b/debian/mariadb-test-data.install index 84d01dc31f1ee..23603dd14bf0e 100644 --- a/debian/mariadb-test-data.install +++ b/debian/mariadb-test-data.install @@ -1,13 +1,6 @@ usr/share/mysql/mysql-test/collections usr/share/mysql/mysql-test/extra usr/share/mysql/mysql-test/include -usr/share/mysql/mysql-test/lib -usr/share/mysql/mysql-test/mysql-test-run.pl -usr/share/mysql/mysql-test/disabled.def -usr/share/mysql/mysql-test/valgrind.supp -usr/share/mysql/mysql-test/mysql-stress-test.pl -usr/share/mysql/mysql-test/README -usr/share/mysql/mysql-test/README.stress usr/share/mysql/mysql-test/unstable-tests usr/share/mysql/mysql-test/plugin usr/share/mysql/mysql-test/r From 235db2c77b0e6a90bb18c34abbea975dd905c7e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sun, 9 Oct 2016 18:00:57 +0300 Subject: [PATCH 15/71] MDEV-6284: wrap-and-sort --- debian/control | 147 +++++++++++++++------------- debian/libmariadbclient-dev.install | 4 +- debian/mariadb-server-10.2.install | 114 ++++++++++----------- debian/mariadb-test-data.install | 2 +- debian/mariadb-test.install | 2 +- debian/rules | 8 +- 6 files changed, 145 insertions(+), 132 deletions(-) diff --git a/debian/control b/debian/control index 3398090aecc5c..7d5e983bfea61 100644 --- a/debian/control +++ b/debian/control @@ -32,9 +32,7 @@ Vcs-Browser: https://github.com/MariaDB/server/ Package: libmariadbclient18 Architecture: any Section: libs -Depends: mariadb-common, - ${misc:Depends}, - ${shlibs:Depends} +Depends: mariadb-common, ${misc:Depends}, ${shlibs:Depends} Conflicts: mariadb-galera-server-10.0 (<< 10.0.5), mariadb-galera-server-5.5 (<< 5.5.33), mariadb-server-10.0 (<< 10.0.5), @@ -70,7 +68,10 @@ Architecture: any Section: libdevel Provides: libmysqld-dev Pre-Depends: ${misc:Pre-Depends} -Depends: libmariadbd18 (= ${binary:Version}), libmariadbclient-dev (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} +Depends: libmariadbclient-dev (= ${binary:Version}), + libmariadbd18 (= ${binary:Version}), + ${misc:Depends}, + ${shlibs:Depends} Breaks: libmysqld-dev Replaces: libmysqld-dev Description: MariaDB embedded database, development files @@ -229,9 +230,7 @@ Replaces: mariadb-client (<< ${source:Version}), mysql-client-5.5, mysql-client-5.6, virtual-mysql-client -Recommends: libdbd-mysql-perl (>= 1.2202), - libdbi-perl, - libterm-readkey-perl +Recommends: libdbd-mysql-perl (>= 1.2202), libdbi-perl, libterm-readkey-perl Description: MariaDB database client binaries MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -315,8 +314,8 @@ Conflicts: mariadb-server (<< ${source:Version}), mariadb-server-5.2, mariadb-server-5.3, mariadb-server-5.5, - mariadb-tokudb-engine-10.1, mariadb-tokudb-engine-10.0, + mariadb-tokudb-engine-10.1, mariadb-tokudb-engine-5.5, mysql-server (<< ${source:Version}), mysql-server-4.1, @@ -334,8 +333,8 @@ Replaces: libmariadbclient-dev (<< 5.5.0), mariadb-server-5.2, mariadb-server-5.3, mariadb-server-5.5, - mariadb-tokudb-engine-10.1, mariadb-tokudb-engine-10.0, + mariadb-tokudb-engine-10.1, mariadb-tokudb-engine-5.5, mysql-server (<< ${source:Version}), mysql-server-4.1, @@ -379,26 +378,26 @@ Description: MariaDB database client (metapackage depending on the latest versio Package: mariadb-test Architecture: any Depends: mariadb-client-10.2 (= ${binary:Version}), - mariadb-server-10.2 (= ${binary:Version}), - mariadb-test-data (= ${source:Version}), - ${misc:Depends}, - ${shlibs:Depends} -Breaks: mariadb-test-10.1, - mariadb-test-10.0, - mariadb-test-5.5, - mysql-testsuite, - mysql-testsuite-5.5, - mysql-testsuite-5.6, - mysql-testsuite-5.7, - virtual-mysql-testsuite -Replaces: mariadb-test-10.1, - mariadb-test-10.0, - mariadb-test-5.5, - mysql-testsuite, - mysql-testsuite-5.5, - mysql-testsuite-5.6, - mysql-testsuite-5.7, - virtual-mysql-testsuite + mariadb-server-10.2 (= ${binary:Version}), + mariadb-test-data (= ${source:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Breaks: mariadb-test-10.0, + mariadb-test-10.1, + mariadb-test-5.5, + mysql-testsuite, + mysql-testsuite-5.5, + mysql-testsuite-5.6, + mysql-testsuite-5.7, + virtual-mysql-testsuite +Replaces: mariadb-test-10.0, + mariadb-test-10.1, + mariadb-test-5.5, + mysql-testsuite, + mysql-testsuite-5.5, + mysql-testsuite-5.6, + mysql-testsuite-5.7, + virtual-mysql-testsuite Provides: virtual-mysql-testsuite Suggests: patch Description: MariaDB database regression test suite @@ -412,22 +411,22 @@ Description: MariaDB database regression test suite Package: mariadb-test-data Architecture: all Depends: ${misc:Depends} -Breaks: mariadb-test-10.1, - mariadb-test-10.0, - mariadb-test-5.5, - mariadb-test-data-10.0, - mysql-testsuite, - mysql-testsuite-5.5, - mysql-testsuite-5.6, - mysql-testsuite-5.7 -Replaces: mariadb-test-10.1, - mariadb-test-10.0, - mariadb-test-5.5, - mariadb-test-data-10.0, - mysql-testsuite, - mysql-testsuite-5.5, - mysql-testsuite-5.6, - mysql-testsuite-5.7 +Breaks: mariadb-test-10.0, + mariadb-test-10.1, + mariadb-test-5.5, + mariadb-test-data-10.0, + mysql-testsuite, + mysql-testsuite-5.5, + mysql-testsuite-5.6, + mysql-testsuite-5.7 +Replaces: mariadb-test-10.0, + mariadb-test-10.1, + mariadb-test-5.5, + mariadb-test-data-10.0, + mysql-testsuite, + mysql-testsuite-5.5, + mysql-testsuite-5.6, + mysql-testsuite-5.7 Description: MariaDB database regression test suite - data files MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -463,11 +462,13 @@ Description: OQGraph storage engine for MariaDB Package: mariadb-plugin-tokudb Architecture: any -Depends: mariadb-server-10.2, - ${misc:Depends}, - ${shlibs:Depends} -Breaks: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) -Replaces: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) +Depends: mariadb-server-10.2, ${misc:Depends}, ${shlibs:Depends} +Breaks: mariadb-server-10.0 (<< ${source:Version}), + mariadb-server-10.1 (<< ${source:Version}), + mariadb-server-10.2 (<< ${source:Version}) +Replaces: mariadb-server-10.0 (<< ${source:Version}), + mariadb-server-10.1 (<< ${source:Version}), + mariadb-server-10.2 (<< ${source:Version}) Description: TokuDB storage engine for MariaDB The TokuDB storage engine is for use in high-performance and write-intensive environments, offering increased compression and better performance based @@ -476,11 +477,13 @@ Description: TokuDB storage engine for MariaDB Package: mariadb-plugin-mroonga Architecture: any -Depends: mariadb-server-10.2, - ${misc:Depends}, - ${shlibs:Depends} -Breaks: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) -Replaces: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) +Depends: mariadb-server-10.2, ${misc:Depends}, ${shlibs:Depends} +Breaks: mariadb-server-10.0 (<< ${source:Version}), + mariadb-server-10.1 (<< ${source:Version}), + mariadb-server-10.2 (<< ${source:Version}) +Replaces: mariadb-server-10.0 (<< ${source:Version}), + mariadb-server-10.1 (<< ${source:Version}), + mariadb-server-10.2 (<< ${source:Version}) Description: Mroonga storage engine for MariaDB Mroonga (formerly named Groonga Storage Engine) is a storage engine that provides fast CJK-ready full text searching using column store. @@ -488,11 +491,13 @@ Description: Mroonga storage engine for MariaDB Package: mariadb-plugin-cassandra Architecture: any -Depends: mariadb-server-10.2, - ${misc:Depends}, - ${shlibs:Depends} -Breaks: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) -Replaces: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) +Depends: mariadb-server-10.2, ${misc:Depends}, ${shlibs:Depends} +Breaks: mariadb-server-10.0 (<< ${source:Version}), + mariadb-server-10.1 (<< ${source:Version}), + mariadb-server-10.2 (<< ${source:Version}) +Replaces: mariadb-server-10.0 (<< ${source:Version}), + mariadb-server-10.1 (<< ${source:Version}), + mariadb-server-10.2 (<< ${source:Version}) Description: Cassandra storage engine for MariaDB The Cassandra Storage Engine allows access to data in a Cassandra cluster from MariaDB, combining the best of SQL and no-SQL worlds. Cassandra SE (storage @@ -503,11 +508,13 @@ Description: Cassandra storage engine for MariaDB Package: mariadb-plugin-spider Architecture: any -Depends: mariadb-server-10.2, - ${misc:Depends}, - ${shlibs:Depends} -Breaks: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) -Replaces: mariadb-server-10.0 (<< ${source:Version}), mariadb-server-10.1 (<< ${source:Version}), mariadb-server-10.2 (<< ${source:Version}) +Depends: mariadb-server-10.2, ${misc:Depends}, ${shlibs:Depends} +Breaks: mariadb-server-10.0 (<< ${source:Version}), + mariadb-server-10.1 (<< ${source:Version}), + mariadb-server-10.2 (<< ${source:Version}) +Replaces: mariadb-server-10.0 (<< ${source:Version}), + mariadb-server-10.1 (<< ${source:Version}), + mariadb-server-10.2 (<< ${source:Version}) Description: Spider storage engine for MariaDB The Spider storage engine with built-in sharding features. It supports partitioning and xa transactions, and allows tables of different MariaDB @@ -516,14 +523,20 @@ Description: Spider storage engine for MariaDB Package: mariadb-plugin-gssapi-server Architecture: any -Depends: libgssapi-krb5-2, mariadb-server-10.2, ${misc:Depends}, ${shlibs:Depends} +Depends: libgssapi-krb5-2, + mariadb-server-10.2, + ${misc:Depends}, + ${shlibs:Depends} Breaks: mariadb-gssapi-server-10.1, mariadb-gssapi-server-10.2 Replaces: mariadb-gssapi-server-10.1, mariadb-gssapi-server-10.2 Description: GSSAPI authentication plugin for MariaDB server Package: mariadb-plugin-gssapi-client Architecture: any -Depends: libgssapi-krb5-2, mariadb-client-10.2, ${misc:Depends}, ${shlibs:Depends} +Depends: libgssapi-krb5-2, + mariadb-client-10.2, + ${misc:Depends}, + ${shlibs:Depends} Breaks: mariadb-gssapi-client-10.1, mariadb-gssapi-client-10.2 Replaces: mariadb-gssapi-client-10.1, mariadb-gssapi-client-10.2 Description: GSSAPI authentication plugin for MariaDB client diff --git a/debian/libmariadbclient-dev.install b/debian/libmariadbclient-dev.install index 51bcb6db94dc1..63c0b8fccaa88 100644 --- a/debian/libmariadbclient-dev.install +++ b/debian/libmariadbclient-dev.install @@ -1,9 +1,9 @@ usr/bin/mysql_config -usr/include/mysql/* usr/include/mariadb +usr/include/mysql/* usr/lib/*/libmariadb.so usr/lib/*/libmariadbclient.a usr/lib/*/libmysqlservices.a usr/share/aclocal/mysql.m4 -usr/share/pkgconfig/mariadb.pc usr/share/man/man1/mysql_config.1 +usr/share/pkgconfig/mariadb.pc diff --git a/debian/mariadb-server-10.2.install b/debian/mariadb-server-10.2.install index 989724fbc086c..117b7948c25b7 100644 --- a/debian/mariadb-server-10.2.install +++ b/debian/mariadb-server-10.2.install @@ -1,55 +1,19 @@ -usr/lib/mysql/plugin/auth_pam.so -usr/lib/mysql/plugin/auth_socket.so -usr/lib/mysql/plugin/file_key_management.so -usr/lib/mysql/plugin/ha_archive.so -usr/lib/mysql/plugin/ha_blackhole.so -usr/lib/mysql/plugin/ha_federated.so -usr/lib/mysql/plugin/ha_federatedx.so -usr/lib/mysql/plugin/ha_mroonga.so -usr/lib/mysql/plugin/ha_sphinx.so -usr/lib/mysql/plugin/handlersocket.so -usr/lib/mysql/plugin/locales.so -usr/lib/mysql/plugin/metadata_lock_info.so -usr/lib/mysql/plugin/query_cache_info.so -usr/lib/mysql/plugin/query_response_time.so -usr/lib/mysql/plugin/semisync_master.so -usr/lib/mysql/plugin/semisync_slave.so -usr/lib/mysql/plugin/auth_pam.so -usr/lib/mysql/plugin/auth_socket.so -usr/lib/mysql/plugin/file_key_management.so -usr/lib/mysql/plugin/ha_archive.so -usr/lib/mysql/plugin/ha_blackhole.so -usr/lib/mysql/plugin/ha_federated.so -usr/lib/mysql/plugin/ha_federatedx.so -usr/lib/mysql/plugin/ha_mroonga.so -usr/lib/mysql/plugin/ha_sphinx.so -usr/lib/mysql/plugin/handlersocket.so -usr/lib/mysql/plugin/locales.so -usr/lib/mysql/plugin/metadata_lock_info.so -usr/lib/mysql/plugin/query_cache_info.so -usr/lib/mysql/plugin/query_response_time.so -usr/lib/mysql/plugin/semisync_master.so -usr/lib/mysql/plugin/semisync_slave.so -usr/lib/mysql/plugin/server_audit.so -usr/lib/mysql/plugin/simple_password_check.so -usr/lib/mysql/plugin/sql_errlog.so -usr/lib/mysql/plugin/wsrep_info.so -usr/lib/mysql/plugin/user_variables.so -etc/apparmor.d/usr.sbin.mysqld -usr/share/apport/package-hooks/source_mariadb-10.2.py debian/additions/debian-start etc/mysql +debian/additions/debian-start.inc.sh usr/share/mysql +debian/additions/echo_stderr usr/share/mysql debian/additions/mysqld_safe_syslog.cnf etc/mysql/conf.d +etc/apparmor.d/usr.sbin.mysqld +usr/bin/aria_chk +usr/bin/aria_dump_log +usr/bin/aria_ftdump +usr/bin/aria_pack +usr/bin/aria_read_log usr/bin/msql2mysql usr/bin/my_print_defaults -usr/bin/myisamchk usr/bin/myisam_ftdump +usr/bin/myisamchk usr/bin/myisamlog usr/bin/myisampack -usr/bin/aria_pack -usr/bin/aria_read_log -usr/bin/aria_ftdump -usr/bin/aria_chk -usr/bin/aria_dump_log usr/bin/mysql_convert_table_format usr/bin/mysql_install_db usr/bin/mysql_plugin @@ -69,35 +33,71 @@ usr/bin/wsrep_sst_mysqldump usr/bin/wsrep_sst_rsync usr/bin/wsrep_sst_xtrabackup usr/bin/wsrep_sst_xtrabackup-v2 +usr/lib/mysql/plugin/auth_pam.so +usr/lib/mysql/plugin/auth_pam.so +usr/lib/mysql/plugin/auth_socket.so +usr/lib/mysql/plugin/auth_socket.so +usr/lib/mysql/plugin/file_key_management.so +usr/lib/mysql/plugin/file_key_management.so +usr/lib/mysql/plugin/ha_archive.so +usr/lib/mysql/plugin/ha_archive.so +usr/lib/mysql/plugin/ha_blackhole.so +usr/lib/mysql/plugin/ha_blackhole.so +usr/lib/mysql/plugin/ha_federated.so +usr/lib/mysql/plugin/ha_federated.so +usr/lib/mysql/plugin/ha_federatedx.so +usr/lib/mysql/plugin/ha_federatedx.so +usr/lib/mysql/plugin/ha_mroonga.so +usr/lib/mysql/plugin/ha_mroonga.so +usr/lib/mysql/plugin/ha_sphinx.so +usr/lib/mysql/plugin/ha_sphinx.so +usr/lib/mysql/plugin/handlersocket.so +usr/lib/mysql/plugin/handlersocket.so +usr/lib/mysql/plugin/locales.so +usr/lib/mysql/plugin/locales.so +usr/lib/mysql/plugin/metadata_lock_info.so +usr/lib/mysql/plugin/metadata_lock_info.so +usr/lib/mysql/plugin/query_cache_info.so +usr/lib/mysql/plugin/query_cache_info.so +usr/lib/mysql/plugin/query_response_time.so +usr/lib/mysql/plugin/query_response_time.so +usr/lib/mysql/plugin/semisync_master.so +usr/lib/mysql/plugin/semisync_master.so +usr/lib/mysql/plugin/semisync_slave.so +usr/lib/mysql/plugin/semisync_slave.so +usr/lib/mysql/plugin/server_audit.so +usr/lib/mysql/plugin/simple_password_check.so +usr/lib/mysql/plugin/sql_errlog.so +usr/lib/mysql/plugin/user_variables.so +usr/lib/mysql/plugin/wsrep_info.so +usr/share/apport/package-hooks/source_mariadb-10.2.py usr/share/doc/mariadb-server-10.2/mysqld.sym.gz usr/share/man/man1/msql2mysql.1 -usr/share/man/man1/myisamchk.1 +usr/share/man/man1/my_print_defaults.1 usr/share/man/man1/myisam_ftdump.1 +usr/share/man/man1/myisamchk.1 usr/share/man/man1/myisamlog.1 usr/share/man/man1/myisampack.1 -usr/share/man/man1/my_print_defaults.1 -usr/share/man/man1/mysqlbinlog.1 usr/share/man/man1/mysql_convert_table_format.1 -usr/share/man/man1/mysqld_multi.1 -usr/share/man/man1/mysqld_safe.1 -usr/share/man/man1/mysqlhotcopy.1 usr/share/man/man1/mysql_install_db.1 usr/share/man/man1/mysql_secure_installation.1 usr/share/man/man1/mysql_setpermission.1 +usr/share/man/man1/mysql_tzinfo_to_sql.1 +usr/share/man/man1/mysqlbinlog.1 +usr/share/man/man1/mysqld_multi.1 +usr/share/man/man1/mysqld_safe.1 +usr/share/man/man1/mysqlhotcopy.1 usr/share/man/man1/perror.1 usr/share/man/man1/replace.1 -usr/share/man/man1/resolveip.1 usr/share/man/man1/resolve_stack_dump.1 -usr/share/man/man1/mysql_tzinfo_to_sql.1 -debian/additions/debian-start.inc.sh usr/share/mysql -debian/additions/echo_stderr usr/share/mysql +usr/share/man/man1/resolveip.1 usr/share/mysql/errmsg-utf8.txt usr/share/mysql/fill_help_tables.sql usr/share/mysql/maria_add_gis_sp_bootstrap.sql usr/share/mysql/mroonga/install.sql usr/share/mysql/mroonga/uninstall.sql -usr/share/mysql/mysql_system_tables_data.sql -usr/share/mysql/mysql_system_tables.sql usr/share/mysql/mysql_performance_tables.sql +usr/share/mysql/mysql_system_tables.sql +usr/share/mysql/mysql_system_tables_data.sql usr/share/mysql/mysql_test_data_timezone.sql usr/share/mysql/wsrep_notify diff --git a/debian/mariadb-test-data.install b/debian/mariadb-test-data.install index 23603dd14bf0e..3cd11e1aea937 100644 --- a/debian/mariadb-test-data.install +++ b/debian/mariadb-test-data.install @@ -1,9 +1,9 @@ usr/share/mysql/mysql-test/collections usr/share/mysql/mysql-test/extra usr/share/mysql/mysql-test/include -usr/share/mysql/mysql-test/unstable-tests usr/share/mysql/mysql-test/plugin usr/share/mysql/mysql-test/r usr/share/mysql/mysql-test/std_data usr/share/mysql/mysql-test/suite usr/share/mysql/mysql-test/t +usr/share/mysql/mysql-test/unstable-tests diff --git a/debian/mariadb-test.install b/debian/mariadb-test.install index 873cd07cc92d4..5e6c3717d1f7f 100644 --- a/debian/mariadb-test.install +++ b/debian/mariadb-test.install @@ -6,8 +6,8 @@ usr/lib/mysql/plugin/adt_null.so usr/lib/mysql/plugin/auth_0x0100.so usr/lib/mysql/plugin/auth_test_plugin.so usr/lib/mysql/plugin/daemon_example.ini -usr/lib/mysql/plugin/dialog_examples.so usr/lib/mysql/plugin/debug_key_management.so +usr/lib/mysql/plugin/dialog_examples.so usr/lib/mysql/plugin/example_key_management.so usr/lib/mysql/plugin/ha_example.so usr/lib/mysql/plugin/ha_test_sql_discovery.so diff --git a/debian/rules b/debian/rules index 0ef9138541bb0..bf4f4399ff0c7 100755 --- a/debian/rules +++ b/debian/rules @@ -116,18 +116,18 @@ override_dh_auto_install: dh_testroot # If TokuDB plugin was not built skip the package - [ -f $(BUILDDIR)/storage/tokudb/ha_tokudb.so ] || sed -i -e "/Package: mariadb-plugin-tokudb/,+12d" debian/control + [ -f $(BUILDDIR)/storage/tokudb/ha_tokudb.so ] || sed -i -e "/Package: mariadb-plugin-tokudb/,+14d" debian/control # If Mroonga plugin was not built skip the package - [ -f $(BUILDDIR)/storage/mroonga/ha_mroonga.so ] || sed -i -e "/Package: mariadb-plugin-mroonga/,+11d" debian/control + [ -f $(BUILDDIR)/storage/mroonga/ha_mroonga.so ] || sed -i -e "/Package: mariadb-plugin-mroonga/,+13d" debian/control # If libthrift-dev was available (manually installed, as it is # not in Debian) and ha_cassandra.so was thus built, create package, # otherwise skip it. - [ -f $(BUILDDIR)/storage/cassandra/ha_cassandra.so ] || sed -i -e "/Package: mariadb-plugin-cassandra/,+14d" debian/control + [ -f $(BUILDDIR)/storage/cassandra/ha_cassandra.so ] || sed -i -e "/Package: mariadb-plugin-cassandra/,+16d" debian/control # If Spider plugin was not built skip the package - [ -f $(BUILDDIR)/storage/spider/ha_spider.so ] || sed -i -e "/Package: mariadb-plugin-spider/,+12d" debian/control + [ -f $(BUILDDIR)/storage/spider/ha_spider.so ] || sed -i -e "/Package: mariadb-plugin-spider/,+14d" debian/control # make install cd $(BUILDDIR) && $(MAKE) install DESTDIR=$(TMP) From f63799d068530a5b460848fadd4930d44fb89d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Mon, 10 Oct 2016 05:59:28 +0300 Subject: [PATCH 16/71] MDEV-6284: Clean up crufs (dirs files, duplicate entries etc) --- debian/libmariadbclient-dev.dirs | 2 -- debian/libmariadbclient18.dirs | 1 - debian/mariadb-client-10.2.dirs | 3 --- debian/mariadb-common.dirs | 1 + debian/mariadb-server-10.2.install | 38 ------------------------------ 5 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 debian/libmariadbclient-dev.dirs delete mode 100644 debian/libmariadbclient18.dirs delete mode 100644 debian/mariadb-client-10.2.dirs create mode 100644 debian/mariadb-common.dirs diff --git a/debian/libmariadbclient-dev.dirs b/debian/libmariadbclient-dev.dirs deleted file mode 100644 index f6ad287043100..0000000000000 --- a/debian/libmariadbclient-dev.dirs +++ /dev/null @@ -1,2 +0,0 @@ -usr/include/ -usr/lib/ diff --git a/debian/libmariadbclient18.dirs b/debian/libmariadbclient18.dirs deleted file mode 100644 index 2964de6141b60..0000000000000 --- a/debian/libmariadbclient18.dirs +++ /dev/null @@ -1 +0,0 @@ -usr/lib/ diff --git a/debian/mariadb-client-10.2.dirs b/debian/mariadb-client-10.2.dirs deleted file mode 100644 index ceda5922c5d59..0000000000000 --- a/debian/mariadb-client-10.2.dirs +++ /dev/null @@ -1,3 +0,0 @@ -usr/bin/ -usr/share/man/man1/ -usr/share/perl5/ diff --git a/debian/mariadb-common.dirs b/debian/mariadb-common.dirs new file mode 100644 index 0000000000000..87c71c1c2f5c2 --- /dev/null +++ b/debian/mariadb-common.dirs @@ -0,0 +1 @@ +etc/mysql/mariadb.conf.d/ diff --git a/debian/mariadb-server-10.2.install b/debian/mariadb-server-10.2.install index 117b7948c25b7..4b0ab4ecd222a 100644 --- a/debian/mariadb-server-10.2.install +++ b/debian/mariadb-server-10.2.install @@ -34,37 +34,20 @@ usr/bin/wsrep_sst_rsync usr/bin/wsrep_sst_xtrabackup usr/bin/wsrep_sst_xtrabackup-v2 usr/lib/mysql/plugin/auth_pam.so -usr/lib/mysql/plugin/auth_pam.so -usr/lib/mysql/plugin/auth_socket.so usr/lib/mysql/plugin/auth_socket.so usr/lib/mysql/plugin/file_key_management.so -usr/lib/mysql/plugin/file_key_management.so -usr/lib/mysql/plugin/ha_archive.so usr/lib/mysql/plugin/ha_archive.so usr/lib/mysql/plugin/ha_blackhole.so -usr/lib/mysql/plugin/ha_blackhole.so -usr/lib/mysql/plugin/ha_federated.so usr/lib/mysql/plugin/ha_federated.so usr/lib/mysql/plugin/ha_federatedx.so -usr/lib/mysql/plugin/ha_federatedx.so -usr/lib/mysql/plugin/ha_mroonga.so -usr/lib/mysql/plugin/ha_mroonga.so -usr/lib/mysql/plugin/ha_sphinx.so usr/lib/mysql/plugin/ha_sphinx.so usr/lib/mysql/plugin/handlersocket.so -usr/lib/mysql/plugin/handlersocket.so -usr/lib/mysql/plugin/locales.so usr/lib/mysql/plugin/locales.so usr/lib/mysql/plugin/metadata_lock_info.so -usr/lib/mysql/plugin/metadata_lock_info.so -usr/lib/mysql/plugin/query_cache_info.so usr/lib/mysql/plugin/query_cache_info.so usr/lib/mysql/plugin/query_response_time.so -usr/lib/mysql/plugin/query_response_time.so -usr/lib/mysql/plugin/semisync_master.so usr/lib/mysql/plugin/semisync_master.so usr/lib/mysql/plugin/semisync_slave.so -usr/lib/mysql/plugin/semisync_slave.so usr/lib/mysql/plugin/server_audit.so usr/lib/mysql/plugin/simple_password_check.so usr/lib/mysql/plugin/sql_errlog.so @@ -72,30 +55,9 @@ usr/lib/mysql/plugin/user_variables.so usr/lib/mysql/plugin/wsrep_info.so usr/share/apport/package-hooks/source_mariadb-10.2.py usr/share/doc/mariadb-server-10.2/mysqld.sym.gz -usr/share/man/man1/msql2mysql.1 -usr/share/man/man1/my_print_defaults.1 -usr/share/man/man1/myisam_ftdump.1 -usr/share/man/man1/myisamchk.1 -usr/share/man/man1/myisamlog.1 -usr/share/man/man1/myisampack.1 -usr/share/man/man1/mysql_convert_table_format.1 -usr/share/man/man1/mysql_install_db.1 -usr/share/man/man1/mysql_secure_installation.1 -usr/share/man/man1/mysql_setpermission.1 -usr/share/man/man1/mysql_tzinfo_to_sql.1 -usr/share/man/man1/mysqlbinlog.1 -usr/share/man/man1/mysqld_multi.1 -usr/share/man/man1/mysqld_safe.1 -usr/share/man/man1/mysqlhotcopy.1 -usr/share/man/man1/perror.1 -usr/share/man/man1/replace.1 -usr/share/man/man1/resolve_stack_dump.1 -usr/share/man/man1/resolveip.1 usr/share/mysql/errmsg-utf8.txt usr/share/mysql/fill_help_tables.sql usr/share/mysql/maria_add_gis_sp_bootstrap.sql -usr/share/mysql/mroonga/install.sql -usr/share/mysql/mroonga/uninstall.sql usr/share/mysql/mysql_performance_tables.sql usr/share/mysql/mysql_system_tables.sql usr/share/mysql/mysql_system_tables_data.sql From 19cffe69c240e58dc865c7df2f781078c04dbc23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Mon, 10 Oct 2016 11:28:26 +0300 Subject: [PATCH 17/71] MDEV-6284: Revert commit af03ba84 partially for systemd This version of Debian packaging does not yet install systemd scripts, so revert that part to the CMakeLists.txt based hack. --- CMakeLists.txt | 6 ++++++ ...b-server-10.2.install => mariadb-server-10.2.install.in} | 1 + debian/rules | 3 +++ 3 files changed, 10 insertions(+) rename debian/{mariadb-server-10.2.install => mariadb-server-10.2.install.in} (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index b19b796621f50..54b3cbee939e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -435,6 +435,12 @@ CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/cmake/info_macros.cmake.in ${CMAKE_BINARY_DIR}/info_macros.cmake @ONLY) +IF(DEB) + CONFIGURE_FILE( + ${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.2.install.in + ${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.2.install) +ENDIF(DEB) + # Handle the "INFO_*" files. INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake) # Source: This can be done during the cmake phase, all information is diff --git a/debian/mariadb-server-10.2.install b/debian/mariadb-server-10.2.install.in similarity index 99% rename from debian/mariadb-server-10.2.install rename to debian/mariadb-server-10.2.install.in index 4b0ab4ecd222a..fb435af3034a9 100644 --- a/debian/mariadb-server-10.2.install +++ b/debian/mariadb-server-10.2.install.in @@ -63,3 +63,4 @@ usr/share/mysql/mysql_system_tables.sql usr/share/mysql/mysql_system_tables_data.sql usr/share/mysql/mysql_test_data_timezone.sql usr/share/mysql/wsrep_notify +@SYSTEMD_DEB_FILES@ diff --git a/debian/rules b/debian/rules index bf4f4399ff0c7..7a7a93bec5697 100755 --- a/debian/rules +++ b/debian/rules @@ -156,7 +156,10 @@ override_dh_installlogrotate-arch: # Start mysql at sequence number 19 before 20 where apache, proftpd etc gets # started which might depend on a running database server. override_dh_installinit-arch: + if [ -x /usr/bin/dh_systemd_enable -a -f debian/mariadb-server-10.2/lib/systemd/system/mariadb.service ]; then dh_systemd_enable -pmariadb-server-10.2 mariadb.service; fi + if [ -x /usr/bin/dh_systemd_enable -a -f debian/mariadb-server-10.2/lib/systemd/system/mariadb@.service ]; then dh_systemd_enable --no-enable -pmariadb-server-10.2 mariadb@.service; fi dh_installinit --name=mysql -- defaults 19 21 + if [ -x /usr/bin/dh_systemd_start -a -f debian/mariadb-server-10.2/lib/systemd/system/mariadb.service ]; then dh_systemd_start -pmariadb-server-10.2 --restart-after-upgrade mariadb.service; fi override_dh_installcron-arch: dh_installcron --name mysql-server From 4b7004dfcefe36de7e140a00df2231c3fc791090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Mon, 10 Oct 2016 13:50:38 +0300 Subject: [PATCH 18/71] Travis-CI: build less verbose, log must stay under 4MB limit --- debian/autobake-deb.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index 7368bfcfc20c7..639aa2777de75 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -62,6 +62,13 @@ then sed 's/Standards-Version/,libpcre3-dev (>= 2:8.35-3.2~)\nStandards-Version/' debian/control fi +# On Travis-CI, the log must stay under 4MB so make the build less verbose +if [[ $TRAVIS ]] +then + sed -i -e '/Add support for verbose builds/,+2d' debian/rules +fi + + # Adjust changelog, add new version. # echo "Incrementing changelog and starting build scripts" From 8c32d959203e88a20e066338630f3d88ec27fea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Tue, 11 Oct 2016 17:26:22 +0300 Subject: [PATCH 19/71] MDEV-6284: Activate quilt patches again: test table expection needed Buildbot tries to create database 'test' so we need to have these Debian-only exceptions enabled and patch our own source at build time. --- debian/control | 1 + debian/patches/{series => 00list} | 0 debian/rules | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) rename debian/patches/{series => 00list} (100%) diff --git a/debian/control b/debian/control index 7d5e983bfea61..e2748c6d17ff8 100644 --- a/debian/control +++ b/debian/control @@ -7,6 +7,7 @@ Build-Depends: bison, cmake (>= 2.7), debhelper (>= 9), dh-apparmor, + dpatch, libaio-dev, libboost-dev, libjemalloc-dev (>= 3.0.0~) [linux-any], diff --git a/debian/patches/series b/debian/patches/00list similarity index 100% rename from debian/patches/series rename to debian/patches/00list diff --git a/debian/rules b/debian/rules index 7a7a93bec5697..c14076ed67bab 100755 --- a/debian/rules +++ b/debian/rules @@ -168,6 +168,6 @@ get-orig-source: uscan --force-download --verbose %: - dh $@ --parallel + dh $@ --parallel --with dpatch # vim: ts=8 From affa6e3d6db684cb0fc098c3cb4e50d171d43056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Tue, 11 Oct 2016 18:45:59 +0300 Subject: [PATCH 20/71] MDEV-6284: Break/replace MySQL 5.7 packages to allow upgrade Also sort control file slightly to be easier to compare to downstream control file and include gdb for automatic backtraces if the test suite fails. Delete duplicate man page installation. Make mariadb-test breaks/replaces mariadb-server-5.5 as /usr/lib/mysql/plugin/adt_null.so changed package. --- debian/control | 54 ++++++++++++++++++----------- debian/libmariadbclient-dev.install | 1 - 2 files changed, 34 insertions(+), 21 deletions(-) diff --git a/debian/control b/debian/control index e2748c6d17ff8..c826f6ad102de 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Build-Depends: bison, debhelper (>= 9), dh-apparmor, dpatch, - libaio-dev, + libaio-dev [linux-any], libboost-dev, libjemalloc-dev (>= 3.0.0~) [linux-any], libjudy-dev, @@ -70,7 +70,6 @@ Section: libdevel Provides: libmysqld-dev Pre-Depends: ${misc:Pre-Depends} Depends: libmariadbclient-dev (= ${binary:Version}), - libmariadbd18 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} Breaks: libmysqld-dev @@ -137,11 +136,6 @@ Depends: libmariadbclient18 (>= ${source:Version}), mariadb-common (>= ${source:Version}), ${misc:Depends}, ${shlibs:Depends} -Provides: mysql-client-core, - mysql-client-core-5.1, - mysql-client-core-5.5, - mysql-client-core-5.6, - virtual-mysql-client-core Conflicts: mariadb-client-10.0, mariadb-client-10.1, mariadb-client-5.1, @@ -161,6 +155,7 @@ Conflicts: mariadb-client-10.0, mysql-client-core-5.1, mysql-client-core-5.5, mysql-client-core-5.6, + mysql-client-core-5.7, virtual-mysql-client-core Replaces: mariadb-client-10.0, mariadb-client-10.1, @@ -181,6 +176,13 @@ Replaces: mariadb-client-10.0, mysql-client-core-5.1, mysql-client-core-5.5, mysql-client-core-5.6, + mysql-client-core-5.7, + virtual-mysql-client-core +Provides: mysql-client-core, + mysql-client-core-5.1, + mysql-client-core-5.5, + mysql-client-core-5.6, + mysql-client-core-5.7, virtual-mysql-client-core Description: MariaDB database core client binaries MariaDB is a fast, stable and true multi-user, multi-threaded SQL database @@ -199,12 +201,6 @@ Depends: debianutils (>=1.6), ${misc:Depends}, ${perl:Depends}, ${shlibs:Depends} -Provides: mysql-client, - mysql-client-4.1, - mysql-client-5.1, - mysql-client-5.5, - mysql-client-5.6, - virtual-mysql-client Conflicts: mariadb-client (<< ${source:Version}), mariadb-client-10.0, mariadb-client-10.1, @@ -217,6 +213,7 @@ Conflicts: mariadb-client (<< ${source:Version}), mysql-client-5.1, mysql-client-5.5, mysql-client-5.6, + mysql-client-5.7, virtual-mysql-client Replaces: mariadb-client (<< ${source:Version}), mariadb-client-10.0, @@ -230,6 +227,14 @@ Replaces: mariadb-client (<< ${source:Version}), mysql-client-5.1, mysql-client-5.5, mysql-client-5.6, + mysql-client-5.7, + virtual-mysql-client +Provides: mysql-client, + mysql-client-4.1, + mysql-client-5.1, + mysql-client-5.5, + mysql-client-5.6, + mysql-client-5.7, virtual-mysql-client Recommends: libdbd-mysql-perl (>= 1.2202), libdbi-perl, libterm-readkey-perl Description: MariaDB database client binaries @@ -247,11 +252,6 @@ Depends: libmariadbclient18 (>= ${binary:Version}), mariadb-common (>= ${source:Version}), ${misc:Depends}, ${shlibs:Depends} -Provides: mysql-server-core, - mysql-server-core-5.1, - mysql-server-core-5.5, - mysql-server-core-5.6, - virtual-mysql-server-core Conflicts: mariadb-server-core-10.0, mariadb-server-core-10.1, mariadb-server-core-5.1, @@ -263,8 +263,11 @@ Conflicts: mariadb-server-core-10.0, mysql-server-core-5.1, mysql-server-core-5.5, mysql-server-core-5.6, + mysql-server-core-5.7, virtual-mysql-server-core -Replaces: mariadb-server-core-10.0, +Breaks: mariadb-server-10.2 (<< ${source:Version}) +Replaces: mariadb-server-10.2 (<< ${source:Version}), + mariadb-server-core-10.0, mariadb-server-core-10.1, mariadb-server-core-5.1, mariadb-server-core-5.2, @@ -275,6 +278,13 @@ Replaces: mariadb-server-core-10.0, mysql-server-core-5.1, mysql-server-core-5.5, mysql-server-core-5.6, + mysql-server-core-5.7, + virtual-mysql-server-core +Provides: mysql-server-core, + mysql-server-core-5.1, + mysql-server-core-5.5, + mysql-server-core-5.6, + mysql-server-core-5.7, virtual-mysql-server-core Description: MariaDB database core server files MariaDB is a fast, stable and true multi-user, multi-threaded SQL database @@ -307,7 +317,6 @@ Depends: bsdutils, socat, ${misc:Depends}, ${shlibs:Depends} -Provides: mariadb-server, mysql-server, virtual-mysql-server Conflicts: mariadb-server (<< ${source:Version}), mariadb-server-10.0, mariadb-server-10.1, @@ -324,6 +333,7 @@ Conflicts: mariadb-server (<< ${source:Version}), mysql-server-5.1, mysql-server-5.5, mysql-server-5.6, + mysql-server-5.7, virtual-mysql-server Replaces: libmariadbclient-dev (<< 5.5.0), libmariadbclient16 (<< 5.3.4), @@ -343,7 +353,9 @@ Replaces: libmariadbclient-dev (<< 5.5.0), mysql-server-5.1, mysql-server-5.5, mysql-server-5.6, + mysql-server-5.7, virtual-mysql-server +Provides: virtual-mysql-server Description: MariaDB database server binaries MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query @@ -386,6 +398,7 @@ Depends: mariadb-client-10.2 (= ${binary:Version}), Breaks: mariadb-test-10.0, mariadb-test-10.1, mariadb-test-5.5, + mariadb-server-5.5, mysql-testsuite, mysql-testsuite-5.5, mysql-testsuite-5.6, @@ -394,6 +407,7 @@ Breaks: mariadb-test-10.0, Replaces: mariadb-test-10.0, mariadb-test-10.1, mariadb-test-5.5, + mariadb-server-5.5, mysql-testsuite, mysql-testsuite-5.5, mysql-testsuite-5.6, diff --git a/debian/libmariadbclient-dev.install b/debian/libmariadbclient-dev.install index 63c0b8fccaa88..9e481125c65bd 100644 --- a/debian/libmariadbclient-dev.install +++ b/debian/libmariadbclient-dev.install @@ -5,5 +5,4 @@ usr/lib/*/libmariadb.so usr/lib/*/libmariadbclient.a usr/lib/*/libmysqlservices.a usr/share/aclocal/mysql.m4 -usr/share/man/man1/mysql_config.1 usr/share/pkgconfig/mariadb.pc From 7f570bef1e3a6b19925bf7e58e02b975548039eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Fri, 21 Oct 2016 13:52:36 +0300 Subject: [PATCH 21/71] Deb: fix commit 1369696 and change autobake strategy to Debian Sid first --- debian/autobake-deb.sh | 33 ++++++++++++--------------------- debian/control | 12 ++++++++++++ 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index 639aa2777de75..c463164ca162f 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -31,35 +31,26 @@ PATCHLEVEL="+maria" LOGSTRING="MariaDB build" # Look up distro-version specific stuff. +# Always keep the actual packaging as up-to-date as possible following the latest +# Debian policy and targetting Debian Sid. Then case-by-case run in autobake-deb.sh +# tests for backwards compatibility and strip away parts on older builders. CODENAME="$(lsb_release -sc)" -# Add libcrack2 (>= 2.9.0) as a build dependency if available in the distribution -# This matches Debian Jessie, Stretch and Ubuntu Trusty, Wily, Xenial, Yakkety -# Update check when version 2.10 or newer is available. -if apt-cache madison libcrack2-dev | grep 'libcrack2-dev *| *2\.9' >/dev/null 2>&1 +# If libcrack2 (>= 2.9.0) is not available (before Debian Jessie and Ubuntu Trusty) +# clean away the cracklib stanzas so the package can build without them. +if ! apt-cache madison libcrack2-dev | grep 'libcrack2-dev *| *2\.9' >/dev/null 2>&1 then - sed 's/Standards-Version/,libcrack2-dev (>= 2.9.0)\nStandards-Version/' debian/control - cat <> debian/control - -Package: mariadb-cracklib-password-check-10.2 -Architecture: any -Depends: libcrack2 (>= 2.9.0), - mariadb-server-10.2, - \${misc:Depends}, - \${shlibs:Depends} -Description: CrackLib Password Validation Plugin for MariaDB - This password validation plugin uses cracklib to allow only - sufficiently secure (as defined by cracklib) user passwords in MariaDB. -EOT + sed '/libcrack2-dev/d' -i debian/control + sed '/Package: mariadb-plugin-cracklib/,+10d' -i debian/control fi -# Add libpcre3-dev (>= 2:8.35-3.2~) as a build dependency if available in the distribution -# This matches Debian Jessie, Stretch and Ubuntu Wily, Xenial, Yakkety +# If libpcre3-dev (>= 2:8.35-3.2~) is not available (before Debian Jessie or Ubuntu Wily) +# clean away the PCRE3 stanzas so the package can build without them. # Update check when version 2:8.40 or newer is available. -if apt-cache madison libpcre3-dev | grep 'libpcre3-dev *| *2:8\.3[2-9]' >/dev/null 2>&1 +if ! apt-cache madison libpcre3-dev | grep 'libpcre3-dev *| *2:8\.3[2-9]' >/dev/null 2>&1 then - sed 's/Standards-Version/,libpcre3-dev (>= 2:8.35-3.2~)\nStandards-Version/' debian/control + sed '/libpcre3-dev/d' -i debian/control fi # On Travis-CI, the log must stay under 4MB so make the build less verbose diff --git a/debian/control b/debian/control index c826f6ad102de..b9cfeff7684aa 100644 --- a/debian/control +++ b/debian/control @@ -10,11 +10,13 @@ Build-Depends: bison, dpatch, libaio-dev [linux-any], libboost-dev, + libcrack2-dev (>= 2.9.0), libjemalloc-dev (>= 3.0.0~) [linux-any], libjudy-dev, libkrb5-dev, libncurses5-dev (>= 5.0-6~), libpam0g-dev, + libpcre3-dev (>= 2:8.35-3.2~), libreadline-gplv2-dev, libssl-dev, libxml2-dev, @@ -555,3 +557,13 @@ Depends: libgssapi-krb5-2, Breaks: mariadb-gssapi-client-10.1, mariadb-gssapi-client-10.2 Replaces: mariadb-gssapi-client-10.1, mariadb-gssapi-client-10.2 Description: GSSAPI authentication plugin for MariaDB client + +Package: mariadb-plugin-cracklib-password-check +Architecture: any +Depends: libcrack2 (>= 2.9.0), + mariadb-server-10.2, + ${misc:Depends}, + ${shlibs:Depends} +Description: CrackLib Password Validation Plugin for MariaDB + This password validation plugin uses cracklib to allow only + sufficiently secure (as defined by cracklib) user passwords in MariaDB. From 0668e6ba49f0004e7f137b22c912cea74069d851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Wed, 26 Oct 2016 02:12:18 +0300 Subject: [PATCH 22/71] Travis-CI: skip building mariadb-test packages to speed up build The build must stay under the Travis-CI 50 minute limit. Currently they often exceed, and the huge test suite is the single most long step in moving/packaging files, so remove it on Travis-CI automatically. --- debian/autobake-deb.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index c463164ca162f..2a5fe01592481 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -21,6 +21,13 @@ then export DEB_BUILD_OPTIONS="nocheck" fi +# Don't include test suite package on Travis-CI to make the build time shorter +if [[ $TRAVIS ]] +then + sed '/Package: mariadb-test-data/,+26d' -i debian/control + sed '/Package: mariadb-test/,+34d' -i debian/control +fi + export MARIADB_OPTIONAL_DEBS="" # Find major.minor version. From bfda961c86849a4a6fea4b6d71a38266758b1bc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sat, 29 Oct 2016 01:30:50 +0300 Subject: [PATCH 23/71] Deb: omit source building step when running from autobake-deb.sh This will increase the speed of the build by a minute or two. --- debian/autobake-deb.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index 2a5fe01592481..f8d313204d2da 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -78,7 +78,9 @@ echo "Creating package version ${UPSTREAM}${PATCHLEVEL}~${CODENAME} ... " # Build the package. # Pass -I so that .git and other unnecessary temporary and source control files # will be ignored by dpkg-source when createing the tar.gz source package -fakeroot dpkg-buildpackage -us -uc -I +# Use -b to build binary only packages as there is no need to waste time on +# generating the source package. +fakeroot dpkg-buildpackage -us -uc -I -b [ -e debian/autorm-file ] && rm -vf `cat debian/autorm-file` From 02a6f61a8ab651c0210bf05b4b697849e985e5e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sat, 29 Oct 2016 02:17:14 +0300 Subject: [PATCH 24/71] Deb: delete runnable files we don't want to have in the test data package --- debian/rules | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/debian/rules b/debian/rules index c14076ed67bab..eca59c5b1f7a3 100755 --- a/debian/rules +++ b/debian/rules @@ -132,6 +132,11 @@ override_dh_auto_install: # make install cd $(BUILDDIR) && $(MAKE) install DESTDIR=$(TMP) + # Delete runnable files we don't want to have in the test data package. + # This avoids triggering multiple Lintian errors. + rm -rf $(TMP)/usr/share/mysql/mysql-test/plugin/tokudb/tokudb/*.py + rm -rf $(TMP)/usr/share/mysql/mysql-test/plugin/tokudb/tokudb/t/*.py + # nm numeric soft is not enough, therefore extra sort in command # to satisfy Debian reproducible build requirements nm --defined-only $(BUILDDIR)/sql/mysqld | LC_ALL=C sort | gzip -n -9 > $(TMP)/usr/share/doc/mariadb-server-10.2/mysqld.sym.gz From 7316b14144ceeed40dc976b9b5f2aa97f07a3eb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sat, 29 Oct 2016 02:55:19 +0300 Subject: [PATCH 25/71] Deb: use deb-sys-maint user credentials to configure MariaDB plugins On systems with unix socket authentication root could run these without any special maintenance accounts. --- debian/mariadb-plugin-mroonga.postinst | 2 +- debian/mariadb-plugin-mroonga.prerm | 2 +- debian/mariadb-plugin-spider.postinst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/mariadb-plugin-mroonga.postinst b/debian/mariadb-plugin-mroonga.postinst index 70b8929250f0a..31b53a5e3edb9 100644 --- a/debian/mariadb-plugin-mroonga.postinst +++ b/debian/mariadb-plugin-mroonga.postinst @@ -5,7 +5,7 @@ set -e # Install Mroonga # No user or password parameter is required with new MariaDB that # has unix socket authentication support by default. -mysql < /usr/share/mysql/mroonga/install.sql || true +mysql --defaults-file=/etc/mysql/debian.cnf < /usr/share/mysql/mroonga/install.sql || true # Always exit with success instead of leaving dpkg in a broken state diff --git a/debian/mariadb-plugin-mroonga.prerm b/debian/mariadb-plugin-mroonga.prerm index 3f1a1c58e8e00..3f707f1741f61 100644 --- a/debian/mariadb-plugin-mroonga.prerm +++ b/debian/mariadb-plugin-mroonga.prerm @@ -5,7 +5,7 @@ set -e # Install Mroonga # No user or password parameter is required with new MariaDB that # has unix socket authentication support by default. -mysql < /usr/share/mysql/mroonga/uninstall.sql || true +mysql --defaults-file=/etc/mysql/debian.cnf < /usr/share/mysql/mroonga/uninstall.sql || true # Always exit with success instead of leaving dpkg in a broken state diff --git a/debian/mariadb-plugin-spider.postinst b/debian/mariadb-plugin-spider.postinst index 5e43d38226cbe..1d9d359c182bb 100644 --- a/debian/mariadb-plugin-spider.postinst +++ b/debian/mariadb-plugin-spider.postinst @@ -5,7 +5,7 @@ set -e # Install Spider # No user or password parameter is required with new MariaDB that # has unix socket authentication support by default. -mysql < /usr/share/mysql/install_spider.sql || true +mysql --defaults-file=/etc/mysql/debian.cnf < /usr/share/mysql/install_spider.sql || true # Always exit with success instead of leaving dpkg in a broken state From c912d05fab9db5829c403432fddece257c75ece0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Sat, 29 Oct 2016 02:43:45 +0300 Subject: [PATCH 26/71] MDEV-6284: Install systemd files (almost) the Debian way The control file contents must be correct from the start and cannot be modified at build time by CMake. Also all static Debian package analyzers will fail to see all manipulations by CMake later on. It is best to do all manipulations like these in autobake-deb.sh. --- CMakeLists.txt | 6 ------ cmake/systemd.cmake | 6 ------ debian/autobake-deb.sh | 14 ++++++++++++++ debian/control | 2 ++ ...10.2.install.in => mariadb-server-10.2.install} | 5 ++++- debian/rules | 14 ++++++++++---- 6 files changed, 30 insertions(+), 17 deletions(-) rename debian/{mariadb-server-10.2.install.in => mariadb-server-10.2.install} (92%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54b3cbee939e9..b19b796621f50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -435,12 +435,6 @@ CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/cmake/info_macros.cmake.in ${CMAKE_BINARY_DIR}/info_macros.cmake @ONLY) -IF(DEB) - CONFIGURE_FILE( - ${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.2.install.in - ${CMAKE_SOURCE_DIR}/debian/mariadb-server-10.2.install) -ENDIF(DEB) - # Handle the "INFO_*" files. INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake) # Source: This can be done during the cmake phase, all information is diff --git a/cmake/systemd.cmake b/cmake/systemd.cmake index 1121fd64dce3b..9b51fb767998a 100644 --- a/cmake/systemd.cmake +++ b/cmake/systemd.cmake @@ -56,12 +56,6 @@ MACRO(CHECK_SYSTEMD) AND HAVE_SYSTEMD_SD_NOTIFY AND HAVE_SYSTEMD_SD_NOTIFYF) ADD_DEFINITIONS(-DHAVE_SYSTEMD) SET(SYSTEMD_SCRIPTS mariadb-service-convert galera_new_cluster galera_recovery) - SET(SYSTEMD_DEB_FILES "usr/bin/mariadb-service-convert - usr/bin/galera_new_cluster - usr/bin/galera_recovery - ${INSTALL_SYSTEMD_UNITDIR}/mariadb.service - ${INSTALL_SYSTEMD_UNITDIR}/mariadb@.service - ${INSTALL_SYSTEMD_UNITDIR}/mariadb@bootstrap.service.d/use_galera_new_cluster.conf") IF(DEB) SET(SYSTEMD_EXECSTARTPRE "ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld") SET(SYSTEMD_EXECSTARTPOST "ExecStartPost=/etc/mysql/debian-start") diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index f8d313204d2da..1201e28009fcc 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -60,6 +60,20 @@ then sed '/libpcre3-dev/d' -i debian/control fi +# If libsystemd-dev is not available (before Debian Jessie or Ubuntu Wily) +# clean away the systemd stanzas so the package can build without them. +if ! apt-cache madison libsystemd-dev | grep 'libsystemd-dev' >/dev/null 2>&1 +then + sed '/dh-systemd/d' -i debian/control + sed '/libsystemd-dev/d' -i debian/control + sed 's/ --with systemd//' -i debian/rules + sed '/systemd/d' -i debian/rules + sed '/\.service/d' -i debian/rules + sed '/galera_new_cluster/d' -i debian/mariadb-server-10.2.install + sed '/galera_recovery/d' -i debian/mariadb-server-10.2.install + sed '/mariadb-service-convert/d' -i debian/mariadb-server-10.2.install +fi + # On Travis-CI, the log must stay under 4MB so make the build less verbose if [[ $TRAVIS ]] then diff --git a/debian/control b/debian/control index b9cfeff7684aa..cd36704ea634b 100644 --- a/debian/control +++ b/debian/control @@ -7,6 +7,7 @@ Build-Depends: bison, cmake (>= 2.7), debhelper (>= 9), dh-apparmor, + dh-systemd, dpatch, libaio-dev [linux-any], libboost-dev, @@ -19,6 +20,7 @@ Build-Depends: bison, libpcre3-dev (>= 2:8.35-3.2~), libreadline-gplv2-dev, libssl-dev, + libsystemd-dev, libxml2-dev, libnuma-dev, lsb-release, diff --git a/debian/mariadb-server-10.2.install.in b/debian/mariadb-server-10.2.install similarity index 92% rename from debian/mariadb-server-10.2.install.in rename to debian/mariadb-server-10.2.install index fb435af3034a9..e8470b757c01a 100644 --- a/debian/mariadb-server-10.2.install.in +++ b/debian/mariadb-server-10.2.install @@ -63,4 +63,7 @@ usr/share/mysql/mysql_system_tables.sql usr/share/mysql/mysql_system_tables_data.sql usr/share/mysql/mysql_test_data_timezone.sql usr/share/mysql/wsrep_notify -@SYSTEMD_DEB_FILES@ +usr/bin/galera_new_cluster +usr/bin/galera_recovery +usr/bin/mariadb-service-convert +lib/systemd/system/mariadb@bootstrap.service.d/use_galera_new_cluster.conf diff --git a/debian/rules b/debian/rules index eca59c5b1f7a3..b0a4ceddca9c2 100755 --- a/debian/rules +++ b/debian/rules @@ -129,6 +129,10 @@ override_dh_auto_install: # If Spider plugin was not built skip the package [ -f $(BUILDDIR)/storage/spider/ha_spider.so ] || sed -i -e "/Package: mariadb-plugin-spider/,+14d" debian/control + # Copy systemd files to a location available for dh_installinit + cp $(BUILDDIR)/support-files/mariadb.service debian/mariadb-server-10.2.mariadb.service + cp $(BUILDDIR)/support-files/mariadb@.service debian/mariadb-server-10.2.mariadb@.service + # make install cd $(BUILDDIR) && $(MAKE) install DESTDIR=$(TMP) @@ -158,13 +162,15 @@ override_dh_auto_install: override_dh_installlogrotate-arch: dh_installlogrotate --name mysql-server +override_dh_systemd_enable: + dh_systemd_enable --name=mariadb + dh_systemd_enable --no-enable --name=mariadb@ + # Start mysql at sequence number 19 before 20 where apache, proftpd etc gets # started which might depend on a running database server. override_dh_installinit-arch: - if [ -x /usr/bin/dh_systemd_enable -a -f debian/mariadb-server-10.2/lib/systemd/system/mariadb.service ]; then dh_systemd_enable -pmariadb-server-10.2 mariadb.service; fi - if [ -x /usr/bin/dh_systemd_enable -a -f debian/mariadb-server-10.2/lib/systemd/system/mariadb@.service ]; then dh_systemd_enable --no-enable -pmariadb-server-10.2 mariadb@.service; fi dh_installinit --name=mysql -- defaults 19 21 - if [ -x /usr/bin/dh_systemd_start -a -f debian/mariadb-server-10.2/lib/systemd/system/mariadb.service ]; then dh_systemd_start -pmariadb-server-10.2 --restart-after-upgrade mariadb.service; fi + dh_systemd_start --restart-after-upgrade override_dh_installcron-arch: dh_installcron --name mysql-server @@ -173,6 +179,6 @@ get-orig-source: uscan --force-download --verbose %: - dh $@ --parallel --with dpatch + dh $@ --parallel --with dpatch --with systemd # vim: ts=8 From 0e380c3bfead7f03e22660c12339ce0960d52089 Mon Sep 17 00:00:00 2001 From: vinchen Date: Sat, 29 Oct 2016 21:59:20 +0800 Subject: [PATCH 27/71] two fix: 1.Avoid overflowing buffers in case of corrupt events 2.Check the compressed algorithm. --- sql/log_event.cc | 104 +++++++++++++++++++++++++++++++++++++++-------- sql/log_event.h | 4 +- sql/slave.cc | 4 +- 3 files changed, 92 insertions(+), 20 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 30a770080944f..422928495a550 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -708,9 +708,10 @@ char *str_to_hex(char *to, const char *from, uint len) /** Compressed Record Record Header: 1 Byte - 0 Bit: Always 1, mean compressed; - 1-3 Bit: Reversed, compressed algorithm - Always 0, means zlib - 4-7 Bit: Bytes of "Record Original Length" + 7 Bit: Always 1, mean compressed; + 4-6 Bit: Compressed algorithm - Always 0, means zlib + It maybe support other compression algorithm in the future. + 0-3 Bit: Bytes of "Record Original Length" Record Original Length: 1-4 Bytes Compressed Buf: */ @@ -793,12 +794,17 @@ int binlog_buf_compress(const char *src, char *dst, uint32 len, uint32 *comlen) int query_event_uncompress(const Format_description_log_event *description_event, - bool contain_checksum, const char *src, char* buf, - ulong buf_size, bool* is_malloc, char **dst, + bool contain_checksum, const char *src, ulong src_len, + char* buf, ulong buf_size, bool* is_malloc, char **dst, ulong *newlen) { ulong len = uint4korr(src + EVENT_LEN_OFFSET); const char *tmp = src; + const char *end = src + len; + + // bad event + if (src_len < len ) + return 1; DBUG_ASSERT((uchar)src[EVENT_TYPE_OFFSET] == QUERY_COMPRESSED_EVENT); @@ -806,14 +812,29 @@ query_event_uncompress(const Format_description_log_event *description_event, uint8 post_header_len= description_event->post_header_len[QUERY_COMPRESSED_EVENT-1]; + *is_malloc = false; + tmp += common_header_len; + // bad event + if (end <= tmp) + return 1; uint db_len = (uint)tmp[Q_DB_LEN_OFFSET]; uint16 status_vars_len= uint2korr(tmp + Q_STATUS_VARS_LEN_OFFSET); tmp += post_header_len + status_vars_len + db_len + 1; + // bad event + if (end <= tmp) + return 1; + int32 comp_len = len - (tmp - src) - + (contain_checksum ? BINLOG_CHECKSUM_LEN : 0); uint32 un_len = binlog_get_uncompress_len(tmp); + + // bad event + if (comp_len < 0 || un_len == 0) + return 1; + *newlen = (tmp - src) + un_len; if(contain_checksum) *newlen += BINLOG_CHECKSUM_LEN; @@ -821,7 +842,7 @@ query_event_uncompress(const Format_description_log_event *description_event, uint32 alloc_size = ALIGN_SIZE(*newlen); char *new_dst = NULL; - *is_malloc = false; + if (alloc_size <= buf_size) { new_dst = buf; @@ -838,7 +859,7 @@ query_event_uncompress(const Format_description_log_event *description_event, /* copy the head*/ memcpy(new_dst, src , tmp - src); if (binlog_buf_uncompress(tmp, new_dst + (tmp - src), - len - (tmp - src), &un_len)) + comp_len, &un_len)) { if (*is_malloc) my_free(new_dst); @@ -862,14 +883,19 @@ query_event_uncompress(const Format_description_log_event *description_event, int row_log_event_uncompress(const Format_description_log_event *description_event, - bool contain_checksum, const char *src, char* buf, - ulong buf_size, bool* is_malloc, char **dst, + bool contain_checksum, const char *src, ulong src_len, + char* buf, ulong buf_size, bool* is_malloc, char **dst, ulong *newlen) { Log_event_type type = (Log_event_type)(uchar)src[EVENT_TYPE_OFFSET]; ulong len = uint4korr(src + EVENT_LEN_OFFSET); const char *tmp = src; char *new_dst = NULL; + const char *end = tmp + len; + + // bad event + if (src_len < len) + return 1; DBUG_ASSERT(LOG_EVENT_IS_ROW_COMPRESSED(type)); @@ -883,8 +909,13 @@ row_log_event_uncompress(const Format_description_log_event *description_event, Have variable length header, check length, which includes length bytes */ + + // bad event + if (end - tmp <= 2) + return 1; + uint16 var_header_len= uint2korr(tmp); - assert(var_header_len >= 2); + DBUG_ASSERT(var_header_len >= 2); /* skip over var-len header, extracting 'chunks' */ tmp += var_header_len; @@ -900,6 +931,10 @@ row_log_event_uncompress(const Format_description_log_event *description_event, (type - WRITE_ROWS_COMPRESSED_EVENT_V1 + WRITE_ROWS_EVENT_V1); } + //bad event + if (end <= tmp) + return 1; + ulong m_width = net_field_length((uchar **)&tmp); tmp += (m_width + 7) / 8; @@ -908,7 +943,21 @@ row_log_event_uncompress(const Format_description_log_event *description_event, tmp += (m_width + 7) / 8; } + //bad event + if (end <= tmp) + return 1; + uint32 un_len = binlog_get_uncompress_len(tmp); + //bad event + if (un_len == 0) + return 1; + + long comp_len = len - (tmp - src) - + (contain_checksum ? BINLOG_CHECKSUM_LEN : 0); + //bad event + if (comp_len <=0) + return 1; + *newlen = (tmp - src) + un_len; if(contain_checksum) *newlen += BINLOG_CHECKSUM_LEN; @@ -933,7 +982,7 @@ row_log_event_uncompress(const Format_description_log_event *description_event, memcpy(new_dst, src , tmp - src); /* Uncompress the body. */ if (binlog_buf_uncompress(tmp, new_dst + (tmp - src), - len - (tmp - src), &un_len)) + comp_len, &un_len)) { if (*is_malloc) my_free(new_dst); @@ -954,6 +1003,7 @@ row_log_event_uncompress(const Format_description_log_event *description_event, /** Get the length of uncompress content. + return 0 means error. */ uint32 binlog_get_uncompress_len(const char *buf) @@ -1004,12 +1054,25 @@ int binlog_buf_uncompress(const char *src, char *dst, uint32 len, uint32 lenlen= src[0] & 0x07; uLongf buflen= *newlen; - if(uncompress((Bytef *)dst, &buflen, - (const Bytef*)src + 1 + lenlen, len) != Z_OK) + + uint32 alg = (src[0] & 0x70) >> 4; + switch(alg) { + case 0: + // zlib + if(uncompress((Bytef *)dst, &buflen, + (const Bytef*)src + 1 + lenlen, len - 1 - lenlen) != Z_OK) + { + return 1; + } + break; + default: + //TODO + //bad algorithm return 1; } + DBUG_ASSERT(*newlen == (uint32)buflen); *newlen = (uint32)buflen; return 0; } @@ -4184,6 +4247,12 @@ Query_compressed_log_event::Query_compressed_log_event(const char *buf, if(query) { uint32 un_len=binlog_get_uncompress_len(query); + if (!un_len) + { + query = 0; + return; + } + /* Reserve one byte for '\0' */ query_buf = (Log_event::Byte*)my_malloc(ALIGN_SIZE(un_len + 1), MYF(MY_WME)); @@ -9974,6 +10043,9 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len, void Rows_log_event::uncompress_buf() { uint32 un_len = binlog_get_uncompress_len((char *)m_rows_buf); + if (!un_len) + return; + uchar *new_buf= (uchar*) my_malloc(ALIGN_SIZE(un_len), MYF(MY_WME)); if (new_buf) { @@ -12306,7 +12378,7 @@ void Write_rows_compressed_log_event::print(FILE *file, bool is_malloc = false; if(!row_log_event_uncompress(glob_description_event, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, - temp_buf, NULL, 0, &is_malloc, &new_buf, &len)) + temp_buf, UINT_MAX32, NULL, 0, &is_malloc, &new_buf, &len)) { free_temp_buf(); register_temp_buf(new_buf, true); @@ -12980,7 +13052,7 @@ void Delete_rows_compressed_log_event::print(FILE *file, bool is_malloc = false; if(!row_log_event_uncompress(glob_description_event, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, - temp_buf, NULL, 0, &is_malloc, &new_buf, &len)) + temp_buf, UINT_MAX32, NULL, 0, &is_malloc, &new_buf, &len)) { free_temp_buf(); register_temp_buf(new_buf, true); @@ -13240,7 +13312,7 @@ void Update_rows_compressed_log_event::print(FILE *file, PRINT_EVENT_INFO *print bool is_malloc= false; if(!row_log_event_uncompress(glob_description_event, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, - temp_buf, NULL, 0, &is_malloc, &new_buf, &len)) + temp_buf, UINT_MAX32, NULL, 0, &is_malloc, &new_buf, &len)) { free_temp_buf(); register_temp_buf(new_buf, true); diff --git a/sql/log_event.h b/sql/log_event.h index 7ac21e379bbd2..bbefbe26f41ec 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -5117,11 +5117,11 @@ uint32 binlog_get_compress_len(uint32 len); uint32 binlog_get_uncompress_len(const char *buf); int query_event_uncompress(const Format_description_log_event *description_event, bool contain_checksum, - const char *src, char* buf, ulong buf_size, bool* is_malloc, + const char *src, ulong src_len, char* buf, ulong buf_size, bool* is_malloc, char **dst, ulong *newlen); int row_log_event_uncompress(const Format_description_log_event *description_event, bool contain_checksum, - const char *src, char* buf, ulong buf_size, bool* is_malloc, + const char *src, ulong src_len, char* buf, ulong buf_size, bool* is_malloc, char **dst, ulong *newlen); diff --git a/sql/slave.cc b/sql/slave.cc index 8f0db28b8583c..aae25c5b6f477 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -6155,7 +6155,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) inc_pos= event_len; if (query_event_uncompress(rli->relay_log.description_event_for_queue, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, - buf, new_buf_arr, sizeof(new_buf_arr), + buf, event_len, new_buf_arr, sizeof(new_buf_arr), &is_malloc, (char **)&new_buf, &event_len)) { char llbuf[22]; @@ -6179,7 +6179,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) { if (row_log_event_uncompress(rli->relay_log.description_event_for_queue, checksum_alg == BINLOG_CHECKSUM_ALG_CRC32, - buf, new_buf_arr, sizeof(new_buf_arr), + buf, event_len, new_buf_arr, sizeof(new_buf_arr), &is_malloc, (char **)&new_buf, &event_len)) { char llbuf[22]; From 40ad9466830cd16793fb892180aae2bf491ce348 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Mon, 31 Oct 2016 07:35:02 +0100 Subject: [PATCH 28/71] MDEV-11187: Server does not compile on labrador --- include/mysql.h.pp | 4 ++-- include/mysql_com.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/mysql.h.pp b/include/mysql.h.pp index 714b26bc16a2d..1ce4c05733679 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -109,8 +109,8 @@ const unsigned char *packet, size_t len); int net_real_write(NET *net,const unsigned char *packet, size_t len); unsigned long my_net_read_packet(NET *net, my_bool read_from_server); -ulong my_net_read_packet_reallen(NET *net, my_bool read_from_server, - ulong* reallen); +unsigned long my_net_read_packet_reallen(NET *net, my_bool read_from_server, + unsigned long* reallen); struct sockaddr; int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen, unsigned int timeout); diff --git a/include/mysql_com.h b/include/mysql_com.h index 60a3c9f8a9a40..57e311538d828 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -585,8 +585,8 @@ my_bool net_write_command(NET *net,unsigned char command, const unsigned char *packet, size_t len); int net_real_write(NET *net,const unsigned char *packet, size_t len); unsigned long my_net_read_packet(NET *net, my_bool read_from_server); -ulong my_net_read_packet_reallen(NET *net, my_bool read_from_server, - ulong* reallen); +unsigned long my_net_read_packet_reallen(NET *net, my_bool read_from_server, + unsigned long* reallen); #define my_net_read(A) my_net_read_packet((A), 0) #ifdef MY_GLOBAL_INCLUDED From 71e11bce34339a69576321d6c40838fa65208dc7 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 28 Oct 2016 12:29:37 +0400 Subject: [PATCH 29/71] MDEV-8791 - AIX: Unresolved Symbols during linking Clean-up nolock.h: it doesn't serve any purpose anymore. Appropriate code moved to x86-gcc.h and my_atomic.h. If gcc sync bultins were detected, we want to make use of them independently of __GNUC__ definition. E.g. XLC simulates those, but doesn't define __GNUC__. HS/Spider: According to AIX manual alloca() returns char*, which cannot be casted to any type with static_cast. Use explicit cast instead. MDL: Removed namemangling pragma, which didn't let MariaDB build with XLC. WSREP: _int64 seem to be conflicting name with XLC, replaced with _integer64. CONNECT: RTLD_NOLOAD is GNU extention. Removed rather meaningless check if library is loaded. Multiple dlopen()'s of the same library are permitted, and it never gets closed anyway. Except for error, which was a bug: it may close library, which can still be referenced by other subsystems. InnoDB: __ppc_get_timebase() is GNU extention. Only use it when __GLIBC__ is defined. Based on contribution by flynn1973. --- include/atomic/nolock.h | 54 ------------------- include/atomic/x86-gcc.h | 6 +++ include/my_atomic.h | 23 ++++++-- .../handler_socket/libhsclient/allocator.hpp | 2 +- sql/mdl.h | 9 ---- sql/wsrep_var.cc | 2 +- storage/connect/reldef.cpp | 2 +- storage/innobase/include/ut0ut.h | 2 +- storage/spider/hs_client/allocator.hpp | 2 +- storage/xtradb/include/ut0ut.h | 2 +- wsrep/wsrep_api.h | 2 +- 11 files changed, 33 insertions(+), 73 deletions(-) delete mode 100644 include/atomic/nolock.h diff --git a/include/atomic/nolock.h b/include/atomic/nolock.h deleted file mode 100644 index 2137445a0759a..0000000000000 --- a/include/atomic/nolock.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef ATOMIC_NOLOCK_INCLUDED -#define ATOMIC_NOLOCK_INCLUDED - -/* Copyright (c) 2006, 2010, 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 - the Free Software Foundation; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - 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 02110-1301 USA */ - -#if defined(__i386__) || defined(_MSC_VER) || defined(__x86_64__) \ - || defined(HAVE_GCC_ATOMIC_BUILTINS) \ - || defined(HAVE_SOLARIS_ATOMIC) - -# ifdef MY_ATOMIC_MODE_DUMMY -# define LOCK_prefix "" -# else -# define LOCK_prefix "lock" -# endif -/* - We choose implementation as follows: - ------------------------------------ - On Windows using Visual C++ the native implementation should be - preferrable. When using gcc we prefer the Solaris implementation - before the gcc because of stability preference, we choose gcc - builtins if available, otherwise we choose the somewhat broken - native x86 implementation. If neither Visual C++ or gcc we still - choose the Solaris implementation on Solaris (mainly for SunStudio - compilers). -*/ -# if defined(_MSC_VER) -# include "generic-msvc.h" -# elif __GNUC__ -# if defined(HAVE_SOLARIS_ATOMIC) -# include "solaris.h" -# elif defined(HAVE_GCC_ATOMIC_BUILTINS) -# include "gcc_builtins.h" -# elif defined(__i386__) || defined(__x86_64__) -# include "x86-gcc.h" -# endif -# elif defined(HAVE_SOLARIS_ATOMIC) -# include "solaris.h" -# endif -#endif - -#endif /* ATOMIC_NOLOCK_INCLUDED */ diff --git a/include/atomic/x86-gcc.h b/include/atomic/x86-gcc.h index 173e32e790c54..3a081d9bbc5af 100644 --- a/include/atomic/x86-gcc.h +++ b/include/atomic/x86-gcc.h @@ -28,6 +28,12 @@ */ #undef MY_ATOMIC_HAS_8_AND_16 +#ifdef MY_ATOMIC_MODE_DUMMY +#define LOCK_prefix "" +#else +#define LOCK_prefix "lock" +#endif + #ifdef __x86_64__ # ifdef MY_ATOMIC_NO_XADD # define MY_ATOMIC_MODE "gcc-amd64" LOCK_prefix "-no-xadd" diff --git a/include/my_atomic.h b/include/my_atomic.h index 9f4162080132b..8f13a0ab89b73 100644 --- a/include/my_atomic.h +++ b/include/my_atomic.h @@ -112,9 +112,26 @@ #undef MY_ATOMIC_HAS_8_16 /* - * Attempt to do atomic ops without locks - */ -#include "atomic/nolock.h" + We choose implementation as follows: + ------------------------------------ + On Windows using Visual C++ the native implementation should be + preferrable. When using gcc we prefer the Solaris implementation + before the gcc because of stability preference, we choose gcc + builtins if available, otherwise we choose the somewhat broken + native x86 implementation. If neither Visual C++ or gcc we still + choose the Solaris implementation on Solaris (mainly for SunStudio + compilers). +*/ +#if defined(_MSC_VER) +#include "atomic/generic-msvc.h" +#elif defined(HAVE_SOLARIS_ATOMIC) +#include "atomic/solaris.h" +#elif defined(HAVE_GCC_ATOMIC_BUILTINS) +#include "atomic/gcc_builtins.h" +#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) +#include "atomic/x86-gcc.h" +#endif + #ifndef make_atomic_cas_body /* nolock.h was not able to generate even a CAS function, fall back */ diff --git a/plugin/handler_socket/libhsclient/allocator.hpp b/plugin/handler_socket/libhsclient/allocator.hpp index 82ff51f00e7b5..dd3a28ba7bdca 100644 --- a/plugin/handler_socket/libhsclient/allocator.hpp +++ b/plugin/handler_socket/libhsclient/allocator.hpp @@ -35,7 +35,7 @@ typedef std::allocator allocator_type; #if 1 #define DENA_ALLOCA_ALLOCATE(typ, len) \ - static_cast(alloca((len) * sizeof(typ))) + (typ *) alloca((len) * sizeof(typ)) #define DENA_ALLOCA_FREE(x) #else #define DENA_ALLOCA_ALLOCATE(typ, len) \ diff --git a/sql/mdl.h b/sql/mdl.h index 7961f1f24b2ec..7d659af86bc49 100644 --- a/sql/mdl.h +++ b/sql/mdl.h @@ -15,15 +15,6 @@ along with this program; if not, write to the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ -#if defined(__IBMC__) || defined(__IBMCPP__) -/* Further down, "next_in_lock" and "next_in_context" have the same type, - and in "sql_plist.h" this leads to an identical signature, which causes - problems in function overloading. -*/ -#pragma namemangling(v5) -#endif - - #include "sql_plist.h" #include #include diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index bb5ee7baa5705..e6d4bbbc3031e 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -670,7 +670,7 @@ int wsrep_show_status (THD *thd, SHOW_VAR *var, char *buff, v->name = thd->strdup(sv->name); switch (sv->type) { case WSREP_VAR_INT64: - v->value = (char*)thd->memdup(&sv->value._int64, sizeof(longlong)); + v->value = (char*)thd->memdup(&sv->value._integer64, sizeof(longlong)); v->type = SHOW_LONGLONG; break; case WSREP_VAR_STRING: diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index 2c8ada52e6f5c..8a6174ea53b55 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -534,7 +534,7 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g) #endif // 0 // Is the library already loaded? - if (!Hdll && !(Hdll = dlopen(soname, RTLD_NOLOAD))) + if (!Hdll) // Load the desired shared library if (!(Hdll = dlopen(soname, RTLD_LAZY))) { error = dlerror(); diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h index 69216d213fdef..470d21edce297 100644 --- a/storage/innobase/include/ut0ut.h +++ b/storage/innobase/include/ut0ut.h @@ -70,7 +70,7 @@ typedef time_t ib_time_t; the YieldProcessor macro defined in WinNT.h. It is a CPU architecture- independent way by using YieldProcessor. */ # define UT_RELAX_CPU() YieldProcessor() -# elif defined(__powerpc__) +# elif defined(__powerpc__) && defined __GLIBC__ #include # define UT_RELAX_CPU() do { \ volatile lint volatile_var = __ppc_get_timebase(); \ diff --git a/storage/spider/hs_client/allocator.hpp b/storage/spider/hs_client/allocator.hpp index b54c7430d3029..a29015e6886ac 100644 --- a/storage/spider/hs_client/allocator.hpp +++ b/storage/spider/hs_client/allocator.hpp @@ -31,7 +31,7 @@ extern "C" { #if 1 #define DENA_ALLOCA_ALLOCATE(typ, len) \ - static_cast(alloca((len) * sizeof(typ))) + (typ *) alloca((len) * sizeof(typ)) #define DENA_ALLOCA_FREE(x) #else #define DENA_ALLOCA_ALLOCATE(typ, len) \ diff --git a/storage/xtradb/include/ut0ut.h b/storage/xtradb/include/ut0ut.h index 2df6bf58e6aa7..c5944bb0547ca 100644 --- a/storage/xtradb/include/ut0ut.h +++ b/storage/xtradb/include/ut0ut.h @@ -85,7 +85,7 @@ struct ut_when_dtor { the YieldProcessor macro defined in WinNT.h. It is a CPU architecture- independent way by using YieldProcessor. */ # define UT_RELAX_CPU() YieldProcessor() -# elif defined(__powerpc__) +# elif defined(__powerpc__) && defined __GLIBC__ #include # define UT_RELAX_CPU() do { \ volatile lint volatile_var = __ppc_get_timebase(); \ diff --git a/wsrep/wsrep_api.h b/wsrep/wsrep_api.h index e713be094df3e..1d6bc059d3d5f 100644 --- a/wsrep/wsrep_api.h +++ b/wsrep/wsrep_api.h @@ -502,7 +502,7 @@ struct wsrep_stats_var const char* name; //!< variable name wsrep_var_type_t type; //!< variable value type union { - int64_t _int64; + int64_t _integer64; double _double; const char* _string; } value; //!< variable value From ab0e5031e41d0aa72dd77a6dced9eacc8be5c548 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 1 Nov 2016 11:01:48 +1100 Subject: [PATCH 30/71] MDEV-11195: Correct enablement of NUMA in innodb/xtradb No -DHAVE_LIBNUMA=1 was passed to the source compile (and the global include/my_config.h wasn't used). This also is Linux only so corrected the cmake macro. Fixed indenting in cmake macro. Removed NUMA defination from include/my_config.h as its only in the storage engine. Thanks Elena Stepanova and Vladislav Vaintroub for the detailed list of bugs/questions. Signed-off-by: Daniel Black --- CMakeLists.txt | 1 - cmake/numa.cmake | 37 ++++++++++++++++++++------------- config.h.cmake | 1 - storage/innobase/CMakeLists.txt | 1 + storage/xtradb/CMakeLists.txt | 1 + 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d0e5cf874759b..4272699cb4ea2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,7 +162,6 @@ INCLUDE(install_macros) INCLUDE(systemd) INCLUDE(mysql_add_executable) INCLUDE(crc32-vpmsum) -INCLUDE(numa) # Handle options OPTION(DISABLE_SHARED diff --git a/cmake/numa.cmake b/cmake/numa.cmake index d5234a5ef4f6d..996042f326233 100644 --- a/cmake/numa.cmake +++ b/cmake/numa.cmake @@ -1,5 +1,6 @@ MACRO (MYSQL_CHECK_NUMA) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux") CHECK_INCLUDE_FILES(numa.h HAVE_NUMA_H) CHECK_INCLUDE_FILES(numaif.h HAVE_NUMAIF_H) @@ -10,22 +11,25 @@ MACRO (MYSQL_CHECK_NUMA) ENDIF() IF(WITH_NUMA AND HAVE_NUMA_H AND HAVE_NUMAIF_H) - SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) - SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} numa) - CHECK_C_SOURCE_COMPILES( - " - #include - #include - int main() - { - struct bitmask *all_nodes= numa_all_nodes_ptr; - set_mempolicy(MPOL_DEFAULT, 0, 0); - return all_nodes != NULL; - }" - HAVE_LIBNUMA) - SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES}) + SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) + SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} numa) + CHECK_C_SOURCE_COMPILES( + " + #include + #include + int main() + { + struct bitmask *all_nodes= numa_all_nodes_ptr; + set_mempolicy(MPOL_DEFAULT, 0, 0); + return all_nodes != NULL; + }" + HAVE_LIBNUMA) + SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES}) + IF(HAVE_LIBNUMA) + ADD_DEFINITIONS(-DHAVE_LIBNUMA=1) + ENDIF() ELSE() - SET(HAVE_LIBNUMA 0) + SET(HAVE_LIBNUMA 0) ENDIF() IF(WITH_NUMA AND NOT HAVE_LIBNUMA) @@ -33,6 +37,9 @@ MACRO (MYSQL_CHECK_NUMA) UNSET(WITH_NUMA CACHE) MESSAGE(FATAL_ERROR "Could not find numa headers/libraries") ENDIF() + ELSE() + SET(HAVE_LIBNUMA 0) + ENDIF() ENDMACRO() diff --git a/config.h.cmake b/config.h.cmake index 08b0422a5200b..00aa03483eeea 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -106,7 +106,6 @@ #cmakedefine HAVE_LIBWRAP 1 #cmakedefine HAVE_SYSTEMD 1 #cmakedefine HAVE_CRC32_VPMSUM 1 -#cmakedefine HAVE_LIBNUMA 1 /* Does "struct timespec" have a "sec" and "nsec" field? */ #cmakedefine HAVE_TIMESPEC_TS_SEC 1 diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index d9b50935d2714..237de77d2134e 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -24,6 +24,7 @@ INCLUDE(lzo) INCLUDE(lzma) INCLUDE(bzip2) INCLUDE(snappy) +INCLUDE(numa) MYSQL_CHECK_LZ4() MYSQL_CHECK_LZO() diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt index 7e0bb9103d247..6512f247e5284 100644 --- a/storage/xtradb/CMakeLists.txt +++ b/storage/xtradb/CMakeLists.txt @@ -23,6 +23,7 @@ INCLUDE(lzo) INCLUDE(lzma) INCLUDE(bzip2) INCLUDE(snappy) +INCLUDE(numa) MYSQL_CHECK_LZ4() MYSQL_CHECK_LZO() From 58ac8dd255acc599e0140b7cdcfe0b9a2bab4035 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Wed, 2 Nov 2016 14:37:43 +1100 Subject: [PATCH 31/71] MDEV-11195: Simplify enablement of NUMA in innodb/xtradb Move common parts of {innodb,xtradb}/CmakeLists.txt to the macro. --- cmake/numa.cmake | 6 ++---- storage/innobase/CMakeLists.txt | 5 ----- storage/xtradb/CMakeLists.txt | 5 ----- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/cmake/numa.cmake b/cmake/numa.cmake index 996042f326233..4bace0ee7f4e7 100644 --- a/cmake/numa.cmake +++ b/cmake/numa.cmake @@ -27,18 +27,16 @@ MACRO (MYSQL_CHECK_NUMA) SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES}) IF(HAVE_LIBNUMA) ADD_DEFINITIONS(-DHAVE_LIBNUMA=1) + SET(NUMA_LIBRARY "numa") ENDIF() - ELSE() - SET(HAVE_LIBNUMA 0) ENDIF() IF(WITH_NUMA AND NOT HAVE_LIBNUMA) # Forget it in cache, abort the build. UNSET(WITH_NUMA CACHE) + UNSET(NUMA_LIBRARY CACHE) MESSAGE(FATAL_ERROR "Could not find numa headers/libraries") ENDIF() - ELSE() - SET(HAVE_LIBNUMA 0) ENDIF() ENDMACRO() diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index 237de77d2134e..799200ae43f5a 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -175,11 +175,6 @@ IF(WITH_INNODB) SET(WITH_INNOBASE_STORAGE_ENGINE TRUE) ENDIF() -UNSET(NUMA_LIBRARY) -IF(HAVE_LIBNUMA) - SET(NUMA_LIBRARY "numa") -ENDIF() - MYSQL_ADD_PLUGIN(innobase ${INNOBASE_SOURCES} STORAGE_ENGINE # MODULE_ONLY # MODULE_OUTPUT_NAME ha_innodb diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt index 6512f247e5284..24899b3f5facb 100644 --- a/storage/xtradb/CMakeLists.txt +++ b/storage/xtradb/CMakeLists.txt @@ -498,11 +498,6 @@ SET(INNOBASE_SOURCES ut/ut0wqueue.cc ut/ut0timer.cc) -UNSET(NUMA_LIBRARY) -IF(HAVE_LIBNUMA) - SET(NUMA_LIBRARY "numa") -ENDIF() - MYSQL_ADD_PLUGIN(xtradb ${INNOBASE_SOURCES} STORAGE_ENGINE DISABLED # until upgraded to 5.7, see also mysql-test/include/have_xtradb.combinations RECOMPILE_FOR_EMBEDDED From ce1011669bb3f7e2173fc7fc7a8ee47dea614b0f Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Wed, 2 Nov 2016 12:19:37 +0400 Subject: [PATCH 32/71] MDEV-11175 - \H option does not replace localhost with a host name Let \H issue host name when connected to localhost via TCP/IP. --- client/mysql.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index 65b7c19259593..8ca38b48d6e94 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -5129,7 +5129,7 @@ static const char *construct_prompt() { const char *prompt; prompt= connected ? mysql_get_host_info(&mysql) : "not_connected"; - if (strstr(prompt, "Localhost")) + if (strstr(prompt, "Localhost") || strstr(prompt, "localhost ")) { if (*c == 'h') processed_prompt.append("localhost"); From c6713f651f5a50709273d14ce5732f7ef3409737 Mon Sep 17 00:00:00 2001 From: Darshan M N Date: Wed, 20 Jul 2016 10:00:26 +0530 Subject: [PATCH 33/71] Bug#23631471 BUF_BLOCK_ALIGN() MAKES INCORRECT ASSUMPTIONS ABOUT CHUNK SIZE Issue: ====== Currently the approach we take to find the chunk corresponding to a given pointer uses srv_buf_pool_chunk_unit based on the assumption that srv_buf_pool_chunk_unit is the total size of all pages in a buffer pool chunk. We first step back by srv_buf_pool_chunk_unit bytes and use std::map::upper_bound() to find the first chunk in the map whose key >= the resulting pointer. However, the real size of a chunk (and thus, the total size of its pages) may differ from the value configured with innodb_buffer_pool_chunk_size due to rounding up to the OS page size. So, in some cases the above logic gives us the wrong chunk. Fix: ==== We find out the chunk corresponding to the give pointer without using srv_buf_pool_chunk_unit. This is done by using std::map::upper_bound() to find the next chunk in the map which appears right after the pointer and decrementing the iterator, which would give us the chunk the pointer belongs to. Contribution by Alexey Kopytov. RB: 13347 Reviewed-by: Debarun Banerjee --- storage/innobase/buf/buf0buf.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 12d073bf10ff1..f2384f47181d4 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -3940,14 +3940,17 @@ buf_block_from_ahi(const byte* ptr) ut_ad(buf_chunk_map_ref == buf_chunk_map_reg); ut_ad(!buf_pool_resizing); - const byte* bound = reinterpret_cast(ptr) - > srv_buf_pool_chunk_unit - ? ptr - srv_buf_pool_chunk_unit : 0; - it = chunk_map->upper_bound(bound); + buf_chunk_t* chunk; + it = chunk_map->upper_bound(ptr); + + ut_a(it != chunk_map->begin()); - ut_a(it != chunk_map->end()); + if (it == chunk_map->end()) { + chunk = chunk_map->rbegin()->second; + } else { + chunk = (--it)->second; + } - buf_chunk_t* chunk = it->second; ulint offs = ptr - chunk->blocks->frame; offs >>= UNIV_PAGE_SIZE_SHIFT; From e2d6912609c976bad04cee76874d4f986cd58cef Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Wed, 29 Jun 2016 20:03:06 +0200 Subject: [PATCH 34/71] MDEV-9114: Bulk operations (Array binding) (+ default values) --- include/mysql.h.pp | 16 ++- include/mysql_com.h | 26 +++- sql/field.cc | 40 ++++++ sql/field.h | 3 + sql/item.cc | 73 +++++----- sql/item.h | 14 +- sql/protocol.cc | 1 + sql/share/errmsg-utf8.txt | 5 + sql/sql_base.cc | 26 ++-- sql/sql_class.cc | 17 ++- sql/sql_class.h | 17 +++ sql/sql_error.cc | 26 +++- sql/sql_error.h | 29 +++- sql/sql_insert.cc | 178 ++++++++++++----------- sql/sql_parse.cc | 10 +- sql/sql_prepare.cc | 288 +++++++++++++++++++++++++++++++++++++- sql/sql_prepare.h | 3 + sql/wsrep_thd.cc | 3 +- storage/perfschema/pfs.cc | 2 + 19 files changed, 610 insertions(+), 167 deletions(-) diff --git a/include/mysql.h.pp b/include/mysql.h.pp index 1ce4c05733679..aa9a0aaa26642 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -11,11 +11,17 @@ COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON, COM_MDB_GAP_BEG, COM_MDB_GAP_END=250, - COM_SLAVE_WORKER, - COM_SLAVE_IO, - COM_SLAVE_SQL, - COM_MULTI, - COM_END + COM_SLAVE_WORKER=251, + COM_SLAVE_IO=252, + COM_SLAVE_SQL=253, + COM_MULTI=254, + COM_END=255 +}; +enum enum_indicator_type +{ + STMT_INDICATOR_NONE= 0, + STMT_INDICATOR_NULL, + STMT_INDICATOR_DEFAULT }; struct st_vio; typedef struct st_vio Vio; diff --git a/include/mysql_com.h b/include/mysql_com.h index 57e311538d828..36d6ad526f80b 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -114,12 +114,23 @@ enum enum_server_command /* don't forget to update const char *command_name[] in sql_parse.cc */ COM_MDB_GAP_BEG, COM_MDB_GAP_END=250, - COM_SLAVE_WORKER, - COM_SLAVE_IO, - COM_SLAVE_SQL, - COM_MULTI, + COM_SLAVE_WORKER=251, + COM_SLAVE_IO=252, + COM_SLAVE_SQL=253, + COM_MULTI=254, /* Must be last */ - COM_END + COM_END=255 +}; + + +/* + Bulk PS protocol indicator value: +*/ +enum enum_indicator_type +{ + STMT_INDICATOR_NONE= 0, + STMT_INDICATOR_NULL, + STMT_INDICATOR_DEFAULT }; /* sql type stored in .frm files for virtual fields */ @@ -256,6 +267,8 @@ enum enum_server_command #define MARIADB_CLIENT_PROGRESS (1ULL << 32) /* support COM_MULTI */ #define MARIADB_CLIENT_COM_MULTI (1ULL << 33) +/* support of array binding */ +#define MARIADB_CLIENT_STMT_BULK_OPERATIONS (1UL << 34) #ifdef HAVE_COMPRESS #define CAN_CLIENT_COMPRESS CLIENT_COMPRESS @@ -295,7 +308,8 @@ enum enum_server_command CLIENT_SESSION_TRACK |\ CLIENT_DEPRECATE_EOF |\ CLIENT_CONNECT_ATTRS |\ - MARIADB_CLIENT_COM_MULTI) + MARIADB_CLIENT_COM_MULTI |\ + MARIADB_CLIENT_STMT_BULK_OPERATIONS) /* To be added later: diff --git a/sql/field.cc b/sql/field.cc index e4ecb7422f2c4..609d44f485618 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -10821,3 +10821,43 @@ bool Field::validate_value_in_record_with_warn(THD *thd, const uchar *record) dbug_tmp_restore_column_map(table->read_set, old_map); return rc; } + + +bool Field::save_in_field_default_value(bool view_error_processing) +{ + THD *thd= table->in_use; + + if (flags & NO_DEFAULT_VALUE_FLAG && + real_type() != MYSQL_TYPE_ENUM) + { + if (reset()) + { + my_message(ER_CANT_CREATE_GEOMETRY_OBJECT, + ER_THD(thd, ER_CANT_CREATE_GEOMETRY_OBJECT), MYF(0)); + return -1; + } + + if (view_error_processing) + { + TABLE_LIST *view= table->pos_in_table_list->top_table(); + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_NO_DEFAULT_FOR_VIEW_FIELD, + ER_THD(thd, ER_NO_DEFAULT_FOR_VIEW_FIELD), + view->view_db.str, + view->view_name.str); + } + else + { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_NO_DEFAULT_FOR_FIELD, + ER_THD(thd, ER_NO_DEFAULT_FOR_FIELD), + field_name); + } + return 1; + } + set_default(); + return + !is_null() && + validate_value_in_record_with_warn(thd, table->record[0]) && + thd->is_error() ? -1 : 0; +} diff --git a/sql/field.h b/sql/field.h index f550dad1c6c70..c9d7509618a2a 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1451,6 +1451,9 @@ class Field: public Value_source // Exactly the same rules with REF access return can_optimize_keypart_ref(cond, item); } + + bool save_in_field_default_value(bool view_eror_processing); + friend int cre_myisam(char * name, register TABLE *form, uint options, ulonglong auto_increment_value); friend class Copy_field; diff --git a/sql/item.cc b/sql/item.cc index 2388679e42448..70b7383d6199b 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3236,6 +3236,7 @@ Item_param::Item_param(THD *thd, uint pos_in_query_arg): Rewritable_query_parameter(pos_in_query_arg, 1), Type_handler_hybrid_field_type(MYSQL_TYPE_VARCHAR), state(NO_VALUE), + indicators(0), indicator(STMT_INDICATOR_NONE), /* Don't pretend to be a literal unless value for this item is set. */ item_type(PARAM_ITEM), set_param_func(default_set_param_func), @@ -3600,6 +3601,10 @@ int Item_param::save_in_field(Field *field, bool no_conversions) str_value.charset()); case NULL_VALUE: return set_field_to_null_with_conversions(field, no_conversions); + case DEFAULT_VALUE: + return field->save_in_field_default_value(field->table->pos_in_table_list-> + top_table() != + field->table->pos_in_table_list); case NO_VALUE: default: DBUG_ASSERT(0); @@ -3645,6 +3650,9 @@ double Item_param::val_real() return TIME_to_double(&value.time); case NULL_VALUE: return 0.0; + case DEFAULT_VALUE: + my_message(ER_INVALID_DEFAULT_PARAM, + ER_THD(current_thd, ER_INVALID_DEFAULT_PARAM), MYF(0)); default: DBUG_ASSERT(0); } @@ -3672,6 +3680,9 @@ longlong Item_param::val_int() } case TIME_VALUE: return (longlong) TIME_to_ulonglong(&value.time); + case DEFAULT_VALUE: + my_message(ER_INVALID_DEFAULT_PARAM, + ER_THD(current_thd, ER_INVALID_DEFAULT_PARAM), MYF(0)); case NULL_VALUE: return 0; default: @@ -3699,6 +3710,9 @@ my_decimal *Item_param::val_decimal(my_decimal *dec) { return TIME_to_my_decimal(&value.time, dec); } + case DEFAULT_VALUE: + my_message(ER_INVALID_DEFAULT_PARAM, + ER_THD(current_thd, ER_INVALID_DEFAULT_PARAM), MYF(0)); case NULL_VALUE: return 0; default: @@ -3734,6 +3748,9 @@ String *Item_param::val_str(String* str) str->set_charset(&my_charset_bin); return str; } + case DEFAULT_VALUE: + my_message(ER_INVALID_DEFAULT_PARAM, + ER_THD(current_thd, ER_INVALID_DEFAULT_PARAM), MYF(0)); case NULL_VALUE: return NULL; default: @@ -3812,6 +3829,9 @@ const String *Item_param::query_val_str(THD *thd, String* str) const thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES); break; } + case DEFAULT_VALUE: + my_message(ER_INVALID_DEFAULT_PARAM, + ER_THD(current_thd, ER_INVALID_DEFAULT_PARAM), MYF(0)); case NULL_VALUE: return &my_null_string; default: @@ -3862,6 +3882,9 @@ Item_param::clone_item(THD *thd) { MEM_ROOT *mem_root= thd->mem_root; switch (state) { + case DEFAULT_VALUE: + my_message(ER_INVALID_DEFAULT_PARAM, + ER_THD(current_thd, ER_INVALID_DEFAULT_PARAM), MYF(0)); case NULL_VALUE: return new (mem_root) Item_null(thd, name); case INT_VALUE: @@ -3894,6 +3917,9 @@ Item_param::eq(const Item *item, bool binary_cmp) const return FALSE; switch (state) { + case DEFAULT_VALUE: + my_message(ER_INVALID_DEFAULT_PARAM, + ER_THD(current_thd, ER_INVALID_DEFAULT_PARAM), MYF(0)); case NULL_VALUE: return null_eq(item); case INT_VALUE: @@ -3917,6 +3943,10 @@ void Item_param::print(String *str, enum_query_type query_type) { str->append('?'); } + else if (state == DEFAULT_VALUE) + { + str->append("default"); + } else { char buffer[STRING_BUFFER_USUAL_SIZE]; @@ -3968,6 +3998,11 @@ Item_param::set_param_type_and_swap_value(Item_param *src) } +void Item_param::set_default() +{ + state= DEFAULT_VALUE; +} + /** This operation is intended to store some item value in Item_param to be used later. @@ -8579,42 +8614,8 @@ int Item_default_value::save_in_field(Field *field_arg, bool no_conversions) calculate(); else { - TABLE *table= field_arg->table; - THD *thd= table->in_use; - - if (field_arg->flags & NO_DEFAULT_VALUE_FLAG && - field_arg->real_type() != MYSQL_TYPE_ENUM) - { - if (field_arg->reset()) - { - my_message(ER_CANT_CREATE_GEOMETRY_OBJECT, - ER_THD(thd, ER_CANT_CREATE_GEOMETRY_OBJECT), MYF(0)); - return -1; - } - - if (context->error_processor == &view_error_processor) - { - TABLE_LIST *view= table->pos_in_table_list->top_table(); - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_NO_DEFAULT_FOR_VIEW_FIELD, - ER_THD(thd, ER_NO_DEFAULT_FOR_VIEW_FIELD), - view->view_db.str, - view->view_name.str); - } - else - { - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_NO_DEFAULT_FOR_FIELD, - ER_THD(thd, ER_NO_DEFAULT_FOR_FIELD), - field_arg->field_name); - } - return 1; - } - field_arg->set_default(); - return - !field_arg->is_null() && - field_arg->validate_value_in_record_with_warn(thd, table->record[0]) && - thd->is_error() ? -1 : 0; + return field_arg->save_in_field_default_value(context->error_processor == + &view_error_processor); } return Item_field::save_in_field(field_arg, no_conversions); } diff --git a/sql/item.h b/sql/item.h index ab70fdb7dc154..d0d845711f715 100644 --- a/sql/item.h +++ b/sql/item.h @@ -2798,7 +2798,7 @@ class Item_param :public Item_basic_value, { NO_VALUE, NULL_VALUE, INT_VALUE, REAL_VALUE, STRING_VALUE, TIME_VALUE, LONG_DATA_VALUE, - DECIMAL_VALUE + DECIMAL_VALUE, DEFAULT_VALUE } state; struct CONVERSION_INFO @@ -2842,6 +2842,13 @@ class Item_param :public Item_basic_value, } }; + /* + Used for bulk protocol. Indicates if we should expect + indicators byte before value of the parameter + */ + my_bool indicators; + enum enum_indicator_type indicator; + /* A buffer for string and long data values. Historically all allocated values returned from val_str() were treated as eligible to @@ -2882,6 +2889,7 @@ class Item_param :public Item_basic_value, bool get_date(MYSQL_TIME *tm, ulonglong fuzzydate); int save_in_field(Field *field, bool no_conversions); + void set_default(); void set_null(); void set_int(longlong i, uint32 max_length_arg); void set_double(double i); @@ -5102,6 +5110,10 @@ class Item_default_value : public Item_field :Item_field(thd, context_arg, (const char *)NULL, (const char *)NULL, (const char *)NULL), arg(a) {} + Item_default_value(THD *thd, Name_resolution_context *context_arg, Field *a) + :Item_field(thd, context_arg, (const char *)NULL, (const char *)NULL, + (const char *)NULL), + arg(NULL) {} enum Type type() const { return DEFAULT_VALUE_ITEM; } bool eq(const Item *item, bool binary_cmp) const; bool fix_fields(THD *, Item **); diff --git a/sql/protocol.cc b/sql/protocol.cc index a3085c69f17a6..f8b68c02fff33 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -572,6 +572,7 @@ void Protocol::end_statement() thd->get_stmt_da()->statement_warn_count()); break; case Diagnostics_area::DA_OK: + case Diagnostics_area::DA_OK_BULK: error= send_ok(thd->server_status, thd->get_stmt_da()->statement_warn_count(), thd->get_stmt_da()->affected_rows(), diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index d42611bfebe54..ade788623e32b 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -7232,3 +7232,8 @@ ER_PARTITION_DEFAULT_ERROR ukr "Припустимо мати тільки один DEFAULT розділ" ER_REFERENCED_TRG_DOES_NOT_EXIST eng "Referenced trigger '%s' for the given action time and event type does not exist" +ER_INVALID_DEFAULT_PARAM + eng "Default value is not supported for such parameter usage" + ukr "Значення за замовчуванням не підтримано для цього випадку використання параьетра" +ER_BINLOG_NON_SUPPORTED_BULK + eng "Only row based replication supported for bulk operations" diff --git a/sql/sql_base.cc b/sql/sql_base.cc index d3832a7068ebe..2d40631d79f57 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -7810,9 +7810,10 @@ fill_record(THD *thd, TABLE *table_arg, List &fields, List &values, if (table->next_number_field && rfield->field_index == table->next_number_field->field_index) table->auto_increment_field_not_null= TRUE; - if (rfield->vcol_info && - value->type() != Item::DEFAULT_VALUE_ITEM && - value->type() != Item::NULL_ITEM && + Item::Type type= value->type(); + if (rfield->vcol_info && + type != Item::DEFAULT_VALUE_ITEM && + type != Item::NULL_ITEM && table->s->table_category != TABLE_CATEGORY_TEMPORARY) { push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, @@ -8060,15 +8061,18 @@ fill_record(THD *thd, TABLE *table, Field **ptr, List &values, value=v++; if (field->field_index == autoinc_index) table->auto_increment_field_not_null= TRUE; - if (field->vcol_info && - value->type() != Item::DEFAULT_VALUE_ITEM && - value->type() != Item::NULL_ITEM && - table->s->table_category != TABLE_CATEGORY_TEMPORARY) + if (field->vcol_info) { - push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, - ER_WARNING_NON_DEFAULT_VALUE_FOR_VIRTUAL_COLUMN, - ER_THD(thd, ER_WARNING_NON_DEFAULT_VALUE_FOR_VIRTUAL_COLUMN), - field->field_name, table->s->table_name.str); + Item::Type type= value->type(); + if (type != Item::DEFAULT_VALUE_ITEM && + type != Item::NULL_ITEM && + table->s->table_category != TABLE_CATEGORY_TEMPORARY) + { + push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, + ER_WARNING_NON_DEFAULT_VALUE_FOR_VIRTUAL_COLUMN, + ER_THD(thd, ER_WARNING_NON_DEFAULT_VALUE_FOR_VIRTUAL_COLUMN), + field->field_name, table->s->table_name.str); + } } if (use_value) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 1af3b9a9cca42..b896f4567af84 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -854,6 +854,7 @@ THD::THD(my_thread_id id, bool is_wsrep_applier) in_sub_stmt(0), log_all_errors(0), binlog_unsafe_warning_flags(0), binlog_table_maps(0), + bulk_param(0), table_map_for_update(0), m_examined_row_count(0), accessed_rows_and_keys(0), @@ -5701,6 +5702,17 @@ int THD::decide_logging_format(TABLE_LIST *tables) !(wsrep_binlog_format() == BINLOG_FORMAT_STMT && !binlog_filter->db_ok(db))) { + + if (is_bulk_op()) + { + if (wsrep_binlog_format() == BINLOG_FORMAT_STMT) + { + my_error(ER_BINLOG_NON_SUPPORTED_BULK, MYF(0)); + DBUG_PRINT("info", + ("decision: no logging since an error was generated")); + DBUG_RETURN(-1); + } + } /* Compute one bit field with the union of all the engine capabilities, and one with the intersection of all the engine @@ -5959,7 +5971,7 @@ int THD::decide_logging_format(TABLE_LIST *tables) */ my_error((error= ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE), MYF(0)); } - else if (wsrep_binlog_format() == BINLOG_FORMAT_ROW && + else if ((wsrep_binlog_format() == BINLOG_FORMAT_ROW || is_bulk_op()) && sqlcom_can_generate_row_events(this)) { /* @@ -6032,7 +6044,8 @@ int THD::decide_logging_format(TABLE_LIST *tables) else { if (lex->is_stmt_unsafe() || lex->is_stmt_row_injection() - || (flags_write_all_set & HA_BINLOG_STMT_CAPABLE) == 0) + || (flags_write_all_set & HA_BINLOG_STMT_CAPABLE) == 0 || + is_bulk_op()) { /* log in row format! */ set_current_stmt_binlog_format_row_if_mixed(); diff --git a/sql/sql_class.h b/sql/sql_class.h index 994a161a64626..93d3a4a0cd400 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -2463,6 +2463,8 @@ class THD :public Statement, */ Query_arena *stmt_arena; + void *bulk_param; + /* map for tables that will be updated for a multi-table update query statement, for other query statements, this will be zero. @@ -3438,6 +3440,12 @@ class THD :public Statement, To raise this flag, use my_error(). */ inline bool is_error() const { return m_stmt_da->is_error(); } + void set_bulk_execution(void *bulk) + { + bulk_param= bulk; + m_stmt_da->set_bulk_execution(MY_TEST(bulk)); + } + bool is_bulk_op() const { return MY_TEST(bulk_param); } /// Returns Diagnostics-area for the current statement. Diagnostics_area *get_stmt_da() @@ -5510,6 +5518,15 @@ class select_dumpvar :public select_result_interceptor { */ #define CF_UPDATES_DATA (1U << 18) +/** + SP Bulk execution safe +*/ +#define CF_SP_BULK_SAFE (1U << 19) +/** + SP Bulk execution optimized +*/ +#define CF_SP_BULK_OPTIMIZED (1U << 20) + /* Bits in server_command_flags */ /** diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 1d234c578e3ba..d14c7b83b7770 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -320,7 +320,7 @@ Sql_condition::set_sqlstate(const char* sqlstate) } Diagnostics_area::Diagnostics_area(bool initialize) - : m_main_wi(0, false, initialize) + : is_bulk_execution(0), m_main_wi(0, false, initialize) { push_warning_info(&m_main_wi); @@ -330,7 +330,8 @@ Diagnostics_area::Diagnostics_area(bool initialize) Diagnostics_area::Diagnostics_area(ulonglong warning_info_id, bool allow_unlimited_warnings, bool initialize) - : m_main_wi(warning_info_id, allow_unlimited_warnings, initialize) + : is_bulk_execution(0), + m_main_wi(warning_info_id, allow_unlimited_warnings, initialize) { push_warning_info(&m_main_wi); @@ -376,22 +377,33 @@ Diagnostics_area::set_ok_status(ulonglong affected_rows, const char *message) { DBUG_ENTER("set_ok_status"); - DBUG_ASSERT(! is_set()); + DBUG_ASSERT(!is_set() || (m_status == DA_OK_BULK && is_bulk_op())); /* In production, refuse to overwrite an error or a custom response with an OK packet. */ if (is_error() || is_disabled()) return; - - m_statement_warn_count= current_statement_warn_count(); - m_affected_rows= affected_rows; + /* + When running a bulk operation, m_status will be DA_OK for the first + operation and set to DA_OK_BULK for all following operations. + */ + if (m_status == DA_OK_BULK) + { + m_statement_warn_count+= current_statement_warn_count(); + m_affected_rows+= affected_rows; + } + else + { + m_statement_warn_count= current_statement_warn_count(); + m_affected_rows= affected_rows; + m_status= (is_bulk_op() ? DA_OK_BULK : DA_OK); + } m_last_insert_id= last_insert_id; if (message) strmake_buf(m_message, message); else m_message[0]= '\0'; - m_status= DA_OK; DBUG_VOID_RETURN; } diff --git a/sql/sql_error.h b/sql/sql_error.h index 8fb1abacf2b16..aa8e6c6b0f30f 100644 --- a/sql/sql_error.h +++ b/sql/sql_error.h @@ -658,6 +658,8 @@ class Diagnostics_area DA_OK, /** Set whenever one calls my_eof(). */ DA_EOF, + /** Set whenever one calls my_ok() in PS bulk mode. */ + DA_OK_BULK, /** Set whenever one calls my_error() or my_message(). */ DA_ERROR, /** Set in case of a custom response, such as one from COM_STMT_PREPARE. */ @@ -699,13 +701,21 @@ class Diagnostics_area bool is_disabled() const { return m_status == DA_DISABLED; } + void set_bulk_execution(bool bulk) { is_bulk_execution= bulk; } + + bool is_bulk_op() const { return is_bulk_execution; } + enum_diagnostics_status status() const { return m_status; } const char *message() const - { DBUG_ASSERT(m_status == DA_ERROR || m_status == DA_OK); return m_message; } + { DBUG_ASSERT(m_status == DA_ERROR || m_status == DA_OK || + m_status == DA_OK_BULK); return m_message; } bool skip_flush() const - { DBUG_ASSERT(m_status == DA_OK); return m_skip_flush; } + { + DBUG_ASSERT(m_status == DA_OK || m_status == DA_OK_BULK); + return m_skip_flush; + } void set_skip_flush() { m_skip_flush= TRUE; } @@ -717,14 +727,21 @@ class Diagnostics_area { DBUG_ASSERT(m_status == DA_ERROR); return m_sqlstate; } ulonglong affected_rows() const - { DBUG_ASSERT(m_status == DA_OK); return m_affected_rows; } + { + DBUG_ASSERT(m_status == DA_OK || m_status == DA_OK_BULK); + return m_affected_rows; + } ulonglong last_insert_id() const - { DBUG_ASSERT(m_status == DA_OK); return m_last_insert_id; } + { + DBUG_ASSERT(m_status == DA_OK || m_status == DA_OK_BULK); + return m_last_insert_id; + } uint statement_warn_count() const { - DBUG_ASSERT(m_status == DA_OK || m_status == DA_EOF); + DBUG_ASSERT(m_status == DA_OK || m_status == DA_OK_BULK || + m_status == DA_EOF); return m_statement_warn_count; } @@ -907,6 +924,8 @@ class Diagnostics_area enum_diagnostics_status m_status; + my_bool is_bulk_execution; + Warning_info m_main_wi; Warning_info_list m_wi_stack; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 1abfd5925b88c..432f8b673789e 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -77,6 +77,7 @@ #include "transaction.h" #include "sql_audit.h" #include "sql_derived.h" // mysql_handle_derived +#include "sql_prepare.h" #include "debug_sync.h" @@ -661,7 +662,9 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, bool using_bulk_insert= 0; uint value_count; ulong counter = 1; + ulong iteration= 0; ulonglong id; + ulong bulk_iterations= bulk_parameters_iterations(thd); COPY_INFO info; TABLE *table= 0; List_iterator_fast its(values_list); @@ -725,8 +728,11 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, THD_STAGE_INFO(thd, stage_init); thd->lex->used_tables=0; values= its++; + if (bulk_parameters_set(thd)) + DBUG_RETURN(TRUE); value_count= values->elements; + DBUG_ASSERT(bulk_iterations > 0); if (mysql_prepare_insert(thd, table_list, table, fields, values, update_fields, update_values, duplic, &unused_conds, FALSE, @@ -885,106 +891,114 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, goto values_loop_end; } } - - while ((values= its++)) + do { - if (fields.elements || !value_count) + if (iteration && bulk_parameters_set(thd)) + goto abort; + + while ((values= its++)) { - /* - There are possibly some default values: - INSERT INTO t1 (fields) VALUES ... - INSERT INTO t1 VALUES () - */ - restore_record(table,s->default_values); // Get empty record - table->reset_default_fields(); - if (fill_record_n_invoke_before_triggers(thd, table, fields, *values, 0, - TRG_EVENT_INSERT)) + if (fields.elements || !value_count) { - if (values_list.elements != 1 && ! thd->is_error()) - { - info.records++; - continue; - } - /* - TODO: set thd->abort_on_warning if values_list.elements == 1 - and check that all items return warning in case of problem with - storing field. + /* + There are possibly some default values: + INSERT INTO t1 (fields) VALUES ... + INSERT INTO t1 VALUES () */ - error=1; - break; + restore_record(table,s->default_values); // Get empty record + table->reset_default_fields(); + if (fill_record_n_invoke_before_triggers(thd, table, fields, *values, 0, + TRG_EVENT_INSERT)) + { + if (values_list.elements != 1 && ! thd->is_error()) + { + info.records++; + continue; + } + /* + TODO: set thd->abort_on_warning if values_list.elements == 1 + and check that all items return warning in case of problem with + storing field. + */ + error=1; + break; + } } - } - else - { - /* - No field list, all fields are set explicitly: - INSERT INTO t1 VALUES (values) - */ - if (thd->lex->used_tables) // Column used in values() - restore_record(table,s->default_values); // Get empty record else { - TABLE_SHARE *share= table->s; - /* - Fix delete marker. No need to restore rest of record since it will - be overwritten by fill_record() anyway (and fill_record() does not - use default values in this case). + No field list, all fields are set explicitly: + INSERT INTO t1 VALUES (values) */ -#ifdef HAVE_valgrind - if (table->file->ha_table_flags() && HA_RECORD_MUST_BE_CLEAN_ON_WRITE) - restore_record(table,s->default_values); // Get empty record + if (thd->lex->used_tables) // Column used in values() + restore_record(table,s->default_values); // Get empty record else + { + TABLE_SHARE *share= table->s; + + /* + Fix delete marker. No need to restore rest of record since it will + be overwritten by fill_record() anyway (and fill_record() does not + use default values in this case). + */ +#ifdef HAVE_valgrind + if (table->file->ha_table_flags() && HA_RECORD_MUST_BE_CLEAN_ON_WRITE) + restore_record(table,s->default_values); // Get empty record + else #endif - table->record[0][0]= share->default_values[0]; + table->record[0][0]= share->default_values[0]; - /* Fix undefined null_bits. */ - if (share->null_bytes > 1 && share->last_null_bit_pos) + /* Fix undefined null_bits. */ + if (share->null_bytes > 1 && share->last_null_bit_pos) + { + table->record[0][share->null_bytes - 1]= + share->default_values[share->null_bytes - 1]; + } + } + if (fill_record_n_invoke_before_triggers(thd, table, + table->field_to_fill(), + *values, 0, TRG_EVENT_INSERT)) { - table->record[0][share->null_bytes - 1]= - share->default_values[share->null_bytes - 1]; + if (values_list.elements != 1 && ! thd->is_error()) + { + info.records++; + continue; + } + error=1; + break; } } - if (fill_record_n_invoke_before_triggers(thd, table, table->field_to_fill(), - *values, 0, TRG_EVENT_INSERT)) + + if ((res= table_list->view_check_option(thd, + (values_list.elements == 1 ? + 0 : + ignore))) == + VIEW_CHECK_SKIP) + continue; + else if (res == VIEW_CHECK_ERROR) { - if (values_list.elements != 1 && ! thd->is_error()) - { - info.records++; - continue; - } - error=1; - break; + error= 1; + break; } - } - - if ((res= table_list->view_check_option(thd, - (values_list.elements == 1 ? - 0 : - ignore))) == - VIEW_CHECK_SKIP) - continue; - else if (res == VIEW_CHECK_ERROR) - { - error= 1; - break; - } #ifndef EMBEDDED_LIBRARY - if (lock_type == TL_WRITE_DELAYED) - { - LEX_STRING const st_query = { query, thd->query_length() }; - DEBUG_SYNC(thd, "before_write_delayed"); - error=write_delayed(thd, table, duplic, st_query, ignore, log_on); - DEBUG_SYNC(thd, "after_write_delayed"); - query=0; - } - else + if (lock_type == TL_WRITE_DELAYED) + { + LEX_STRING const st_query = { query, thd->query_length() }; + DEBUG_SYNC(thd, "before_write_delayed"); + error=write_delayed(thd, table, duplic, st_query, ignore, log_on); + DEBUG_SYNC(thd, "after_write_delayed"); + query=0; + } + else #endif - error=write_record(thd, table ,&info); - if (error) - break; - thd->get_stmt_da()->inc_current_row_for_warning(); - } + error=write_record(thd, table ,&info); + if (error) + break; + thd->get_stmt_da()->inc_current_row_for_warning(); + } + its.rewind(); + iteration++; + } while (iteration < bulk_iterations); values_loop_end: free_underlaid_joins(thd, &thd->lex->select_lex); @@ -1131,7 +1145,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, retval= thd->lex->explain->send_explain(thd); goto abort; } - if (values_list.elements == 1 && (!(thd->variables.option_bits & OPTION_WARNINGS) || + if ((bulk_iterations * values_list.elements) == 1 && (!(thd->variables.option_bits & OPTION_WARNINGS) || !thd->cuted_fields)) { my_ok(thd, info.copied + info.deleted + diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index ddb5e2744cbca..74b5ac79ad1c6 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -570,17 +570,19 @@ void init_update_queries(void) CF_CAN_GENERATE_ROW_EVENTS | CF_OPTIMIZER_TRACE | CF_CAN_BE_EXPLAINED | - CF_UPDATES_DATA; + CF_UPDATES_DATA | CF_SP_BULK_SAFE; sql_command_flags[SQLCOM_UPDATE_MULTI]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE | CF_CAN_GENERATE_ROW_EVENTS | CF_OPTIMIZER_TRACE | CF_CAN_BE_EXPLAINED | - CF_UPDATES_DATA; + CF_UPDATES_DATA | CF_SP_BULK_SAFE; sql_command_flags[SQLCOM_INSERT]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE | CF_CAN_GENERATE_ROW_EVENTS | CF_OPTIMIZER_TRACE | CF_CAN_BE_EXPLAINED | - CF_INSERTS_DATA; + CF_INSERTS_DATA | + CF_SP_BULK_SAFE | + CF_SP_BULK_OPTIMIZED; sql_command_flags[SQLCOM_INSERT_SELECT]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE | CF_CAN_GENERATE_ROW_EVENTS | CF_OPTIMIZER_TRACE | @@ -598,7 +600,7 @@ void init_update_queries(void) CF_CAN_GENERATE_ROW_EVENTS | CF_OPTIMIZER_TRACE | CF_CAN_BE_EXPLAINED | - CF_INSERTS_DATA;; + CF_INSERTS_DATA | CF_SP_BULK_SAFE; sql_command_flags[SQLCOM_REPLACE_SELECT]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE | CF_CAN_GENERATE_ROW_EVENTS | CF_OPTIMIZER_TRACE | diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index ac3983386799e..e191dae6f9853 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -162,6 +162,9 @@ class Prepared_statement: public Statement Select_fetch_protocol_binary result; Item_param **param_array; Server_side_cursor *cursor; + uchar *packet; + uchar *packet_end; + ulong iterations; uint param_count; uint last_errno; uint flags; @@ -180,11 +183,15 @@ class Prepared_statement: public Statement */ uint select_number_after_prepare; char last_error[MYSQL_ERRMSG_SIZE]; + my_bool start_param; #ifndef EMBEDDED_LIBRARY bool (*set_params)(Prepared_statement *st, uchar *data, uchar *data_end, uchar *read_pos, String *expanded_query); + bool (*set_bulk_params)(Prepared_statement *st, + uchar **read_pos, uchar *data_end, bool reset); #else bool (*set_params_data)(Prepared_statement *st, String *expanded_query); + /*TODO: add bulk support for builtin server */ #endif bool (*set_params_from_actual_params)(Prepared_statement *stmt, List &list, @@ -204,7 +211,13 @@ class Prepared_statement: public Statement bool execute_loop(String *expanded_query, bool open_cursor, uchar *packet_arg, uchar *packet_end_arg); + bool execute_bulk_loop(String *expanded_query, + bool open_cursor, + uchar *packet_arg, uchar *packet_end_arg, + ulong iterations); bool execute_server_runnable(Server_runnable *server_runnable); + my_bool set_bulk_parameters(bool reset); + ulong bulk_iterations(); /* Destroy this statement */ void deallocate(); bool execute_immediate(const char *query, uint query_length); @@ -962,11 +975,59 @@ static bool insert_params(Prepared_statement *stmt, uchar *null_array, } +static bool insert_bulk_params(Prepared_statement *stmt, + uchar **read_pos, uchar *data_end, + bool reset) +{ + Item_param **begin= stmt->param_array; + Item_param **end= begin + stmt->param_count; + + DBUG_ENTER("insert_params"); + + for (Item_param **it= begin; it < end; ++it) + { + Item_param *param= *it; + if (reset) + param->reset(); + if (param->state != Item_param::LONG_DATA_VALUE) + { + if (param->indicators) + param->indicator= (enum_indicator_type) *((*read_pos)++); + else + param->indicator= STMT_INDICATOR_NONE; + if ((*read_pos) > data_end) + DBUG_RETURN(1); + switch (param->indicator) + { + case STMT_INDICATOR_NONE: + if ((*read_pos) >= data_end) + DBUG_RETURN(1); + param->set_param_func(param, read_pos, (uint) (data_end - (*read_pos))); + if (param->state == Item_param::NO_VALUE) + DBUG_RETURN(1); + break; + case STMT_INDICATOR_NULL: + param->set_null(); + break; + case STMT_INDICATOR_DEFAULT: + param->set_default(); + break; + } + } + else + DBUG_RETURN(1); // long is not supported here + } + DBUG_RETURN(0); +} + static bool setup_conversion_functions(Prepared_statement *stmt, - uchar **data, uchar *data_end) + uchar **data, uchar *data_end, + bool bulk_protocol= 0) { /* skip null bits */ - uchar *read_pos= *data + (stmt->param_count+7) / 8; + uchar *read_pos= *data; + if (!bulk_protocol) + read_pos+= (stmt->param_count+7) / 8; DBUG_ENTER("setup_conversion_functions"); @@ -983,6 +1044,7 @@ static bool setup_conversion_functions(Prepared_statement *stmt, { ushort typecode; const uint signed_bit= 1 << 15; + const uint indicators_bit= 1 << 14; if (read_pos >= data_end) DBUG_RETURN(1); @@ -990,7 +1052,10 @@ static bool setup_conversion_functions(Prepared_statement *stmt, typecode= sint2korr(read_pos); read_pos+= 2; (**it).unsigned_flag= MY_TEST(typecode & signed_bit); - setup_one_conversion_function(thd, *it, (uchar) (typecode & ~signed_bit)); + if (bulk_protocol) + (**it).indicators= MY_TEST(typecode & indicators_bit); + setup_one_conversion_function(thd, *it, + (uchar) (typecode & 0xff)); } } *data= read_pos; @@ -999,6 +1064,8 @@ static bool setup_conversion_functions(Prepared_statement *stmt, #else +//TODO: support bulk parameters + /** Embedded counterparts of parameter assignment routines. @@ -2996,6 +3063,7 @@ void mysqld_stmt_execute(THD *thd, char *packet_arg, uint packet_length) uchar *packet= (uchar*)packet_arg; // GCC 4.0.1 workaround ulong stmt_id= uint4korr(packet); ulong flags= (ulong) packet[4]; + ulong iterations= uint4korr(packet + 5); /* Query text for binary, general or slow log, if any of them is open */ String expanded_query; uchar *packet_end= packet + packet_length; @@ -3021,12 +3089,16 @@ void mysqld_stmt_execute(THD *thd, char *packet_arg, uint packet_length) thd->profiling.set_query_source(stmt->query(), stmt->query_length()); #endif DBUG_PRINT("exec_query", ("%s", stmt->query())); - DBUG_PRINT("info",("stmt: 0x%lx", (long) stmt)); + DBUG_PRINT("info",("stmt: 0x%p iterations: %lu", stmt, iterations)); open_cursor= MY_TEST(flags & (ulong) CURSOR_TYPE_READ_ONLY); thd->protocol= &thd->protocol_binary; - stmt->execute_loop(&expanded_query, open_cursor, packet, packet_end); + if (iterations <= 1) + stmt->execute_loop(&expanded_query, open_cursor, packet, packet_end); + else + stmt->execute_bulk_loop(&expanded_query, open_cursor, packet, packet_end, + iterations); thd->protocol= save_protocol; sp_cache_enforce_limit(thd->sp_proc_cache, stored_program_cache_size); @@ -3531,9 +3603,13 @@ Prepared_statement::Prepared_statement(THD *thd_arg) result(thd_arg), param_array(0), cursor(0), + packet(0), + packet_end(0), + iterations(0), param_count(0), last_errno(0), - flags((uint) IS_IN_USE) + flags((uint) IS_IN_USE), + start_param(0) { init_sql_alloc(&main_mem_root, thd_arg->variables.query_alloc_block_size, thd_arg->variables.query_prealloc_size, MYF(MY_THREAD_SPECIFIC)); @@ -3569,7 +3645,9 @@ void Prepared_statement::setup_set_params() set_params_from_actual_params= insert_params_from_actual_params_with_log; #ifndef EMBEDDED_LIBRARY set_params= insert_params_with_log; + set_bulk_params= insert_bulk_params; // TODO: add binlog support #else + //TODO: add bulk support for bulk parameters set_params_data= emb_insert_params_with_log; #endif } @@ -3578,7 +3656,9 @@ void Prepared_statement::setup_set_params() set_params_from_actual_params= insert_params_from_actual_params; #ifndef EMBEDDED_LIBRARY set_params= insert_params; + set_bulk_params= insert_bulk_params; #else + //TODO: add bulk support for bulk parameters set_params_data= emb_insert_params; #endif } @@ -3935,6 +4015,7 @@ Prepared_statement::set_parameters(String *expanded_query, @retval FALSE successfully executed the statement, perhaps after having reprepared it a few times. */ +const static int MAX_REPREPARE_ATTEMPTS= 3; bool Prepared_statement::execute_loop(String *expanded_query, @@ -3942,10 +4023,10 @@ Prepared_statement::execute_loop(String *expanded_query, uchar *packet, uchar *packet_end) { - const int MAX_REPREPARE_ATTEMPTS= 3; Reprepare_observer reprepare_observer; bool error; int reprepare_attempt= 0; + iterations= 0; #ifndef DBUG_OFF Item *free_list_state= thd->free_list; #endif @@ -4037,6 +4118,199 @@ Prepared_statement::execute_loop(String *expanded_query, return error; } +my_bool bulk_parameters_set(THD *thd) +{ + DBUG_ENTER("bulk_parameters_set"); + Prepared_statement *stmt= (Prepared_statement *) thd->bulk_param; + + if (stmt && stmt->set_bulk_parameters(FALSE)) + DBUG_RETURN(TRUE); + DBUG_RETURN(FALSE); +} + +ulong bulk_parameters_iterations(THD *thd) +{ + Prepared_statement *stmt= (Prepared_statement *) thd->bulk_param; + if (!stmt) + return 1; + return stmt->bulk_iterations(); +} + + +my_bool Prepared_statement::set_bulk_parameters(bool reset) +{ + DBUG_ENTER("Prepared_statement::set_bulk_parameters"); + DBUG_PRINT("info", ("iteration: %lu", iterations)); + if (iterations) + { +#ifndef EMBEDDED_LIBRARY + if ((*set_bulk_params)(this, &packet, packet_end, reset)) +#else + // bulk parameters are not supported for embedded, so it will an error +#endif + { + my_error(ER_WRONG_ARGUMENTS, MYF(0), + "mysqld_stmt_bulk_execute"); + reset_stmt_params(this); + DBUG_RETURN(true); + } + iterations--; + } + start_param= 0; + DBUG_RETURN(false); +} + +ulong Prepared_statement::bulk_iterations() +{ + if (iterations) + return iterations; + return start_param ? 1 : 0; +} + +bool +Prepared_statement::execute_bulk_loop(String *expanded_query, + bool open_cursor, + uchar *packet_arg, + uchar *packet_end_arg, + ulong iterations_arg) +{ + Reprepare_observer reprepare_observer; + bool error= 0; + packet= packet_arg; + packet_end= packet_end_arg; + iterations= iterations_arg; + start_param= true; +#ifndef DBUG_OFF + Item *free_list_state= thd->free_list; +#endif + thd->select_number= select_number_after_prepare; + thd->set_bulk_execution((void *)this); + /* Check if we got an error when sending long data */ + if (state == Query_arena::STMT_ERROR) + { + my_message(last_errno, last_error, MYF(0)); + thd->set_bulk_execution(0); + return TRUE; + } + + if (!(sql_command_flags[lex->sql_command] & CF_SP_BULK_SAFE)) + { + my_error(ER_UNSUPPORTED_PS, MYF(0)); + thd->set_bulk_execution(0); + return TRUE; + } + +#ifndef EMBEDDED_LIBRARY + if (setup_conversion_functions(this, &packet, packet_end, TRUE)) +#else + // bulk parameters are not supported for embedded, so it will an error +#endif + { + my_error(ER_WRONG_ARGUMENTS, MYF(0), + "mysqld_stmt_bulk_execute"); + reset_stmt_params(this); + thd->set_bulk_execution(0); + return true; + } + +#ifdef NOT_YET_FROM_MYSQL_5_6 + if (unlikely(thd->security_ctx->password_expired && + !lex->is_change_password)) + { + my_error(ER_MUST_CHANGE_PASSWORD, MYF(0)); + thd->set_bulk_execution(0); + return true; + } +#endif + + // iterations changed by set_bulk_parameters + while ((iterations || start_param) && !error && !thd->is_error()) + { + int reprepare_attempt= 0; + + /* + Here we set parameters for not optimized commands, + optimized commands do it inside thier internal loop. + */ + if (!(sql_command_flags[lex->sql_command] & CF_SP_BULK_OPTIMIZED)) + { + if (set_bulk_parameters(TRUE)) + { + thd->set_bulk_execution(0); + return true; + } + } + +reexecute: + /* + If the free_list is not empty, we'll wrongly free some externally + allocated items when cleaning up after validation of the prepared + statement. + */ + DBUG_ASSERT(thd->free_list == free_list_state); + + /* + Install the metadata observer. If some metadata version is + different from prepare time and an observer is installed, + the observer method will be invoked to push an error into + the error stack. + */ + + if (sql_command_flags[lex->sql_command] & CF_REEXECUTION_FRAGILE) + { + reprepare_observer.reset_reprepare_observer(); + DBUG_ASSERT(thd->m_reprepare_observer == NULL); + thd->m_reprepare_observer= &reprepare_observer; + } + + error= execute(expanded_query, open_cursor) || thd->is_error(); + + thd->m_reprepare_observer= NULL; +#ifdef WITH_WSREP + + if (WSREP_ON) + { + mysql_mutex_lock(&thd->LOCK_wsrep_thd); + switch (thd->wsrep_conflict_state) + { + case CERT_FAILURE: + WSREP_DEBUG("PS execute fail for CERT_FAILURE: thd: %lld err: %d", + (longlong) thd->thread_id, + thd->get_stmt_da()->sql_errno() ); + thd->wsrep_conflict_state = NO_CONFLICT; + break; + + case MUST_REPLAY: + (void) wsrep_replay_transaction(thd); + break; + + default: + break; + } + mysql_mutex_unlock(&thd->LOCK_wsrep_thd); + } +#endif /* WITH_WSREP */ + + if ((sql_command_flags[lex->sql_command] & CF_REEXECUTION_FRAGILE) && + error && !thd->is_fatal_error && !thd->killed && + reprepare_observer.is_invalidated() && + reprepare_attempt++ < MAX_REPREPARE_ATTEMPTS) + { + DBUG_ASSERT(thd->get_stmt_da()->sql_errno() == ER_NEED_REPREPARE); + thd->clear_error(); + + error= reprepare(); + + if (! error) /* Success */ + goto reexecute; + } + } + reset_stmt_params(this); + thd->set_bulk_execution(0); + + return error; +} + bool Prepared_statement::execute_server_runnable(Server_runnable *server_runnable) diff --git a/sql/sql_prepare.h b/sql/sql_prepare.h index 4a8780c4a0204..820cb43e6d520 100644 --- a/sql/sql_prepare.h +++ b/sql/sql_prepare.h @@ -72,6 +72,7 @@ class Reprepare_observer void mysqld_stmt_prepare(THD *thd, const char *packet, uint packet_length); void mysqld_stmt_execute(THD *thd, char *packet, uint packet_length); +void mysqld_stmt_bulk_execute(THD *thd, char *packet, uint packet_length); void mysqld_stmt_close(THD *thd, char *packet); void mysql_sql_stmt_prepare(THD *thd); void mysql_sql_stmt_execute(THD *thd); @@ -82,6 +83,8 @@ void mysqld_stmt_reset(THD *thd, char *packet); void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length); void reinit_stmt_before_use(THD *thd, LEX *lex); +ulong bulk_parameters_iterations(THD *thd); +my_bool bulk_parameters_set(THD *thd); /** Execute a fragment of server code in an isolated context, so that it doesn't leave any effect on THD. THD must have no open tables. diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc index 06846e7dd6af7..03e53dd3e9774 100644 --- a/sql/wsrep_thd.cc +++ b/sql/wsrep_thd.cc @@ -265,7 +265,8 @@ void wsrep_replay_transaction(THD *thd) } else if (thd->get_stmt_da()->is_set()) { - if (thd->get_stmt_da()->status() != Diagnostics_area::DA_OK) + if (thd->get_stmt_da()->status() != Diagnostics_area::DA_OK && + thd->get_stmt_da()->status() != Diagnostics_area::DA_OK_BULK) { WSREP_WARN("replay ok, thd has error status %d", thd->get_stmt_da()->status()); diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index dbe3241cfe846..4cd1a35fd7756 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -4827,6 +4827,7 @@ static void end_statement_v1(PSI_statement_locker *locker, void *stmt_da) switch(da->status()) { + case Diagnostics_area::DA_OK_BULK: case Diagnostics_area::DA_EMPTY: break; case Diagnostics_area::DA_OK: @@ -4960,6 +4961,7 @@ static void end_statement_v1(PSI_statement_locker *locker, void *stmt_da) switch (da->status()) { + case Diagnostics_area::DA_OK_BULK: case Diagnostics_area::DA_EMPTY: break; case Diagnostics_area::DA_OK: From 3c0ff6153f75bb8e63c08ff3c82823551297a155 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Thu, 3 Nov 2016 12:03:52 +0100 Subject: [PATCH 35/71] MDEV-11065: Compressed binary log .result file update for --embedded test run. --- .../sys_vars/r/sysvars_server_embedded.result | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index 98c846f0b57bc..b435844b4b582 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -1619,6 +1619,34 @@ NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST OFF,ON READ_ONLY YES COMMAND_LINE_ARGUMENT NULL +VARIABLE_NAME LOG_BIN_COMPRESS +SESSION_VALUE NULL +GLOBAL_VALUE OFF +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE OFF +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE BOOLEAN +VARIABLE_COMMENT Whether the binary log can be compressed +NUMERIC_MIN_VALUE NULL +NUMERIC_MAX_VALUE NULL +NUMERIC_BLOCK_SIZE NULL +ENUM_VALUE_LIST OFF,ON +READ_ONLY NO +COMMAND_LINE_ARGUMENT OPTIONAL +VARIABLE_NAME LOG_BIN_COMPRESS_MIN_LEN +SESSION_VALUE NULL +GLOBAL_VALUE 256 +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE 256 +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE INT UNSIGNED +VARIABLE_COMMENT Minimum length of sql statement(in statement mode) or record(in row mode)that can be compressed. +NUMERIC_MIN_VALUE 10 +NUMERIC_MAX_VALUE 1024 +NUMERIC_BLOCK_SIZE 1 +ENUM_VALUE_LIST NULL +READ_ONLY NO +COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME LOG_BIN_TRUST_FUNCTION_CREATORS SESSION_VALUE NULL GLOBAL_VALUE ON @@ -2825,9 +2853,9 @@ READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES SESSION_VALUE NULL -GLOBAL_VALUE 184 +GLOBAL_VALUE 185 GLOBAL_VALUE_ORIGIN COMPILE-TIME -DEFAULT_VALUE 184 +DEFAULT_VALUE 185 VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Maximum number of statement instruments. From d665e79c5b8582f44dc280e5e6df4a8ff4945623 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 6 May 2016 13:44:07 +0400 Subject: [PATCH 36/71] MDEV-7660 - MySQL WL#6671 "Improve scalability by not using thr_lock.c locks for InnoDB tables" Don't use thr_lock.c locks for InnoDB tables. Below is list of changes that were needed to implement this: - HANDLER OPEN acquireis MDL_SHARED_READ instead of MDL_SHARED - HANDLER READ calls external_lock() even if SE is not going to be locked by THR_LOCK - InnoDB lock wait timeouts are now honored which are much shorter by default than server lock wait timeouts (1 year vs 50 seconds) - with @@autocommit= 1 LOCK TABLES disables autocommit implicitely, though user still sees @@autocommt= 1 - the above starts implicit transaction - transactions started by LOCK TABLES are now rolled back on disconnect (previously everything was committed due to autocommit) - transactions started by LOCK TABLES are now rolled back by ROLLBACK (previously everything was committed due to autocommit) - it is now impossible to change BINLOG_FORMAT under LOCK TABLES (at least to statement) due to running transaction - LOCK TABLES WRITE is additionally handled by MDL - ...in contrast LOCK TABLES READ protection against DML is pure InnoDB - combining transactional and non-transactional tables under LOCK TABLES may cause rolled back changes in transactional table and "committed" changes in non-transactional table - user may disable innodb_table_locks, which will cause LOCK TABLES to be noop basically Removed tests for BUG#45143 and BUG#55930 which cover InnoDB + THR_LOCK. To operate properly these tests require code flow to go through THR_LOCK debug sync points, which is not the case after this patch. These tests are removed by WL#6671 as well. An alternative is to port them to different storage engine. --- mysql-test/include/mtr_warnings.sql | 8 - mysql-test/lib/v1/mtr_report.pl | 3 - mysql-test/r/innodb_mysql_lock.result | 2 - mysql-test/r/lock_sync.result | 120 +-------- mysql-test/r/lock_tables_lost_commit.result | 1 - mysql-test/r/mdl_sync.result | 250 +++--------------- mysql-test/r/partition_debug_sync.result | 26 -- mysql-test/r/partition_explicit_prune.result | 12 +- mysql-test/r/truncate_coverage.result | 42 --- mysql-test/suite/handler/aria.result | 27 +- mysql-test/suite/handler/handler.inc | 21 +- mysql-test/suite/handler/heap.result | 27 +- mysql-test/suite/handler/innodb.result | 26 +- mysql-test/suite/handler/interface.result | 18 -- mysql-test/suite/handler/interface.test | 26 -- mysql-test/suite/handler/myisam.result | 27 +- .../rpl/r/rpl_switch_stm_row_mixed.result | 1 + .../suite/rpl/t/rpl_switch_stm_row_mixed.test | 1 + mysql-test/t/innodb_mysql_lock.test | 10 +- mysql-test/t/lock_sync.test | 165 +----------- mysql-test/t/mdl_sync.test | 221 ---------------- mysql-test/t/partition_debug_sync.test | 40 --- mysql-test/t/truncate_coverage.test | 80 ------ sql/sql_base.cc | 5 + sql/sql_handler.cc | 7 +- sql/sql_parse.cc | 3 +- storage/innobase/handler/ha_innodb.cc | 4 - storage/innobase/handler/ha_innodb.h | 2 +- .../r/nested_txn_implicit_commit.result | 4 - .../mysql-test/tokudb_bugs/r/db806.result | 2 +- .../mysql-test/tokudb_bugs/t/db806.test | 4 +- 31 files changed, 151 insertions(+), 1034 deletions(-) diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index 278add92ba522..635dfd9b8c3af 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -205,14 +205,6 @@ INSERT INTO global_suppressions VALUES ("==[0-9]*== Warning: invalid file descriptor -1 in syscall write()"), ("==[0-9]*== Warning: invalid file descriptor -1 in syscall read()"), - /* - BUG#42147 - Concurrent DML and LOCK TABLE ... READ for InnoDB - table cause warnings in errlog - Note: This is a temporary suppression until Bug#42147 can be - fixed properly. See bug page for more information. - */ - ("Found lock of type 6 that is write and read locked"), - /* Transient network failures that cause warnings on reconnect. BUG#47743 and BUG#47983. diff --git a/mysql-test/lib/v1/mtr_report.pl b/mysql-test/lib/v1/mtr_report.pl index 738236a731e97..0af70d966477f 100644 --- a/mysql-test/lib/v1/mtr_report.pl +++ b/mysql-test/lib/v1/mtr_report.pl @@ -361,9 +361,6 @@ ($) /Slave: Can't DROP 'c7'.* 1091/ or /Slave: Key column 'c6'.* 1072/ or - # Warnings generated until bug#42147 is properly resolved - /Found lock of type 6 that is write and read locked/ or - # rpl_idempotency.test produces warnings for the slave. ($testname eq 'rpl.rpl_idempotency' and (/Slave: Can\'t find record in \'t1\' error.* 1032/ or diff --git a/mysql-test/r/innodb_mysql_lock.result b/mysql-test/r/innodb_mysql_lock.result index a7f45d355f1d5..6d2eef2e62ed2 100644 --- a/mysql-test/r/innodb_mysql_lock.result +++ b/mysql-test/r/innodb_mysql_lock.result @@ -95,8 +95,6 @@ LOCK TABLES t1 READ; SELECT release_lock('bug42147_lock'); release_lock('bug42147_lock') 1 -connection default; -connection con2; UNLOCK TABLES; connection default; disconnect con2; diff --git a/mysql-test/r/lock_sync.result b/mysql-test/r/lock_sync.result index f075262c3db3b..5eae1af7982f2 100644 --- a/mysql-test/r/lock_sync.result +++ b/mysql-test/r/lock_sync.result @@ -338,6 +338,7 @@ Success: 'load data infile '../../std_data/rpl_loaddata.dat' into table t2 (@a, # 2.8 REPLACE with a subquery. # # Same is true for this statement as well. +# Suppress warnings for REPLACE ... SELECT connection default; Success: 'replace into t2 select i+5 from t1' doesn't allow concurrent inserts into 't1'. connection default; @@ -704,87 +705,6 @@ disconnect con1; disconnect con2; set @@global.concurrent_insert= @old_concurrent_insert; # -# Test for bug #45143 "All connections hang on concurrent ALTER TABLE". -# -# Concurrent execution of statements which required weak write lock -# (TL_WRITE_ALLOW_WRITE) on several instances of the same table and -# statements which tried to acquire stronger write lock (TL_WRITE, -# TL_WRITE_ALLOW_READ) on this table might have led to deadlock. -drop table if exists t1; -drop view if exists v1; -# Create auxiliary connections used through the test. -connect con_bug45143_1,localhost,root,,test,,; -connect con_bug45143_3,localhost,root,,test,,; -connect con_bug45143_2,localhost,root,,test,,; -connection default; -# Reset DEBUG_SYNC facility before using it. -set debug_sync= 'RESET'; -# Turn off logging so calls to locking subsystem performed -# for general_log table won't interfere with our test. -set @old_general_log = @@global.general_log; -set @@global.general_log= OFF; -create table t1 (i int) engine=InnoDB; -# We have to use view in order to make LOCK TABLES avoid -# acquiring SNRW metadata lock on table. -create view v1 as select * from t1; -insert into t1 values (1); -# Prepare user lock which will be used for resuming execution of -# the first statement after it acquires TL_WRITE_ALLOW_WRITE lock. -select get_lock("lock_bug45143_wait", 0); -get_lock("lock_bug45143_wait", 0) -1 -connection con_bug45143_1; -# Sending: -insert into t1 values (get_lock("lock_bug45143_wait", 100));; -connection con_bug45143_2; -# Wait until the above INSERT takes TL_WRITE_ALLOW_WRITE lock on 't1' -# and then gets blocked on user lock 'lock_bug45143_wait'. -# Ensure that upcoming SELECT waits after acquiring TL_WRITE_ALLOW_WRITE -# lock for the first instance of 't1'. -set debug_sync='thr_multi_lock_after_thr_lock SIGNAL parked WAIT_FOR go'; -# Sending: -select count(*) > 0 from t1 as a, t1 as b for update;; -connection con_bug45143_3; -# Wait until the above SELECT ... FOR UPDATE is blocked after -# acquiring lock for the the first instance of 't1'. -set debug_sync= 'now WAIT_FOR parked'; -# Send LOCK TABLE statement which will try to get TL_WRITE lock on 't1': -lock table v1 write;; -connection default; -# Wait until this LOCK TABLES statement starts waiting for table lock. -# Allow SELECT ... FOR UPDATE to resume. -# Since it already has TL_WRITE_ALLOW_WRITE lock on the first instance -# of 't1' it should be able to get lock on the second instance without -# waiting, even although there is another thread which has such lock -# on this table and also there is a thread waiting for a TL_WRITE on it. -set debug_sync= 'now SIGNAL go'; -connection con_bug45143_2; -# Reap SELECT ... FOR UPDATE -count(*) > 0 -1 -connection default; -# Resume execution of the INSERT statement. -select release_lock("lock_bug45143_wait"); -release_lock("lock_bug45143_wait") -1 -connection con_bug45143_1; -# Reap INSERT statement. -# In Statement and Mixed replication mode we get here "Unsafe -# for binlog" warnings. In row mode there are no warnings. -# Hide the discrepancy. -connection con_bug45143_3; -# Reap LOCK TABLES statement. -unlock tables; -connection default; -# Do clean-up. -disconnect con_bug45143_1; -disconnect con_bug45143_2; -disconnect con_bug45143_3; -set debug_sync= 'RESET'; -set @@global.general_log= @old_general_log; -drop view v1; -drop table t1; -# # Bug#50821 Deadlock between LOCK TABLES and ALTER TABLE # DROP TABLE IF EXISTS t1, t2; @@ -827,44 +747,6 @@ connection default; DROP EVENT e2; SET DEBUG_SYNC="RESET"; # -# Bug#55930 Assertion `thd->transaction.stmt.is_empty() || -# thd->in_sub_stmt || (thd->state.. -# -DROP TABLE IF EXISTS t1; -CREATE TABLE t1(a INT) engine=InnoDB; -INSERT INTO t1 VALUES (1), (2); -connect con1, localhost, root; -connect con2, localhost, root; -connection con1; -SET SESSION lock_wait_timeout= 1; -SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL opti_recreate WAIT_FOR opti_analyze'; -# Sending: -OPTIMIZE TABLE t1; -connection con2; -SET DEBUG_SYNC= 'now WAIT_FOR opti_recreate'; -SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL thrlock WAIT_FOR release_thrlock'; -# Sending: -INSERT INTO t1 VALUES (3); -connection default; -SET DEBUG_SYNC= 'now WAIT_FOR thrlock'; -SET DEBUG_SYNC= 'now SIGNAL opti_analyze'; -connection con1; -# Reaping: OPTIMIZE TABLE t1 -Table Op Msg_type Msg_text -test.t1 optimize note Table does not support optimize, doing recreate + analyze instead -test.t1 optimize error Lock wait timeout exceeded; try restarting transaction -test.t1 optimize status Operation failed -Warnings: -Error 1205 Lock wait timeout exceeded; try restarting transaction -SET DEBUG_SYNC= 'now SIGNAL release_thrlock'; -disconnect con1; -connection con2; -# Reaping: INSERT INTO t1 VALUES (3) -disconnect con2; -connection default; -DROP TABLE t1; -SET DEBUG_SYNC= 'RESET'; -# # Bug#57130 crash in Item_field::print during SHOW CREATE TABLE or VIEW # DROP TABLE IF EXISTS t1; diff --git a/mysql-test/r/lock_tables_lost_commit.result b/mysql-test/r/lock_tables_lost_commit.result index 769e9734c7abe..394ef0a9d1cef 100644 --- a/mysql-test/r/lock_tables_lost_commit.result +++ b/mysql-test/r/lock_tables_lost_commit.result @@ -9,7 +9,6 @@ disconnect con1; connection con2; SELECT * FROM t1; a -10 DROP TABLE t1; connection default; disconnect con2; diff --git a/mysql-test/r/mdl_sync.result b/mysql-test/r/mdl_sync.result index 865e874f63e67..1e285650c774d 100644 --- a/mysql-test/r/mdl_sync.result +++ b/mysql-test/r/mdl_sync.result @@ -76,10 +76,6 @@ ERROR 42000: Key column 'not_exist' doesn't exist in table # lock. alter table t1 add primary key (c1); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -# Check that SNRW lock is compatible with S lock. -lock table t1 write; -insert into t1 values (1); -unlock tables; # Check that X lock is incompatible with S lock. # Sending: rename table t1 to t2;; @@ -117,29 +113,6 @@ connection mdl_con1; alter table t1 drop column c2; # connection default; -handler t1 open; -# -connection mdl_con1; -# Check that upgrade from SNRW to X is blocked by presence of S lock. -lock table t1 write; -# Sending: -alter table t1 add column c2 int;; -# -connection mdl_con2; -# Check that the above upgrade of SNRW to X in ALTER TABLE is blocked -# because of S lock. -# -connection default; -# Unblock ALTER TABLE. -handler t1 close; -# -connection mdl_con1; -# Reaping ALTER TABLE. -# Restore the original state of the things. -alter table t1 drop column c2; -unlock tables; -# -connection default; # # 2) Acquire SH (shared high-priority) lock on the table. # We have to involve DEBUG_SYNC facility for this as usually @@ -160,7 +133,7 @@ column_name c1 select count(*) from t1; count(*) -3 +2 insert into t1 values (1); # Check that SU lock is compatible with it. To do this use ALTER TABLE # which will fail when constructing .frm and thus obtaining SU metadata @@ -258,7 +231,7 @@ connection default; begin; select count(*) from t1; count(*) -3 +2 # connection mdl_con1; # Check that S, SH, SR and SW locks are compatible with it. @@ -270,7 +243,7 @@ column_name c1 select count(*) from t1; count(*) -3 +2 insert into t1 values (1); # Check that SU lock is compatible with it. To do this use ALTER TABLE # which will fail when constructing .frm and thus obtaining SU metadata @@ -300,7 +273,7 @@ connection default; begin; select count(*) from t1; count(*) -3 +2 # connection mdl_con1; # Check that X lock is incompatible with SR lock. @@ -323,7 +296,7 @@ connection default; begin; select count(*) from t1; count(*) -3 +2 # connection mdl_con1; # Check that upgrade from SNW to X is blocked by presence of SR lock. @@ -453,7 +426,7 @@ column_name c1 select count(*) from t1; count(*) -5 +4 delete from t1 limit 1; # Check that SU lock is incompatible with SU lock. # Sending: @@ -549,7 +522,7 @@ column_name c1 select count(*) from t1; count(*) -5 +4 # Check that SW lock is incompatible with SNW lock. # Sending: delete from t1 limit 2;; @@ -658,8 +631,6 @@ lock table t1 write; # connection mdl_con1; # Check that S and SH locks are compatible with it. -handler t1 open; -handler t1 close; select column_name from information_schema.columns where table_schema='test' and table_name='t1'; column_name @@ -676,7 +647,7 @@ unlock tables; connection mdl_con1; # Reaping SELECT. count(*) -4 +3 # connection default; lock table t1 write; @@ -847,7 +818,7 @@ ERROR 42S01: Table 't2' already exists connection mdl_con1; # Reaping SELECT. count(*) -4 +3 # connection mdl_con2; # Prepare for blocking RENAME TABLE. @@ -996,7 +967,7 @@ column_name c1 select count(*) from t1; count(*) -4 +3 # Check that SW is incompatible with pending SNW # Sending: delete from t1 limit 1;; @@ -1025,7 +996,7 @@ connection mdl_con2; begin; select count(*) from t1; count(*) -3 +2 # connection default; # Add pending SNRW lock. @@ -1035,8 +1006,6 @@ lock table t1 write;; connection mdl_con1; # Check that LOCK TABLE is waiting with pending SNRW lock. # Check that S and SH locks are compatible with pending SNRW -handler t1 open t; -handler t close; select column_name from information_schema.columns where table_schema='test' and table_name='t1'; column_name @@ -1057,14 +1026,14 @@ unlock tables; connection mdl_con1; # Reaping SELECT. count(*) -3 +2 # Restore pending SNRW lock. # connection mdl_con2; begin; select count(*) from t1; count(*) -3 +2 # connection default; # Sending: @@ -1093,7 +1062,7 @@ connection mdl_con2; begin; select count(*) from t1; count(*) -4 +3 # connection default; # Sending: @@ -1126,7 +1095,7 @@ connection mdl_con2; begin; select count(*) from t1; count(*) -4 +3 # connection default; # Add pending X lock. @@ -1162,7 +1131,7 @@ connection mdl_con2; begin; select count(*) from t1; count(*) -4 +3 # connection default; # Add pending X lock. @@ -1187,14 +1156,14 @@ ERROR 42S01: Table 't2' already exists connection mdl_con1; # Reaping SELECT. count(*) -4 +3 # Restore pending X lock. # connection mdl_con2; begin; select count(*) from t1; count(*) -4 +3 # connection default; # Add pending X lock. @@ -1224,7 +1193,7 @@ connection mdl_con2; begin; select count(*) from t1; count(*) -3 +2 # connection default; # Add pending X lock. @@ -1299,7 +1268,7 @@ connection default; begin; select count(*) from t1; count(*) -3 +2 # connection mdl_con1; # Create an active SNW lock on t2. @@ -1321,7 +1290,7 @@ commit; begin; select count(*) from t1; count(*) -3 +2 # Sending: insert into t2 values (1);; # @@ -1347,7 +1316,7 @@ commit; begin; select count(*) from t1; count(*) -3 +2 # connection mdl_con1; # Create an active SNW lock on t1. @@ -1360,7 +1329,7 @@ set debug_sync= 'now WAIT_FOR locked'; # We should still be able to get SR lock without waiting. select count(*) from t1; count(*) -3 +2 # Since the above ALTER TABLE is not upgrading SNW lock to X by waiting # for SW lock we won't create deadlock. # So the below INSERT should not end-up with ER_LOCK_DEADLOCK error. @@ -1397,7 +1366,7 @@ connection default; # We should still be able to get both SW and SR locks without waiting. select count(*) from t1; count(*) -5 +4 delete from t1 limit 1; # Unblock ALTER TABLE. commit; @@ -1416,7 +1385,7 @@ connection default; begin; select count(*) from t1; count(*) -4 +3 # connection mdl_con2; # Start transaction which will prevent SNW -> X upgrade from @@ -1454,7 +1423,7 @@ commit; begin; select count(*) from t1; count(*) -4 +3 # connection mdl_con2; # Start transaction which will prevent SNW -> X upgrade from @@ -1493,7 +1462,7 @@ commit; begin; select count(*) from t1; count(*) -4 +3 # connection mdl_con1; # Create SNW lock pending upgrade to X. @@ -1505,7 +1474,7 @@ connection default; # Check that transaction is still able to acquire SR lock. select count(*) from t1; count(*) -4 +3 # Waiting trying to acquire SW lock will cause deadlock and # therefore should cause an error. delete from t1 limit 1; @@ -1526,7 +1495,7 @@ connection default; begin; select count(*) from t1; count(*) -4 +3 # connection mdl_con1; lock table t2 write; @@ -1551,7 +1520,7 @@ commit; begin; select count(*) from t1; count(*) -4 +3 # connection mdl_con1; lock table t2 write; @@ -1580,7 +1549,7 @@ commit; begin; select count(*) from t1; count(*) -4 +3 # connection mdl_con1; # Sending: @@ -1591,7 +1560,7 @@ connection default; # Check that another instance of SR lock is granted without waiting. select count(*) from t1; count(*) -4 +3 # Attempt to wait for SW lock will lead to deadlock, thus # the below statement should end with ER_LOCK_DEADLOCK error. delete from t1 limit 1; @@ -1620,7 +1589,7 @@ connection default; # and errors. select count(*) from t1; count(*) -3 +2 insert into t1 values (1, 1); # Unblock LOCK TABLES. commit; @@ -1639,7 +1608,7 @@ connection default; begin; select count(*) from t1; count(*) -4 +3 # connection mdl_con2; # Start transaction which will prevent X lock from going away @@ -1677,7 +1646,7 @@ rename table t3 to t2; begin; select count(*) from t1; count(*) -4 +3 # connection mdl_con2; # Start transaction which will prevent X lock from going away @@ -1721,7 +1690,7 @@ rename table t3 to t2; begin; select count(*) from t1; count(*) -4 +3 # connection mdl_con1; # Sending: @@ -1732,7 +1701,7 @@ connection default; # Check that another instance of SR lock is granted without waiting. select count(*) from t1; count(*) -4 +3 # Attempt to wait for SW lock will lead to deadlock, thus # the below statement should end with ER_LOCK_DEADLOCK error. delete from t1 limit 1; @@ -1761,7 +1730,7 @@ connection default; # and errors. select count(*) from t1; count(*) -3 +2 insert into t1 values (1, 1); # Unblock RENAME TABLE. commit; @@ -1778,149 +1747,6 @@ disconnect mdl_con3; set debug_sync= 'RESET'; drop table t1, t2; # -# Additional coverage for some scenarios in which not quite -# correct use of S metadata locks by HANDLER statement might -# have caused deadlocks. -# -drop table if exists t1, t2; -connect handler_con1,localhost,root,,; -connect handler_con2,localhost,root,,; -connection default; -create table t1 (i int); -create table t2 (j int); -insert into t1 values (1); -# -# First, check scenario in which we upgrade SNRW lock to X lock -# on a table while having HANDLER READ trying to acquire TL_READ -# on the same table. -# -handler t1 open; -# -connection handler_con1; -lock table t1 write; -# Upgrade SNRW to X lock. -# Sending: -alter table t1 add column j int;; -# -connection handler_con2; -# Wait until ALTER is blocked during upgrade. -# -connection default; -# The below statement should not cause deadlock. -handler t1 read first;; -# -connection handler_con1; -# Reap ALTER TABLE. -unlock tables; -# -connection default; -# Reap HANDLER READ. -i j -1 NULL -handler t1 close; -# -# Now, check scenario in which upgrade of SNRW lock to X lock -# can be blocked by HANDLER which is open in connection currently -# waiting to get table-lock owned by connection doing upgrade. -# -handler t1 open; -# -connection handler_con1; -lock table t1 write, t2 read; -# -connection default; -# Execute statement which will be blocked on table-level lock -# owned by connection 'handler_con1'. -# Sending: -insert into t2 values (1);; -# -connection handler_con1; -# Wait until INSERT is blocked on table-level lock. -# Sending 'alter table t1 drop column j'. It should not cause -# deadlock. -alter table t1 drop column j; -connection handler_con2; -# Wait until ALTER is blocked during upgrade. -# -connection default; -# Reap INSERT. -ERROR HY000: Wait on a lock was aborted due to a pending exclusive lock -handler t1 close; -# -connection handler_con1; -# Reaping 'alter table t1 drop column j' -unlock tables; -connection default; -# Then, check the scenario in which upgrade of SNRW lock to X -# lock is blocked by HANDLER which is open in connection currently -# waiting to get SW lock on the same table. -# -handler t1 open; -# -connection handler_con1; -lock table t1 write; -# -connection default; -# The below insert should be blocked because active SNRW lock on 't1'. -# Sending: -insert into t1 values (1);; -# -connection handler_con1; -# Wait until INSERT is blocked because of SNRW lock. -# The below ALTER TABLE will be blocked because of presence of HANDLER. -# Sending: -alter table t1 add column j int;; -# -connection default; -# INSERT should be chosen as victim for resolving deadlock. -# Reaping INSERT. -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -# Close HANDLER to unblock ALTER TABLE. -handler t1 close; -# -connection handler_con1; -# Reaping ALTER TABLE. -unlock tables; -# -connection default; -# -# Finally, test in which upgrade of SNRW lock to X lock is blocked -# by HANDLER which is open in connection currently waiting to get -# SR lock on the table on which lock is upgraded. -# -handler t1 open; -# -connection handler_con1; -lock table t1 write, t2 write; -# -connection default; -# The below insert should be blocked because active SNRW lock on 't1'. -# Sending: -insert into t2 values (1);; -# -connection handler_con1; -# Wait until INSERT is blocked because of SNRW lock. -# The below ALTER TABLE will be blocked because of presence of HANDLER. -# Sending: -alter table t1 drop column j;; -# -connection default; -# INSERT should be chosen as victim for resolving deadlock. -# Reaping INSERT. -ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -# Close HANDLER to unblock ALTER TABLE. -handler t1 close; -# -connection handler_con1; -# Reaping ALTER TABLE. -unlock tables; -# -connection default; -# Clean-up. -disconnect handler_con1; -disconnect handler_con2; -drop tables t1, t2; -# # Test coverage for basic deadlock detection in metadata # locking subsystem. # diff --git a/mysql-test/r/partition_debug_sync.result b/mysql-test/r/partition_debug_sync.result index 971bc63e2e714..b79385686b7ce 100644 --- a/mysql-test/r/partition_debug_sync.result +++ b/mysql-test/r/partition_debug_sync.result @@ -64,29 +64,3 @@ disconnect con1; connection default; SET DEBUG_SYNC= 'RESET'; End of 5.1 tests -# -# Coverage test for non pruned ha_partition::store_lock() -# -CREATE TABLE t1 (a int) ENGINE = InnoDB; -CREATE TABLE t2 (a int PRIMARY KEY) -ENGINE = InnoDB PARTITION BY HASH (a) PARTITIONS 3; -HANDLER t1 OPEN; -connect con1, localhost, root,,; -LOCK TABLES t1 WRITE, t2 READ; -connection default; -SET DEBUG_SYNC="wait_for_lock SIGNAL locking"; -INSERT INTO t2 VALUES (1), (2), (3); -connection con1; -SET DEBUG_SYNC="now WAIT_FOR locking"; -ALTER TABLE t1 ADD COLUMN b int; -connection default; -ERROR HY000: Wait on a lock was aborted due to a pending exclusive lock -SELECT 1; -1 -1 -connection con1; -UNLOCK TABLES; -disconnect con1; -connection default; -SET DEBUG_SYNC = 'RESET'; -DROP TABLE t1, t2; diff --git a/mysql-test/r/partition_explicit_prune.result b/mysql-test/r/partition_explicit_prune.result index 0cf9bde225cde..1272ff8c5fcff 100644 --- a/mysql-test/r/partition_explicit_prune.result +++ b/mysql-test/r/partition_explicit_prune.result @@ -281,7 +281,7 @@ UNLOCK TABLES; SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE -HANDLER_COMMIT 2 +HANDLER_COMMIT 3 HANDLER_READ_RND_NEXT 54 HANDLER_TMP_WRITE 75 HANDLER_WRITE 2 @@ -440,7 +440,7 @@ UNLOCK TABLES; SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE -HANDLER_COMMIT 5 +HANDLER_COMMIT 6 HANDLER_READ_FIRST 3 HANDLER_READ_NEXT 4 HANDLER_READ_RND_NEXT 108 @@ -665,7 +665,7 @@ UNLOCK TABLES; SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE -HANDLER_COMMIT 5 +HANDLER_COMMIT 6 HANDLER_DELETE 2 HANDLER_READ_FIRST 1 HANDLER_READ_KEY 3 @@ -758,7 +758,7 @@ UNLOCK TABLES; SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE -HANDLER_COMMIT 2 +HANDLER_COMMIT 3 HANDLER_READ_RND_NEXT 54 HANDLER_TMP_WRITE 75 HANDLER_WRITE 10 @@ -953,7 +953,7 @@ UNLOCK TABLES; SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE -HANDLER_COMMIT 3 +HANDLER_COMMIT 4 HANDLER_DELETE 1 HANDLER_READ_KEY 2 HANDLER_READ_RND 2 @@ -1039,7 +1039,7 @@ UNLOCK TABLES; SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0; VARIABLE_NAME VARIABLE_VALUE -HANDLER_COMMIT 3 +HANDLER_COMMIT 4 HANDLER_DELETE 2 HANDLER_READ_KEY 3 HANDLER_READ_NEXT 1 diff --git a/mysql-test/r/truncate_coverage.result b/mysql-test/r/truncate_coverage.result index 95e649912e502..078de1ef3abdf 100644 --- a/mysql-test/r/truncate_coverage.result +++ b/mysql-test/r/truncate_coverage.result @@ -6,48 +6,6 @@ DROP TABLE IF EXISTS t1; CREATE TABLE t1 (c1 INT); INSERT INTO t1 VALUES (1); connect con1, localhost, root,,; -HANDLER t1 OPEN; -connection default; -LOCK TABLE t1 WRITE; -SET DEBUG_SYNC='mdl_upgrade_lock SIGNAL waiting'; -TRUNCATE TABLE t1; -connect con2, localhost, root,,; -SET DEBUG_SYNC='now WAIT_FOR waiting'; -KILL QUERY @id; -disconnect con2; -connection default; -ERROR 70100: Query execution was interrupted -UNLOCK TABLES; -connection con1; -# Release shared metadata lock by closing HANDLER. -HANDLER t1 CLOSE; -disconnect con1; -connection default; -DROP TABLE t1; -SET DEBUG_SYNC='RESET'; -CREATE TABLE t1 (c1 INT); -INSERT INTO t1 VALUES (1); -connect con1, localhost, root,,; -HANDLER t1 OPEN; -connection default; -LOCK TABLE t1 WRITE; -SET DEBUG_SYNC='mdl_upgrade_lock SIGNAL waiting'; -TRUNCATE TABLE t1; -connect con2, localhost, root,,; -SET DEBUG_SYNC='now WAIT_FOR waiting'; -disconnect con2; -connection con1; -HANDLER t1 CLOSE; -disconnect con1; -connection default; -ERROR 42S02: Table 'test.t1' doesn't exist -UNLOCK TABLES; -DROP TABLE t1; -ERROR 42S02: Unknown table 'test.t1' -SET DEBUG_SYNC='RESET'; -CREATE TABLE t1 (c1 INT); -INSERT INTO t1 VALUES (1); -connect con1, localhost, root,,; START TRANSACTION; INSERT INTO t1 VALUES (2); connection default; diff --git a/mysql-test/suite/handler/aria.result b/mysql-test/suite/handler/aria.result index b8ed1fd98c8a9..6b02ac9b085c6 100644 --- a/mysql-test/suite/handler/aria.result +++ b/mysql-test/suite/handler/aria.result @@ -545,7 +545,6 @@ optimize table t1; connection default; handler t1 read next; c1 -1 handler t1 close; connection con2; Table Op Msg_type Msg_text @@ -1296,19 +1295,27 @@ commit; # an open HANDLER, ER_LOCK_DEADLOCK is reported. # create table t1 (a int, key a(a)); -create table t2 like t1; handler t1 open; connection con1; -lock table t1 write, t2 write; +select get_lock('lock1', 10); +get_lock('lock1', 10) +1 connection default; -drop table t2; +select get_lock('lock1', 10); connection con2; -# Waiting for 'drop table t2' to get blocked... +# Waiting for 'select get_lock('lock1', 10)' to get blocked... connection con1; drop table t1; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -unlock tables; +select release_lock('lock1'); +release_lock('lock1') +1 connection default; +get_lock('lock1', 10) +1 +select release_lock('lock1'); +release_lock('lock1') +1 # Demonstrate that there is no deadlock with FLUSH TABLE, # even though it is waiting for the other table to go away create table t2 like t1; @@ -1347,6 +1354,10 @@ handler t1 read a next; a 1 # Unblock 'lock tables t1 write'. +select * from t1; +a +1 +2 commit; connection con1; # Reap 'lock tables t1 write'. @@ -1516,10 +1527,6 @@ handler t1 read a last; a b 7 7 commit; -connection con1; -# Demonstrate that the HANDLER doesn't hold MDL_SHARED_WRITE. -lock table t1 write; -unlock tables; connection default; handler t1 read a prev; a b diff --git a/mysql-test/suite/handler/handler.inc b/mysql-test/suite/handler/handler.inc index a4ab5f1ed32d4..2432ff13e559f 100644 --- a/mysql-test/suite/handler/handler.inc +++ b/mysql-test/suite/handler/handler.inc @@ -1054,24 +1054,24 @@ commit; --echo # an open HANDLER, ER_LOCK_DEADLOCK is reported. --echo # create table t1 (a int, key a(a)); -create table t2 like t1; handler t1 open; connection con1; -lock table t1 write, t2 write; +select get_lock('lock1', 10); connection default; -send drop table t2; +send select get_lock('lock1', 10); connection con2; ---echo # Waiting for 'drop table t2' to get blocked... +--echo # Waiting for 'select get_lock('lock1', 10)' to get blocked... let $wait_condition=select count(*)=1 from information_schema.processlist - where state='Waiting for table metadata lock' and - info='drop table t2'; + where state='User lock' and + info='select get_lock(\'lock1\', 10)'; --source include/wait_condition.inc connection con1; --error ER_LOCK_DEADLOCK drop table t1; -unlock tables; +select release_lock('lock1'); connection default; reap; +select release_lock('lock1'); --echo # Demonstrate that there is no deadlock with FLUSH TABLE, --echo # even though it is waiting for the other table to go away @@ -1118,6 +1118,7 @@ connection default; handler t1 read a next; --echo # Unblock 'lock tables t1 write'. +select * from t1; # Release MDL_SHARED_READ held by HANDLER commit; connection con1; @@ -1132,7 +1133,7 @@ connection con1; --echo # Waiting for 'handler t1 read a next' to get blocked... let $wait_condition= select count(*) = 1 from information_schema.processlist - where state = "Waiting for table level lock" and + where state = "Waiting for table metadata lock" and info = "handler t1 read a next"; --source include/wait_condition.inc @@ -1259,10 +1260,6 @@ handler t1 read a last; insert into t1 (a, b) values (7, 7); handler t1 read a last; commit; -connection con1; ---echo # Demonstrate that the HANDLER doesn't hold MDL_SHARED_WRITE. -lock table t1 write; -unlock tables; connection default; handler t1 read a prev; handler t1 close; diff --git a/mysql-test/suite/handler/heap.result b/mysql-test/suite/handler/heap.result index 70dcefe4ff396..fc42e43f710d4 100644 --- a/mysql-test/suite/handler/heap.result +++ b/mysql-test/suite/handler/heap.result @@ -545,7 +545,6 @@ optimize table t1; connection default; handler t1 read next; c1 -1 handler t1 close; connection con2; Table Op Msg_type Msg_text @@ -1296,19 +1295,27 @@ commit; # an open HANDLER, ER_LOCK_DEADLOCK is reported. # create table t1 (a int, key a(a)); -create table t2 like t1; handler t1 open; connection con1; -lock table t1 write, t2 write; +select get_lock('lock1', 10); +get_lock('lock1', 10) +1 connection default; -drop table t2; +select get_lock('lock1', 10); connection con2; -# Waiting for 'drop table t2' to get blocked... +# Waiting for 'select get_lock('lock1', 10)' to get blocked... connection con1; drop table t1; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -unlock tables; +select release_lock('lock1'); +release_lock('lock1') +1 connection default; +get_lock('lock1', 10) +1 +select release_lock('lock1'); +release_lock('lock1') +1 # Demonstrate that there is no deadlock with FLUSH TABLE, # even though it is waiting for the other table to go away create table t2 like t1; @@ -1347,6 +1354,10 @@ handler t1 read a next; a 1 # Unblock 'lock tables t1 write'. +select * from t1; +a +1 +2 commit; connection con1; # Reap 'lock tables t1 write'. @@ -1516,10 +1527,6 @@ handler t1 read a last; a b 7 7 commit; -connection con1; -# Demonstrate that the HANDLER doesn't hold MDL_SHARED_WRITE. -lock table t1 write; -unlock tables; connection default; handler t1 read a prev; a b diff --git a/mysql-test/suite/handler/innodb.result b/mysql-test/suite/handler/innodb.result index 102237617fd76..80e8ed679a90e 100644 --- a/mysql-test/suite/handler/innodb.result +++ b/mysql-test/suite/handler/innodb.result @@ -1299,19 +1299,27 @@ commit; # an open HANDLER, ER_LOCK_DEADLOCK is reported. # create table t1 (a int, key a(a)); -create table t2 like t1; handler t1 open; connection con1; -lock table t1 write, t2 write; +select get_lock('lock1', 10); +get_lock('lock1', 10) +1 connection default; -drop table t2; +select get_lock('lock1', 10); connection con2; -# Waiting for 'drop table t2' to get blocked... +# Waiting for 'select get_lock('lock1', 10)' to get blocked... connection con1; drop table t1; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -unlock tables; +select release_lock('lock1'); +release_lock('lock1') +1 connection default; +get_lock('lock1', 10) +1 +select release_lock('lock1'); +release_lock('lock1') +1 # Demonstrate that there is no deadlock with FLUSH TABLE, # even though it is waiting for the other table to go away create table t2 like t1; @@ -1350,6 +1358,10 @@ handler t1 read a next; a 1 # Unblock 'lock tables t1 write'. +select * from t1; +a +1 +2 commit; connection con1; # Reap 'lock tables t1 write'. @@ -1519,10 +1531,6 @@ handler t1 read a last; a b 7 7 commit; -connection con1; -# Demonstrate that the HANDLER doesn't hold MDL_SHARED_WRITE. -lock table t1 write; -unlock tables; connection default; handler t1 read a prev; a b diff --git a/mysql-test/suite/handler/interface.result b/mysql-test/suite/handler/interface.result index 4d5a385df0f9b..a4ac32c16b4ef 100644 --- a/mysql-test/suite/handler/interface.result +++ b/mysql-test/suite/handler/interface.result @@ -272,24 +272,6 @@ handler t1 read a next; ERROR 42S02: Unknown table 't1' in HANDLER connect con1,localhost,root,,; connect con2,localhost,root,,; -connection default; -drop table if exists t1; -# First test case which is supposed trigger the execution -# path on which problem was discovered. -create table t1 (a int not null); -insert into t1 values (1); -handler t1 open; -connection con1; -lock table t1 write; -alter table t1 engine=csv; -connection con2; -connection default; -handler t1 read a next; -ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option -handler t1 close; -connection con1; -unlock tables; -drop table t1; # Now test case which was reported originally but which no longer # triggers execution path which has caused the problem. connection default; diff --git a/mysql-test/suite/handler/interface.test b/mysql-test/suite/handler/interface.test index a82412799ebc9..2f576c9b291d9 100644 --- a/mysql-test/suite/handler/interface.test +++ b/mysql-test/suite/handler/interface.test @@ -298,32 +298,6 @@ handler t1 read a next; connect(con1,localhost,root,,); connect(con2,localhost,root,,); -connection default; ---disable_warnings -drop table if exists t1; ---enable_warnings ---echo # First test case which is supposed trigger the execution ---echo # path on which problem was discovered. -create table t1 (a int not null); -insert into t1 values (1); -handler t1 open; -connection con1; -lock table t1 write; -send alter table t1 engine=csv; -connection con2; -let $wait_condition= - select count(*) = 1 from information_schema.processlist - where state = "Waiting for table metadata lock" and - info = "alter table t1 engine=csv"; ---source include/wait_condition.inc -connection default; ---error ER_ILLEGAL_HA -handler t1 read a next; -handler t1 close; -connection con1; ---reap -unlock tables; -drop table t1; --echo # Now test case which was reported originally but which no longer --echo # triggers execution path which has caused the problem. connection default; diff --git a/mysql-test/suite/handler/myisam.result b/mysql-test/suite/handler/myisam.result index fca75f3b7a603..90e1767a1f301 100644 --- a/mysql-test/suite/handler/myisam.result +++ b/mysql-test/suite/handler/myisam.result @@ -545,7 +545,6 @@ optimize table t1; connection default; handler t1 read next; c1 -1 handler t1 close; connection con2; Table Op Msg_type Msg_text @@ -1296,19 +1295,27 @@ commit; # an open HANDLER, ER_LOCK_DEADLOCK is reported. # create table t1 (a int, key a(a)); -create table t2 like t1; handler t1 open; connection con1; -lock table t1 write, t2 write; +select get_lock('lock1', 10); +get_lock('lock1', 10) +1 connection default; -drop table t2; +select get_lock('lock1', 10); connection con2; -# Waiting for 'drop table t2' to get blocked... +# Waiting for 'select get_lock('lock1', 10)' to get blocked... connection con1; drop table t1; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -unlock tables; +select release_lock('lock1'); +release_lock('lock1') +1 connection default; +get_lock('lock1', 10) +1 +select release_lock('lock1'); +release_lock('lock1') +1 # Demonstrate that there is no deadlock with FLUSH TABLE, # even though it is waiting for the other table to go away create table t2 like t1; @@ -1347,6 +1354,10 @@ handler t1 read a next; a 1 # Unblock 'lock tables t1 write'. +select * from t1; +a +1 +2 commit; connection con1; # Reap 'lock tables t1 write'. @@ -1516,10 +1527,6 @@ handler t1 read a last; a b 7 7 commit; -connection con1; -# Demonstrate that the HANDLER doesn't hold MDL_SHARED_WRITE. -lock table t1 write; -unlock tables; connection default; handler t1 read a prev; a b diff --git a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result index 6c709945111bc..3b5f67efe7831 100644 --- a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result +++ b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result @@ -410,6 +410,7 @@ LOCK TABLES t11 WRITE; SET SESSION BINLOG_FORMAT=ROW; INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict'); SET SESSION BINLOG_FORMAT=STATEMENT; +ERROR HY000: Cannot modify @@session.binlog_format inside a transaction INSERT INTO t11 VALUES('Careful With That Axe, Eugene'); UNLOCK TABLES; SELECT * FROM t11; diff --git a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test index 575fdb2e89dac..e5e2f7a381d75 100644 --- a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test +++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test @@ -524,6 +524,7 @@ CREATE TABLE t11 (song VARCHAR(255)); LOCK TABLES t11 WRITE; SET SESSION BINLOG_FORMAT=ROW; INSERT INTO t11 VALUES('Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict'); +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT SET SESSION BINLOG_FORMAT=STATEMENT; INSERT INTO t11 VALUES('Careful With That Axe, Eugene'); UNLOCK TABLES; diff --git a/mysql-test/t/innodb_mysql_lock.test b/mysql-test/t/innodb_mysql_lock.test index cb57c092e4064..85ba41860df56 100644 --- a/mysql-test/t/innodb_mysql_lock.test +++ b/mysql-test/t/innodb_mysql_lock.test @@ -150,14 +150,16 @@ let $wait_condition= --source include/wait_condition.inc LOCK TABLES t1 READ; SELECT release_lock('bug42147_lock'); +let $wait_condition= + SELECT COUNT(*) > 0 FROM information_schema.processlist + WHERE state = 'executing' + AND info = 'INSERT INTO t1 SELECT get_lock(\'bug42147_lock\', 60)'; +--source include/wait_condition.inc +UNLOCK TABLES; connection default; --reap -connection con2; -UNLOCK TABLES; - -connection default; disconnect con2; DROP TABLE t1; diff --git a/mysql-test/t/lock_sync.test b/mysql-test/t/lock_sync.test index c090e3a1d936a..07c16acc72ad5 100644 --- a/mysql-test/t/lock_sync.test +++ b/mysql-test/t/lock_sync.test @@ -406,6 +406,12 @@ let $restore_table= t2; --echo # 2.8 REPLACE with a subquery. --echo # --echo # Same is true for this statement as well. + +--echo # Suppress warnings for REPLACE ... SELECT +--disable_query_log +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +--enable_query_log + let $statement= replace into t2 select i+5 from t1; let $restore_table= t2; --source include/check_no_concurrent_insert.inc @@ -872,116 +878,6 @@ disconnect con2; set @@global.concurrent_insert= @old_concurrent_insert; ---echo # ---echo # Test for bug #45143 "All connections hang on concurrent ALTER TABLE". ---echo # ---echo # Concurrent execution of statements which required weak write lock ---echo # (TL_WRITE_ALLOW_WRITE) on several instances of the same table and ---echo # statements which tried to acquire stronger write lock (TL_WRITE, ---echo # TL_WRITE_ALLOW_READ) on this table might have led to deadlock. -# -# Suppress warnings for INSERTs that use get_lock(). -# -disable_query_log; -call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -enable_query_log; - ---disable_warnings -drop table if exists t1; -drop view if exists v1; ---enable_warnings ---echo # Create auxiliary connections used through the test. -connect (con_bug45143_1,localhost,root,,test,,); -connect (con_bug45143_3,localhost,root,,test,,); -connect (con_bug45143_2,localhost,root,,test,,); -connection default; ---echo # Reset DEBUG_SYNC facility before using it. -set debug_sync= 'RESET'; ---echo # Turn off logging so calls to locking subsystem performed ---echo # for general_log table won't interfere with our test. -set @old_general_log = @@global.general_log; -set @@global.general_log= OFF; - -create table t1 (i int) engine=InnoDB; ---echo # We have to use view in order to make LOCK TABLES avoid ---echo # acquiring SNRW metadata lock on table. -create view v1 as select * from t1; -insert into t1 values (1); ---echo # Prepare user lock which will be used for resuming execution of ---echo # the first statement after it acquires TL_WRITE_ALLOW_WRITE lock. -select get_lock("lock_bug45143_wait", 0); - -connection con_bug45143_1; ---echo # Sending: ---send insert into t1 values (get_lock("lock_bug45143_wait", 100)); - -connection con_bug45143_2; ---echo # Wait until the above INSERT takes TL_WRITE_ALLOW_WRITE lock on 't1' ---echo # and then gets blocked on user lock 'lock_bug45143_wait'. -let $wait_condition= select count(*)= 1 from information_schema.processlist - where state= 'User lock' and - info='insert into t1 values (get_lock("lock_bug45143_wait", 100))'; ---source include/wait_condition.inc ---echo # Ensure that upcoming SELECT waits after acquiring TL_WRITE_ALLOW_WRITE ---echo # lock for the first instance of 't1'. -set debug_sync='thr_multi_lock_after_thr_lock SIGNAL parked WAIT_FOR go'; ---echo # Sending: ---send select count(*) > 0 from t1 as a, t1 as b for update; - -connection con_bug45143_3; ---echo # Wait until the above SELECT ... FOR UPDATE is blocked after ---echo # acquiring lock for the the first instance of 't1'. -set debug_sync= 'now WAIT_FOR parked'; ---echo # Send LOCK TABLE statement which will try to get TL_WRITE lock on 't1': ---send lock table v1 write; - -connection default; ---echo # Wait until this LOCK TABLES statement starts waiting for table lock. -let $wait_condition= select count(*)= 1 from information_schema.processlist - where state= 'Waiting for table level lock' and - info='lock table v1 write'; ---source include/wait_condition.inc ---echo # Allow SELECT ... FOR UPDATE to resume. ---echo # Since it already has TL_WRITE_ALLOW_WRITE lock on the first instance ---echo # of 't1' it should be able to get lock on the second instance without ---echo # waiting, even although there is another thread which has such lock ---echo # on this table and also there is a thread waiting for a TL_WRITE on it. -set debug_sync= 'now SIGNAL go'; - -connection con_bug45143_2; ---echo # Reap SELECT ... FOR UPDATE ---reap - -connection default; ---echo # Resume execution of the INSERT statement. -select release_lock("lock_bug45143_wait"); - -connection con_bug45143_1; ---echo # Reap INSERT statement. ---echo # In Statement and Mixed replication mode we get here "Unsafe ---echo # for binlog" warnings. In row mode there are no warnings. ---echo # Hide the discrepancy. ---disable_warnings ---reap ---enable_warnings - - -connection con_bug45143_3; ---echo # Reap LOCK TABLES statement. ---reap -unlock tables; - -connection default; ---echo # Do clean-up. -disconnect con_bug45143_1; -disconnect con_bug45143_2; -disconnect con_bug45143_3; -set debug_sync= 'RESET'; -set @@global.general_log= @old_general_log; -drop view v1; -drop table t1; - - --echo # --echo # Bug#50821 Deadlock between LOCK TABLES and ALTER TABLE --echo # @@ -1050,55 +946,6 @@ DROP EVENT e2; SET DEBUG_SYNC="RESET"; ---echo # ---echo # Bug#55930 Assertion `thd->transaction.stmt.is_empty() || ---echo # thd->in_sub_stmt || (thd->state.. ---echo # - ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings - -CREATE TABLE t1(a INT) engine=InnoDB; -INSERT INTO t1 VALUES (1), (2); - -connect (con1, localhost, root); -connect (con2, localhost, root); - -connection con1; -SET SESSION lock_wait_timeout= 1; -SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL opti_recreate WAIT_FOR opti_analyze'; ---echo # Sending: ---send OPTIMIZE TABLE t1 - -connection con2; -SET DEBUG_SYNC= 'now WAIT_FOR opti_recreate'; -SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL thrlock WAIT_FOR release_thrlock'; ---echo # Sending: ---send INSERT INTO t1 VALUES (3) - -connection default; -SET DEBUG_SYNC= 'now WAIT_FOR thrlock'; -SET DEBUG_SYNC= 'now SIGNAL opti_analyze'; - -connection con1; ---echo # Reaping: OPTIMIZE TABLE t1 ---reap -SET DEBUG_SYNC= 'now SIGNAL release_thrlock'; -disconnect con1; ---source include/wait_until_disconnected.inc - -connection con2; ---echo # Reaping: INSERT INTO t1 VALUES (3) ---reap -disconnect con2; ---source include/wait_until_disconnected.inc - -connection default; -DROP TABLE t1; -SET DEBUG_SYNC= 'RESET'; - - --echo # --echo # Bug#57130 crash in Item_field::print during SHOW CREATE TABLE or VIEW --echo # diff --git a/mysql-test/t/mdl_sync.test b/mysql-test/t/mdl_sync.test index 0b6d6f58013e4..4aa191d3dfcc1 100644 --- a/mysql-test/t/mdl_sync.test +++ b/mysql-test/t/mdl_sync.test @@ -119,10 +119,6 @@ alter table t1 add index (not_exist); --echo # lock. --error ER_DUP_ENTRY alter table t1 add primary key (c1); ---echo # Check that SNRW lock is compatible with S lock. -lock table t1 write; -insert into t1 values (1); -unlock tables; --echo # Check that X lock is incompatible with S lock. --echo # Sending: --send rename table t1 to t2; @@ -172,35 +168,6 @@ connection mdl_con1; alter table t1 drop column c2; --echo # connection default; -handler t1 open; ---echo # -connection mdl_con1; ---echo # Check that upgrade from SNRW to X is blocked by presence of S lock. -lock table t1 write; ---echo # Sending: ---send alter table t1 add column c2 int; ---echo # -connection mdl_con2; ---echo # Check that the above upgrade of SNRW to X in ALTER TABLE is blocked ---echo # because of S lock. -let $wait_condition= - select count(*) = 1 from information_schema.processlist - where state = "Waiting for table metadata lock" and - info = "alter table t1 add column c2 int"; ---source include/wait_condition.inc ---echo # -connection default; ---echo # Unblock ALTER TABLE. -handler t1 close; ---echo # -connection mdl_con1; ---echo # Reaping ALTER TABLE. ---reap ---echo # Restore the original state of the things. -alter table t1 drop column c2; -unlock tables; ---echo # -connection default; --echo # --echo # 2) Acquire SH (shared high-priority) lock on the table. --echo # We have to involve DEBUG_SYNC facility for this as usually @@ -797,8 +764,6 @@ lock table t1 write; --echo # connection mdl_con1; --echo # Check that S and SH locks are compatible with it. -handler t1 open; -handler t1 close; select column_name from information_schema.columns where table_schema='test' and table_name='t1'; --echo # Check that SR lock is incompatible with SNRW lock. @@ -1293,8 +1258,6 @@ where state = "Waiting for table metadata lock" and info = "lock table t1 write"; --source include/wait_condition.inc --echo # Check that S and SH locks are compatible with pending SNRW -handler t1 open t; -handler t close; select column_name from information_schema.columns where table_schema='test' and table_name='t1'; --echo # Check that SR is incompatible with pending SNRW @@ -2162,190 +2125,6 @@ disconnect mdl_con3; set debug_sync= 'RESET'; drop table t1, t2; - ---echo # ---echo # Additional coverage for some scenarios in which not quite ---echo # correct use of S metadata locks by HANDLER statement might ---echo # have caused deadlocks. ---echo # ---disable_warnings -drop table if exists t1, t2; ---enable_warnings -connect(handler_con1,localhost,root,,); -connect(handler_con2,localhost,root,,); -connection default; -create table t1 (i int); -create table t2 (j int); -insert into t1 values (1); - ---echo # ---echo # First, check scenario in which we upgrade SNRW lock to X lock ---echo # on a table while having HANDLER READ trying to acquire TL_READ ---echo # on the same table. ---echo # -handler t1 open; ---echo # -connection handler_con1; -lock table t1 write; ---echo # Upgrade SNRW to X lock. ---echo # Sending: ---send alter table t1 add column j int; ---echo # -connection handler_con2; ---echo # Wait until ALTER is blocked during upgrade. -let $wait_condition= - select count(*) = 1 from information_schema.processlist - where state = "Waiting for table metadata lock" and - info = "alter table t1 add column j int"; ---source include/wait_condition.inc ---echo # -connection default; ---echo # The below statement should not cause deadlock. ---send handler t1 read first; ---echo # -connection handler_con1; ---echo # Reap ALTER TABLE. ---reap -unlock tables; ---echo # -connection default; ---echo # Reap HANDLER READ. ---reap -handler t1 close; - ---echo # ---echo # Now, check scenario in which upgrade of SNRW lock to X lock ---echo # can be blocked by HANDLER which is open in connection currently ---echo # waiting to get table-lock owned by connection doing upgrade. ---echo # -handler t1 open; ---echo # -connection handler_con1; -lock table t1 write, t2 read; ---echo # -connection default; ---echo # Execute statement which will be blocked on table-level lock ---echo # owned by connection 'handler_con1'. ---echo # Sending: ---send insert into t2 values (1); ---echo # -connection handler_con1; ---echo # Wait until INSERT is blocked on table-level lock. -let $wait_condition= - select count(*) = 1 from information_schema.processlist - where state = "Waiting for table level lock" and - info = "insert into t2 values (1)"; ---source include/wait_condition.inc ---echo # Sending 'alter table t1 drop column j'. It should not cause ---echo # deadlock. -send alter table t1 drop column j; -connection handler_con2; ---echo # Wait until ALTER is blocked during upgrade. -let $wait_condition= - select count(*) = 1 from information_schema.processlist - where state = "Waiting for table metadata lock" and - info = "alter table t1 drop column j"; ---source include/wait_condition.inc ---echo # -connection default; ---echo # Reap INSERT. ---error ER_LOCK_ABORTED ---reap -handler t1 close; ---echo # -connection handler_con1; ---echo # Reaping 'alter table t1 drop column j' ---reap -unlock tables; -connection default; - ---echo # Then, check the scenario in which upgrade of SNRW lock to X ---echo # lock is blocked by HANDLER which is open in connection currently ---echo # waiting to get SW lock on the same table. ---echo # -handler t1 open; ---echo # -connection handler_con1; -lock table t1 write; ---echo # -connection default; ---echo # The below insert should be blocked because active SNRW lock on 't1'. ---echo # Sending: ---send insert into t1 values (1); ---echo # -connection handler_con1; ---echo # Wait until INSERT is blocked because of SNRW lock. -let $wait_condition= - select count(*) = 1 from information_schema.processlist - where state = "Waiting for table metadata lock" and - info = "insert into t1 values (1)"; ---source include/wait_condition.inc ---echo # The below ALTER TABLE will be blocked because of presence of HANDLER. ---echo # Sending: ---send alter table t1 add column j int; ---echo # -connection default; ---echo # INSERT should be chosen as victim for resolving deadlock. ---echo # Reaping INSERT. ---error ER_LOCK_DEADLOCK ---reap ---echo # Close HANDLER to unblock ALTER TABLE. -handler t1 close; ---echo # -connection handler_con1; ---echo # Reaping ALTER TABLE. ---reap -unlock tables; ---echo # -connection default; - ---echo # ---echo # Finally, test in which upgrade of SNRW lock to X lock is blocked ---echo # by HANDLER which is open in connection currently waiting to get ---echo # SR lock on the table on which lock is upgraded. ---echo # -handler t1 open; ---echo # -connection handler_con1; -lock table t1 write, t2 write; ---echo # -connection default; ---echo # The below insert should be blocked because active SNRW lock on 't1'. ---echo # Sending: ---send insert into t2 values (1); ---echo # -connection handler_con1; ---echo # Wait until INSERT is blocked because of SNRW lock. -let $wait_condition= - select count(*) = 1 from information_schema.processlist - where state = "Waiting for table metadata lock" and - info = "insert into t2 values (1)"; ---source include/wait_condition.inc ---echo # The below ALTER TABLE will be blocked because of presence of HANDLER. ---echo # Sending: ---send alter table t1 drop column j; ---echo # -connection default; ---echo # INSERT should be chosen as victim for resolving deadlock. ---echo # Reaping INSERT. ---error ER_LOCK_DEADLOCK ---reap ---echo # Close HANDLER to unblock ALTER TABLE. -handler t1 close; ---echo # -connection handler_con1; ---echo # Reaping ALTER TABLE. ---reap -unlock tables; ---echo # -connection default; - ---echo # Clean-up. -disconnect handler_con1; -disconnect handler_con2; -drop tables t1, t2; - - --echo # --echo # Test coverage for basic deadlock detection in metadata --echo # locking subsystem. diff --git a/mysql-test/t/partition_debug_sync.test b/mysql-test/t/partition_debug_sync.test index 11af9b06cdd13..f085ea3fb8361 100644 --- a/mysql-test/t/partition_debug_sync.test +++ b/mysql-test/t/partition_debug_sync.test @@ -82,43 +82,3 @@ connection default; SET DEBUG_SYNC= 'RESET'; --echo End of 5.1 tests - ---echo # ---echo # Coverage test for non pruned ha_partition::store_lock() ---echo # -CREATE TABLE t1 (a int) ENGINE = InnoDB; -CREATE TABLE t2 (a int PRIMARY KEY) -ENGINE = InnoDB PARTITION BY HASH (a) PARTITIONS 3; - -HANDLER t1 OPEN; - -connect (con1, localhost, root,,); - -LOCK TABLES t1 WRITE, t2 READ; - -connection default; - -SET DEBUG_SYNC="wait_for_lock SIGNAL locking"; -send INSERT INTO t2 VALUES (1), (2), (3); - -connection con1; -SET DEBUG_SYNC="now WAIT_FOR locking"; - -send ALTER TABLE t1 ADD COLUMN b int; - -connection default; ---error ER_LOCK_ABORTED ---reap - -SELECT 1; - -connection con1; ---reap - -UNLOCK TABLES; ---disconnect con1 - -connection default; -SET DEBUG_SYNC = 'RESET'; - -DROP TABLE t1, t2; diff --git a/mysql-test/t/truncate_coverage.test b/mysql-test/t/truncate_coverage.test index 0834f7a3eca68..3351ce84232b1 100644 --- a/mysql-test/t/truncate_coverage.test +++ b/mysql-test/t/truncate_coverage.test @@ -17,86 +17,6 @@ DROP TABLE IF EXISTS t1; --echo # Bug#20667 - Truncate table fails for a write locked table --echo # ######## -# Attack wait_while_table_is_used(). Kill query while trying to -# upgrade MDL. -# -CREATE TABLE t1 (c1 INT); -INSERT INTO t1 VALUES (1); -# -# Acquire a shared metadata lock on table by opening HANDLER for it and wait. -# TRUNCATE shall block on this metadata lock. -# We can't use normal DML as such statements would also block LOCK TABLES. -# ---connect (con1, localhost, root,,) -HANDLER t1 OPEN; -# -# Get connection id of default connection. -# Lock the table and start TRUNCATE, which will block on MDL upgrade. -# ---connection default -let $ID= `SELECT @id := CONNECTION_ID()`; -LOCK TABLE t1 WRITE; -SET DEBUG_SYNC='mdl_upgrade_lock SIGNAL waiting'; -send TRUNCATE TABLE t1; -# -# Get the default connection ID into a variable in an invisible statement. -# Kill the TRUNCATE query. This shall result in an error return -# from wait_while_table_is_used(). -# ---connect (con2, localhost, root,,) -SET DEBUG_SYNC='now WAIT_FOR waiting'; -let $invisible_assignment_in_select = `SELECT @id := $ID`; -KILL QUERY @id; ---disconnect con2 ---connection default ---error ER_QUERY_INTERRUPTED -reap; -UNLOCK TABLES; ---connection con1 ---echo # Release shared metadata lock by closing HANDLER. -HANDLER t1 CLOSE; ---disconnect con1 ---connection default -DROP TABLE t1; -SET DEBUG_SYNC='RESET'; -######## -# Attack reopen_tables(). Remove form file. -# -CREATE TABLE t1 (c1 INT); -INSERT INTO t1 VALUES (1); -# -# Acquire a shared metadata lock on table by opening HANDLER for it and wait. -# TRUNCATE shall block on this metadata lock. -# We can't use normal DML as such statements would also block LOCK TABLES. -# ---connect (con1, localhost, root,,) -HANDLER t1 OPEN; -# -# Lock the table and start TRUNCATE, which will block on MDL upgrade. -# ---connection default -LOCK TABLE t1 WRITE; -SET DEBUG_SYNC='mdl_upgrade_lock SIGNAL waiting'; -send TRUNCATE TABLE t1; -# -# Remove datafile. -# Commit to let TRUNCATE continue. -# ---connect (con2, localhost, root,,) -SET DEBUG_SYNC='now WAIT_FOR waiting'; ---remove_file $MYSQLD_DATADIR/test/t1.frm ---disconnect con2 ---connection con1 -HANDLER t1 CLOSE; ---disconnect con1 ---connection default ---error ER_NO_SUCH_TABLE -reap; -UNLOCK TABLES; ---error ER_BAD_TABLE_ERROR -DROP TABLE t1; -SET DEBUG_SYNC='RESET'; -######## # Attack acquire_exclusive_locks(). Hold a global read lock. # Non-LOCK TABLE case. # diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 2d40631d79f57..e1d788ba36723 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2150,6 +2150,11 @@ Locked_tables_list::unlock_locked_tables(THD *thd) request for metadata locks and TABLE_LIST elements. */ reset(); + if (thd->variables.option_bits & OPTION_AUTOCOMMIT) + { + thd->variables.option_bits&= ~(OPTION_NOT_AUTOCOMMIT); + thd->server_status|= SERVER_STATUS_AUTOCOMMIT; + } } diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 95417c73c74e0..405e7ce8c38e5 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -282,7 +282,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, SQL_HANDLER *reopen) back-off for such locks. */ tables->mdl_request.init(MDL_key::TABLE, tables->db, tables->table_name, - MDL_SHARED, MDL_TRANSACTION); + MDL_SHARED_READ, MDL_TRANSACTION); mdl_savepoint= thd->mdl_context.mdl_savepoint(); /* for now HANDLER can be used only for real TABLES */ @@ -750,11 +750,12 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables, tables->table= table; // This is used by fix_fields table->pos_in_table_list= tables; - if (handler->lock->lock_count > 0) + if (handler->lock->table_count > 0) { int lock_error; - handler->lock->locks[0]->type= handler->lock->locks[0]->org_type; + if (handler->lock->lock_count > 0) + handler->lock->locks[0]->type= handler->lock->locks[0]->org_type; /* save open_tables state */ TABLE* backup_open_tables= thd->open_tables; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 74b5ac79ad1c6..a2a4ed2b77ebe 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4794,7 +4794,8 @@ mysql_execute_command(THD *thd) if (lock_tables_precheck(thd, all_tables)) goto error; - thd->variables.option_bits|= OPTION_TABLE_LOCK; + thd->variables.option_bits|= OPTION_TABLE_LOCK | OPTION_NOT_AUTOCOMMIT; + thd->server_status&= ~SERVER_STATUS_AUTOCOMMIT; res= lock_tables_open_and_lock_tables(thd, all_tables); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 30765ddd357a3..73217bdddd95a 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -18932,7 +18932,6 @@ free_share( mysql_mutex_unlock(&innobase_share_mutex); } -#if 0 /*********************************************************************//** Returns number of THR_LOCK locks used for one instance of InnoDB table. InnoDB no longer relies on THR_LOCK locks so 0 value is returned. @@ -18948,7 +18947,6 @@ ha_innobase::lock_count(void) const { return 0; } -#endif /*****************************************************************//** Supposed to convert a MySQL table lock stored in the 'lock' field of the @@ -19196,8 +19194,6 @@ ha_innobase::store_lock( lock.type = lock_type; } - *to++= &lock; - if (!trx_is_started(trx) && (m_prebuilt->select_lock_type != LOCK_NONE || m_prebuilt->stored_select_lock_type != LOCK_NONE)) { diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index b436453e61041..84feea119c1be 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -274,7 +274,7 @@ class ha_innobase: public handler void free_foreign_key_create_info(char* str); - //uint lock_count(void) const; + uint lock_count(void) const; THR_LOCK_DATA** store_lock( THD* thd, diff --git a/storage/tokudb/mysql-test/tokudb/r/nested_txn_implicit_commit.result b/storage/tokudb/mysql-test/tokudb/r/nested_txn_implicit_commit.result index ac1a13d55237c..f1ea7e2014715 100644 --- a/storage/tokudb/mysql-test/tokudb/r/nested_txn_implicit_commit.result +++ b/storage/tokudb/mysql-test/tokudb/r/nested_txn_implicit_commit.result @@ -46,7 +46,6 @@ a b 1 10 2 20 3 30 -4 40 insert into t2 values (1); ERROR HY000: Table 't2' was not locked with LOCK TABLES commit; @@ -59,7 +58,6 @@ a b 1 10 2 20 3 30 -4 40 select * from t2; a 1 @@ -72,7 +70,6 @@ a b 1 10 2 20 3 30 -4 40 5 50 select * from t2; a @@ -84,7 +81,6 @@ a b 1 10 2 20 3 30 -4 40 5 50 select * from t2; a diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db806.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db806.result index ae87dbab281cc..8578bb3b36c1d 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/r/db806.result +++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db806.result @@ -2,8 +2,8 @@ drop table if exists t1,t3; CREATE TABLE t3(a int,c int,d int)engine=TOKUDB; lock table t3 read; create temporary table t1 engine=tokudb as SELECT 1; +unlock tables; select * from t1; 1 1 -unlock tables; drop table t1,t3; diff --git a/storage/tokudb/mysql-test/tokudb_bugs/t/db806.test b/storage/tokudb/mysql-test/tokudb_bugs/t/db806.test index 3815e59f78c05..8dcebe1bb6b86 100644 --- a/storage/tokudb/mysql-test/tokudb_bugs/t/db806.test +++ b/storage/tokudb/mysql-test/tokudb_bugs/t/db806.test @@ -7,7 +7,7 @@ enable_warnings; CREATE TABLE t3(a int,c int,d int)engine=TOKUDB; lock table t3 read; create temporary table t1 engine=tokudb as SELECT 1; -select * from t1; unlock tables; +select * from t1; -drop table t1,t3; \ No newline at end of file +drop table t1,t3; From 56a041cde657e5618c519a3c50e8075136d4a1ce Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Thu, 3 Nov 2016 13:37:15 +0100 Subject: [PATCH 37/71] MDEV-11065: Compressed binary log. Fix BINLOG statement. BINLOG statement output by mysqlbinlog actually has the base64 of the non-compressed event. So remove my previous incorrect review change, which allowed compressed event types for BINLOG statement. Also add a couple test cases for this, running mysqlbinlog | mysql. --- .../r/mysqlbinlog_row_compressed.result | 42 ++++++++++++++++++- .../r/mysqlbinlog_stmt_compressed.result | 27 +++++++++++- mysql-test/t/mysqlbinlog_row_compressed.test | 33 ++++++++++++++- mysql-test/t/mysqlbinlog_stmt_compressed.test | 24 ++++++++++- sql/sql_binlog.cc | 6 --- 5 files changed, 122 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/mysqlbinlog_row_compressed.result b/mysql-test/r/mysqlbinlog_row_compressed.result index c5d8c2b163b72..a612433fc2f4b 100644 --- a/mysql-test/r/mysqlbinlog_row_compressed.result +++ b/mysql-test/r/mysqlbinlog_row_compressed.result @@ -408,6 +408,46 @@ DELIMITER ; ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; -DROP TABLE t1,t2; + +Test mysqlbinlog | mysql type point-in-time recovery with compressed events. + +FLUSH BINARY LOGS; +CREATE TABLE t3 (a INT PRIMARY KEY, b INT, c VARCHAR(100)); +INSERT INTO t3 VALUES (0, 10, "hello"); +BEGIN; +INSERT INTO t3 VALUES (1, 10, "cat"), (2, 10, "mouse"), (3, 10, "dog"); +INSERT INTO t3 VALUES (4, 10, "goodbye"); +COMMIT; +UPDATE t3 SET b=b+100 where a<>1; +DELETE FROM t3 WHERE a=2; +SET @old_image=@@binlog_row_image; +SET binlog_row_image=minimal; +INSERT INTO t3 VALUES (5, 20, "red"), (6, 30, "green"), (7, 40, "blue"); +INSERT INTO t3 VALUES (8, 20, "rigel"); +UPDATE t3 SET c = concat("colour of ", c) WHERE a > 5; +UPDATE t3 SET b=b*2 WHERE a IN (5,6,7); +DELETE FROM t3 WHERE a=6; +SET binlog_row_image=@old_image; +SELECT * FROM t3 ORDER BY a; +a b c +0 110 hello +1 10 cat +3 110 dog +4 110 goodbye +5 40 red +7 80 colour of blue +8 20 colour of rigel +FLUSH LOGS; +DROP TABLE t3; +SELECT * FROM t3 ORDER BY a; +a b c +0 110 hello +1 10 cat +3 110 dog +4 110 goodbye +5 40 red +7 80 colour of blue +8 20 colour of rigel +DROP TABLE t1,t2,t3; SET GLOBAL log_bin_compress=off; SET GLOBAL log_bin_compress_min_len=256; diff --git a/mysql-test/r/mysqlbinlog_stmt_compressed.result b/mysql-test/r/mysqlbinlog_stmt_compressed.result index 6bff2649b0245..99f9c7e991411 100644 --- a/mysql-test/r/mysqlbinlog_stmt_compressed.result +++ b/mysql-test/r/mysqlbinlog_stmt_compressed.result @@ -177,6 +177,31 @@ DELIMITER ; ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/; -DROP TABLE t1,t2; + +Test mysqlbinlog | mysql type point-in-time recovery with compressed events. + +FLUSH BINARY LOGS; +CREATE TABLE t3 (a INT PRIMARY KEY, b INT, c VARCHAR(100)); +INSERT INTO t3 VALUES (0, 10, "hello"); +BEGIN; +INSERT INTO t3 VALUES (1, 10, "cat"), (2, 10, "mouse"), (3, 10, "dog"); +INSERT INTO t3 VALUES (4, 10, "goodbye"); +COMMIT; +DELETE FROM t3 WHERE a=2; +SELECT * FROM t3 ORDER BY a; +a b c +0 10 hello +1 10 cat +3 10 dog +4 10 goodbye +FLUSH LOGS; +DROP TABLE t3; +SELECT * FROM t3 ORDER BY a; +a b c +0 10 hello +1 10 cat +3 10 dog +4 10 goodbye +DROP TABLE t1,t2,t3; SET GLOBAL log_bin_compress=off; SET GLOBAL log_bin_compress_min_len=256; diff --git a/mysql-test/t/mysqlbinlog_row_compressed.test b/mysql-test/t/mysqlbinlog_row_compressed.test index 3f8c31a088aef..1a7ce093986b0 100644 --- a/mysql-test/t/mysqlbinlog_row_compressed.test +++ b/mysql-test/t/mysqlbinlog_row_compressed.test @@ -32,6 +32,37 @@ FLUSH BINARY LOGS; --replace_regex /\d{6} *\d*:\d\d:\d\d// /Start:.*at startup/Start: xxx/ /SET TIMESTAMP=\d*/SET TIMESTAMP=X/ /exec_time=\d*/exec_time=x/ /mapped to number \d*/mapped to number num/ /CRC32 0x[0-9a-f]+/CRC32 XXX/ --exec $MYSQL_BINLOG --verbose --verbose --base64-output=DECODE-ROWS $datadir/$binlog -DROP TABLE t1,t2; +--echo +--echo Test mysqlbinlog | mysql type point-in-time recovery with compressed events. +--echo + +FLUSH BINARY LOGS; +--let $binlog_file = query_get_value(SHOW MASTER STATUS, File, 1) +CREATE TABLE t3 (a INT PRIMARY KEY, b INT, c VARCHAR(100)); +INSERT INTO t3 VALUES (0, 10, "hello"); +BEGIN; +INSERT INTO t3 VALUES (1, 10, "cat"), (2, 10, "mouse"), (3, 10, "dog"); +INSERT INTO t3 VALUES (4, 10, "goodbye"); +COMMIT; +UPDATE t3 SET b=b+100 where a<>1; +DELETE FROM t3 WHERE a=2; +SET @old_image=@@binlog_row_image; +SET binlog_row_image=minimal; +INSERT INTO t3 VALUES (5, 20, "red"), (6, 30, "green"), (7, 40, "blue"); +INSERT INTO t3 VALUES (8, 20, "rigel"); +UPDATE t3 SET c = concat("colour of ", c) WHERE a > 5; +UPDATE t3 SET b=b*2 WHERE a IN (5,6,7); +DELETE FROM t3 WHERE a=6; +SET binlog_row_image=@old_image; +SELECT * FROM t3 ORDER BY a; +FLUSH LOGS; +DROP TABLE t3; + +--let $MYSQLD_DATADIR= `select @@datadir` +--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$binlog_file | $MYSQL + +SELECT * FROM t3 ORDER BY a; + +DROP TABLE t1,t2,t3; SET GLOBAL log_bin_compress=off; SET GLOBAL log_bin_compress_min_len=256; diff --git a/mysql-test/t/mysqlbinlog_stmt_compressed.test b/mysql-test/t/mysqlbinlog_stmt_compressed.test index 4b22683059b7c..c4331ddf229c9 100644 --- a/mysql-test/t/mysqlbinlog_stmt_compressed.test +++ b/mysql-test/t/mysqlbinlog_stmt_compressed.test @@ -32,6 +32,28 @@ FLUSH BINARY LOGS; --replace_regex /\d{6} *\d*:\d\d:\d\d// /Start:.*at startup/Start: xxx/ /SET TIMESTAMP=\d*/SET TIMESTAMP=X/ /exec_time=\d*/exec_time=x/ /mapped to number \d*/mapped to number num/ /CRC32 0x[0-9a-f]+/CRC32 XXX/ --exec $MYSQL_BINLOG --verbose --verbose --base64-output=DECODE-ROWS $datadir/$binlog -DROP TABLE t1,t2; +--echo +--echo Test mysqlbinlog | mysql type point-in-time recovery with compressed events. +--echo + +FLUSH BINARY LOGS; +--let $binlog_file = query_get_value(SHOW MASTER STATUS, File, 1) +CREATE TABLE t3 (a INT PRIMARY KEY, b INT, c VARCHAR(100)); +INSERT INTO t3 VALUES (0, 10, "hello"); +BEGIN; +INSERT INTO t3 VALUES (1, 10, "cat"), (2, 10, "mouse"), (3, 10, "dog"); +INSERT INTO t3 VALUES (4, 10, "goodbye"); +COMMIT; +DELETE FROM t3 WHERE a=2; +SELECT * FROM t3 ORDER BY a; +FLUSH LOGS; +DROP TABLE t3; + +--let $MYSQLD_DATADIR= `select @@datadir` +--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$binlog_file | $MYSQL + +SELECT * FROM t3 ORDER BY a; + +DROP TABLE t1,t2,t3; SET GLOBAL log_bin_compress=off; SET GLOBAL log_bin_compress_min_len=256; diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc index 94619f14b8bda..d92ac15822f6e 100644 --- a/sql/sql_binlog.cc +++ b/sql/sql_binlog.cc @@ -82,12 +82,6 @@ static int check_event_type(int type, Relay_log_info *rli) case PRE_GA_WRITE_ROWS_EVENT: case PRE_GA_UPDATE_ROWS_EVENT: case PRE_GA_DELETE_ROWS_EVENT: - case WRITE_ROWS_COMPRESSED_EVENT_V1: - case UPDATE_ROWS_COMPRESSED_EVENT_V1: - case DELETE_ROWS_COMPRESSED_EVENT_V1: - case WRITE_ROWS_COMPRESSED_EVENT: - case UPDATE_ROWS_COMPRESSED_EVENT: - case DELETE_ROWS_COMPRESSED_EVENT: /* Row events are only allowed if a Format_description_event has already been seen. From 91511216fcef2254488eeac454e2944387259fb6 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Thu, 3 Nov 2016 19:01:09 +0400 Subject: [PATCH 38/71] Scalability bottleneck in ha_innodb::general_fetch With "WL#6047 - Do not allocate trx id for read-only transactions" m_prebuilt->trx->id is always 0 for read-only transactions. This makes it useless as an index for fuzzy counters. Use server thread id instead similarly to MySQL. --- storage/innobase/handler/ha_innodb.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 73217bdddd95a..08da8c36cd81d 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -10453,10 +10453,10 @@ ha_innobase::index_read( table->status = 0; if (m_prebuilt->table->is_system_db) { srv_stats.n_system_rows_read.add( - (size_t) m_prebuilt->trx->id, 1); + thd_get_thread_id(m_prebuilt->trx->mysql_thd), 1); } else { srv_stats.n_rows_read.add( - (size_t) m_prebuilt->trx->id, 1); + thd_get_thread_id(m_prebuilt->trx->mysql_thd), 1); } break; @@ -10778,10 +10778,10 @@ ha_innobase::general_fetch( table->status = 0; if (m_prebuilt->table->is_system_db) { srv_stats.n_system_rows_read.add( - (size_t) m_prebuilt->trx->id, 1); + thd_get_thread_id(trx->mysql_thd), 1); } else { srv_stats.n_rows_read.add( - (size_t) m_prebuilt->trx->id, 1); + thd_get_thread_id(trx->mysql_thd), 1); } break; case DB_RECORD_NOT_FOUND: From 99d07aa9bd7474f96052dd1adb3d98498554faf1 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 3 Nov 2016 16:56:18 +0100 Subject: [PATCH 39/71] Fixed print format. --- sql/sql_prepare.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index e191dae6f9853..414f5a4f5c223 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -3089,7 +3089,7 @@ void mysqld_stmt_execute(THD *thd, char *packet_arg, uint packet_length) thd->profiling.set_query_source(stmt->query(), stmt->query_length()); #endif DBUG_PRINT("exec_query", ("%s", stmt->query())); - DBUG_PRINT("info",("stmt: 0x%p iterations: %lu", stmt, iterations)); + DBUG_PRINT("info",("stmt: %p iterations: %lu", stmt, iterations)); open_cursor= MY_TEST(flags & (ulong) CURSOR_TYPE_READ_ONLY); From 7afcc7d1a2ec530fe04197d7541ea7060a8e3157 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Thu, 3 Nov 2016 17:32:17 +0100 Subject: [PATCH 40/71] Re-generate .rdiff file in attempt to fix a test failure. The .rdiff applied ok locally with my copy of patch, but failed with "misordered hunks" on a test host. Maybe that host has a more strict version of `patch`. --- .../r/sysvars_server_notembedded,32bit.rdiff | 216 +++++++++--------- 1 file changed, 108 insertions(+), 108 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff index 7ed7f1a7c1009..34ea2e09f3ca6 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff @@ -1,5 +1,5 @@ ---- suite/sys_vars/r/sysvars_server_notembedded.result 2016-10-21 18:47:47.000000000 +0300 -+++ suite/sys_vars/r/sysvars_server_notembedded.reject 2016-10-24 02:02:03.000000000 +0300 +--- suite/sys_vars/r/sysvars_server_notembedded.result 2016-11-03 17:27:47.664855681 +0100 ++++ suite/sys_vars/r/sysvars_server_notembedded.reject 2016-11-03 17:23:05.686196749 +0100 @@ -57,7 +57,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE 1 @@ -296,7 +296,7 @@ VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -1877,7 +1877,7 @@ +@@ -1905,7 +1905,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -305,7 +305,7 @@ VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -1919,7 +1919,7 @@ +@@ -1947,7 +1947,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -314,7 +314,7 @@ VARIABLE_COMMENT Log some not critical warnings to the general log file.Value can be between 0 and 11. Higher values mean more verbosity NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -1975,7 +1975,7 @@ +@@ -2003,7 +2003,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4194304 VARIABLE_SCOPE SESSION @@ -323,7 +323,7 @@ VARIABLE_COMMENT Max packet length to send to or receive from the server NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -1985,14 +1985,14 @@ +@@ -2013,14 +2013,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_BINLOG_CACHE_SIZE SESSION_VALUE NULL @@ -341,7 +341,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2003,7 +2003,7 @@ +@@ -2031,7 +2031,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1073741824 VARIABLE_SCOPE GLOBAL @@ -350,7 +350,7 @@ VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value. NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 1073741824 -@@ -2013,14 +2013,14 @@ +@@ -2041,14 +2041,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MAX_BINLOG_STMT_CACHE_SIZE SESSION_VALUE NULL @@ -368,7 +368,7 @@ NUMERIC_BLOCK_SIZE 4096 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2031,7 +2031,7 @@ +@@ -2059,7 +2059,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 151 VARIABLE_SCOPE GLOBAL @@ -377,7 +377,7 @@ VARIABLE_COMMENT The number of simultaneous clients allowed NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 100000 -@@ -2045,7 +2045,7 @@ +@@ -2073,7 +2073,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -386,7 +386,7 @@ VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2059,7 +2059,7 @@ +@@ -2087,7 +2087,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 20 VARIABLE_SCOPE SESSION @@ -395,7 +395,7 @@ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -2087,7 +2087,7 @@ +@@ -2115,7 +2115,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 64 VARIABLE_SCOPE SESSION @@ -404,7 +404,7 @@ VARIABLE_COMMENT Max number of errors/warnings to store for a statement NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 65535 -@@ -2104,7 +2104,7 @@ +@@ -2132,7 +2132,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Don't allow creation of heap tables bigger than this NUMERIC_MIN_VALUE 16384 @@ -413,7 +413,7 @@ NUMERIC_BLOCK_SIZE 1024 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2115,7 +2115,7 @@ +@@ -2143,7 +2143,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 20 VARIABLE_SCOPE SESSION @@ -422,7 +422,7 @@ VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -2143,7 +2143,7 @@ +@@ -2171,7 +2171,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE SESSION @@ -431,7 +431,7 @@ VARIABLE_COMMENT Max number of bytes in sorted records NUMERIC_MIN_VALUE 4 NUMERIC_MAX_VALUE 8388608 -@@ -2157,7 +2157,7 @@ +@@ -2185,7 +2185,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL @@ -440,7 +440,7 @@ VARIABLE_COMMENT The maximum BLOB length to send to server from mysql_send_long_data API. Deprecated option; use max_allowed_packet instead. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -2171,7 +2171,7 @@ +@@ -2199,7 +2199,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16382 VARIABLE_SCOPE GLOBAL @@ -449,7 +449,7 @@ VARIABLE_COMMENT Maximum number of prepared statements in the server NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2185,7 +2185,7 @@ +@@ -2213,7 +2213,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4294967295 VARIABLE_SCOPE SESSION @@ -458,7 +458,7 @@ VARIABLE_COMMENT Maximum number of iterations when executing recursive queries NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2213,7 +2213,7 @@ +@@ -2241,7 +2241,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4294967295 VARIABLE_SCOPE SESSION @@ -467,7 +467,7 @@ VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2227,7 +2227,7 @@ +@@ -2255,7 +2255,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE SESSION @@ -476,7 +476,7 @@ VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored) NUMERIC_MIN_VALUE 4 NUMERIC_MAX_VALUE 8388608 -@@ -2241,7 +2241,7 @@ +@@ -2269,7 +2269,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -485,7 +485,7 @@ VARIABLE_COMMENT Maximum stored procedure recursion depth NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 255 -@@ -2269,7 +2269,7 @@ +@@ -2297,7 +2297,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32 VARIABLE_SCOPE SESSION @@ -494,7 +494,7 @@ VARIABLE_COMMENT Unused, will be removed. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2297,7 +2297,7 @@ +@@ -2325,7 +2325,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4294967295 VARIABLE_SCOPE GLOBAL @@ -503,7 +503,7 @@ VARIABLE_COMMENT After this many write locks, allow some read locks to run in between NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2311,7 +2311,7 @@ +@@ -2339,7 +2339,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -512,7 +512,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1048576 -@@ -2325,7 +2325,7 @@ +@@ -2353,7 +2353,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8 VARIABLE_SCOPE GLOBAL @@ -521,7 +521,7 @@ VARIABLE_COMMENT Unused NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 1024 -@@ -2339,7 +2339,7 @@ +@@ -2367,7 +2367,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE SESSION @@ -530,7 +530,7 @@ VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -2353,7 +2353,7 @@ +@@ -2381,7 +2381,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 262144 VARIABLE_SCOPE SESSION @@ -539,7 +539,7 @@ VARIABLE_COMMENT Size of buffer to use when using MRR with range access NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -2367,10 +2367,10 @@ +@@ -2395,10 +2395,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 256 VARIABLE_SCOPE SESSION @@ -552,7 +552,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2381,7 +2381,7 @@ +@@ -2409,7 +2409,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -561,7 +561,7 @@ VARIABLE_COMMENT Block size to be used for MyISAM index pages NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 16384 -@@ -2395,7 +2395,7 @@ +@@ -2423,7 +2423,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 6 VARIABLE_SCOPE GLOBAL @@ -570,7 +570,7 @@ VARIABLE_COMMENT Default pointer size to be used for MyISAM tables NUMERIC_MIN_VALUE 2 NUMERIC_MAX_VALUE 7 -@@ -2405,9 +2405,9 @@ +@@ -2433,9 +2433,9 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MYISAM_MAX_SORT_FILE_SIZE SESSION_VALUE NULL @@ -582,7 +582,7 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Don't use the fast sort index method to created index if the temporary file would get bigger than this -@@ -2419,14 +2419,14 @@ +@@ -2447,14 +2447,14 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME MYISAM_MMAP_SIZE SESSION_VALUE NULL @@ -600,7 +600,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY YES -@@ -2451,10 +2451,10 @@ +@@ -2479,10 +2479,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -613,7 +613,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2468,7 +2468,7 @@ +@@ -2496,7 +2496,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE NUMERIC_MIN_VALUE 4096 @@ -622,7 +622,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -2521,7 +2521,7 @@ +@@ -2549,7 +2549,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16384 VARIABLE_SCOPE SESSION @@ -631,7 +631,7 @@ VARIABLE_COMMENT Buffer length for TCP/IP and socket communication NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1048576 -@@ -2535,7 +2535,7 @@ +@@ -2563,7 +2563,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 30 VARIABLE_SCOPE SESSION @@ -640,7 +640,7 @@ VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2549,7 +2549,7 @@ +@@ -2577,7 +2577,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE SESSION @@ -649,7 +649,7 @@ VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -2563,7 +2563,7 @@ +@@ -2591,7 +2591,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 60 VARIABLE_SCOPE SESSION @@ -658,7 +658,7 @@ VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -2633,7 +2633,7 @@ +@@ -2661,7 +2661,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -667,7 +667,7 @@ VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on number of retrieved rows NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1 -@@ -2647,7 +2647,7 @@ +@@ -2675,7 +2675,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 62 VARIABLE_SCOPE SESSION @@ -676,7 +676,7 @@ VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 62 -@@ -2661,7 +2661,7 @@ +@@ -2689,7 +2689,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE SESSION @@ -685,7 +685,7 @@ VARIABLE_COMMENT Controls number of record samples to check condition selectivity NUMERIC_MIN_VALUE 10 NUMERIC_MAX_VALUE 4294967295 -@@ -2689,7 +2689,7 @@ +@@ -2717,7 +2717,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -694,7 +694,7 @@ VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 5 -@@ -2717,7 +2717,7 @@ +@@ -2745,7 +2745,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -703,7 +703,7 @@ VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2731,7 +2731,7 @@ +@@ -2759,7 +2759,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -712,7 +712,7 @@ VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 200 -@@ -2745,7 +2745,7 @@ +@@ -2773,7 +2773,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -721,7 +721,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2759,7 +2759,7 @@ +@@ -2787,7 +2787,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -730,7 +730,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2773,7 +2773,7 @@ +@@ -2801,7 +2801,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -739,7 +739,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2787,7 +2787,7 @@ +@@ -2815,7 +2815,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -748,7 +748,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2801,7 +2801,7 @@ +@@ -2829,7 +2829,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -757,7 +757,7 @@ VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2815,7 +2815,7 @@ +@@ -2843,7 +2843,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -766,7 +766,7 @@ VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1024 -@@ -2829,7 +2829,7 @@ +@@ -2857,7 +2857,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -775,7 +775,7 @@ VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2843,7 +2843,7 @@ +@@ -2871,7 +2871,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 80 VARIABLE_SCOPE GLOBAL @@ -784,7 +784,7 @@ VARIABLE_COMMENT Maximum number of condition instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2857,7 +2857,7 @@ +@@ -2885,7 +2885,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -793,7 +793,7 @@ VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2871,7 +2871,7 @@ +@@ -2899,7 +2899,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1024 VARIABLE_SCOPE GLOBAL @@ -802,7 +802,7 @@ VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2885,7 +2885,7 @@ +@@ -2913,7 +2913,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 50 VARIABLE_SCOPE GLOBAL @@ -811,7 +811,7 @@ VARIABLE_COMMENT Maximum number of file instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2899,7 +2899,7 @@ +@@ -2927,7 +2927,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32768 VARIABLE_SCOPE GLOBAL @@ -820,7 +820,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented files. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -2913,7 +2913,7 @@ +@@ -2941,7 +2941,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -829,7 +829,7 @@ VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -2927,7 +2927,7 @@ +@@ -2955,7 +2955,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 200 VARIABLE_SCOPE GLOBAL @@ -838,7 +838,7 @@ VARIABLE_COMMENT Maximum number of mutex instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2941,7 +2941,7 @@ +@@ -2969,7 +2969,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -847,7 +847,7 @@ VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -2955,7 +2955,7 @@ +@@ -2983,7 +2983,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 40 VARIABLE_SCOPE GLOBAL @@ -856,7 +856,7 @@ VARIABLE_COMMENT Maximum number of rwlock instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2969,7 +2969,7 @@ +@@ -2997,7 +2997,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -865,7 +865,7 @@ VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 104857600 -@@ -2983,7 +2983,7 @@ +@@ -3011,7 +3011,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -874,7 +874,7 @@ VARIABLE_COMMENT Maximum number of socket instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -2997,7 +2997,7 @@ +@@ -3025,7 +3025,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -883,7 +883,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3011,7 +3011,7 @@ +@@ -3039,7 +3039,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 150 VARIABLE_SCOPE GLOBAL @@ -892,7 +892,7 @@ VARIABLE_COMMENT Maximum number of stage instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -3025,7 +3025,7 @@ +@@ -3053,7 +3053,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 185 VARIABLE_SCOPE GLOBAL @@ -901,7 +901,7 @@ VARIABLE_COMMENT Maximum number of statement instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -3039,7 +3039,7 @@ +@@ -3067,7 +3067,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -910,7 +910,7 @@ VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3053,7 +3053,7 @@ +@@ -3081,7 +3081,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -919,7 +919,7 @@ VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3067,7 +3067,7 @@ +@@ -3095,7 +3095,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 50 VARIABLE_SCOPE GLOBAL @@ -928,7 +928,7 @@ VARIABLE_COMMENT Maximum number of thread instruments. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 256 -@@ -3081,7 +3081,7 @@ +@@ -3109,7 +3109,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -937,7 +937,7 @@ VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3095,7 +3095,7 @@ +@@ -3123,7 +3123,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -946,7 +946,7 @@ VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3109,7 +3109,7 @@ +@@ -3137,7 +3137,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -955,7 +955,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1024 -@@ -3123,7 +3123,7 @@ +@@ -3151,7 +3151,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 100 VARIABLE_SCOPE GLOBAL @@ -964,7 +964,7 @@ VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 1048576 -@@ -3137,7 +3137,7 @@ +@@ -3165,7 +3165,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE -1 VARIABLE_SCOPE GLOBAL @@ -973,7 +973,7 @@ VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing. NUMERIC_MIN_VALUE -1 NUMERIC_MAX_VALUE 1048576 -@@ -3207,7 +3207,7 @@ +@@ -3235,7 +3235,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 32768 VARIABLE_SCOPE SESSION @@ -982,7 +982,7 @@ VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -3235,7 +3235,7 @@ +@@ -3263,7 +3263,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 15 VARIABLE_SCOPE SESSION @@ -991,7 +991,7 @@ VARIABLE_COMMENT Limit of query profiling memory NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 100 -@@ -3249,7 +3249,7 @@ +@@ -3277,7 +3277,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 5 VARIABLE_SCOPE SESSION @@ -1000,7 +1000,7 @@ VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3319,7 +3319,7 @@ +@@ -3347,7 +3347,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 16384 VARIABLE_SCOPE SESSION @@ -1009,7 +1009,7 @@ VARIABLE_COMMENT Allocation block size for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -3333,7 +3333,7 @@ +@@ -3361,7 +3361,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1048576 VARIABLE_SCOPE GLOBAL @@ -1018,7 +1018,7 @@ VARIABLE_COMMENT Don't cache results that are bigger than this NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3347,7 +3347,7 @@ +@@ -3375,7 +3375,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE GLOBAL @@ -1027,7 +1027,7 @@ VARIABLE_COMMENT The minimum size for blocks allocated by the query cache NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -3364,7 +3364,7 @@ +@@ -3392,7 +3392,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT The memory allocated to store results from old queries NUMERIC_MIN_VALUE 0 @@ -1036,7 +1036,7 @@ NUMERIC_BLOCK_SIZE 1024 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3417,7 +3417,7 @@ +@@ -3445,7 +3445,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 24576 VARIABLE_SCOPE SESSION @@ -1045,7 +1045,7 @@ VARIABLE_COMMENT Persistent buffer for query parsing and execution NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 4294967295 -@@ -3431,7 +3431,7 @@ +@@ -3459,7 +3459,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE SESSION @@ -1054,7 +1054,7 @@ VARIABLE_COMMENT Allocation block size for storing ranges during optimization NUMERIC_MIN_VALUE 4096 NUMERIC_MAX_VALUE 4294967295 -@@ -3448,7 +3448,7 @@ +@@ -3476,7 +3476,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Maximum speed(KB/s) to read binlog from master (0 = no limit) NUMERIC_MIN_VALUE 0 @@ -1063,7 +1063,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3459,7 +3459,7 @@ +@@ -3487,7 +3487,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 131072 VARIABLE_SCOPE SESSION @@ -1072,7 +1072,7 @@ VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value NUMERIC_MIN_VALUE 8192 NUMERIC_MAX_VALUE 2147483647 -@@ -3487,7 +3487,7 @@ +@@ -3515,7 +3515,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 262144 VARIABLE_SCOPE SESSION @@ -1081,7 +1081,7 @@ VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 2147483647 -@@ -3767,10 +3767,10 @@ +@@ -3795,10 +3795,10 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8388608 VARIABLE_SCOPE SESSION @@ -1094,7 +1094,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -3809,7 +3809,7 @@ +@@ -3837,7 +3837,7 @@ GLOBAL_VALUE_ORIGIN CONFIG DEFAULT_VALUE 1 VARIABLE_SCOPE SESSION @@ -1103,7 +1103,7 @@ VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 4294967295 -@@ -3991,7 +3991,7 @@ +@@ -4019,7 +4019,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -1112,7 +1112,7 @@ VARIABLE_COMMENT Maximum number of parallel threads to use on slave for events in a single replication domain. When using multiple domains, this can be used to limit a single domain from grabbing all threads and thus stalling other domains. The default of 0 means to allow a domain to grab as many threads as it wants, up to the value of slave_parallel_threads. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16383 -@@ -4033,7 +4033,7 @@ +@@ -4061,7 +4061,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 1073741824 VARIABLE_SCOPE GLOBAL @@ -1121,7 +1121,7 @@ VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave. NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 1073741824 -@@ -4061,7 +4061,7 @@ +@@ -4089,7 +4089,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 131072 VARIABLE_SCOPE GLOBAL @@ -1130,7 +1130,7 @@ VARIABLE_COMMENT Limit on how much memory SQL threads should use per parallel replication thread when reading ahead in the relay log looking for opportunities for parallel replication. Only used when --slave-parallel-threads > 0. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 2147483647 -@@ -4089,7 +4089,7 @@ +@@ -4117,7 +4117,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -1139,7 +1139,7 @@ VARIABLE_COMMENT If non-zero, number of threads to spawn to apply in parallel events on the slave that were group-committed on the master or were logged with GTID in different replication domains. Note that these threads are in addition to the IO and SQL threads, which are always created by a replication slave NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16383 -@@ -4103,7 +4103,7 @@ +@@ -4131,7 +4131,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 0 VARIABLE_SCOPE GLOBAL @@ -1148,7 +1148,7 @@ VARIABLE_COMMENT Alias for slave_parallel_threads NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16383 -@@ -4159,7 +4159,7 @@ +@@ -4187,7 +4187,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -1157,7 +1157,7 @@ VARIABLE_COMMENT Number of times the slave SQL thread will retry a transaction in case it failed with a deadlock or elapsed lock wait timeout, before giving up and stopping NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -4187,7 +4187,7 @@ +@@ -4215,7 +4215,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2 VARIABLE_SCOPE GLOBAL @@ -1166,7 +1166,7 @@ VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 31536000 -@@ -4246,7 +4246,7 @@ +@@ -4274,7 +4274,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size NUMERIC_MIN_VALUE 1024 @@ -1175,7 +1175,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -4551,7 +4551,7 @@ +@@ -4579,7 +4579,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 256 VARIABLE_SCOPE GLOBAL @@ -1184,7 +1184,7 @@ VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection. NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 524288 -@@ -4649,7 +4649,7 @@ +@@ -4677,7 +4677,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 400 VARIABLE_SCOPE GLOBAL @@ -1193,7 +1193,7 @@ VARIABLE_COMMENT The number of cached table definitions NUMERIC_MIN_VALUE 400 NUMERIC_MAX_VALUE 524288 -@@ -4663,7 +4663,7 @@ +@@ -4691,7 +4691,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 2000 VARIABLE_SCOPE GLOBAL @@ -1202,7 +1202,7 @@ VARIABLE_COMMENT The number of cached open tables NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 524288 -@@ -4691,7 +4691,7 @@ +@@ -4719,7 +4719,7 @@ GLOBAL_VALUE_ORIGIN AUTO DEFAULT_VALUE 256 VARIABLE_SCOPE GLOBAL @@ -1211,7 +1211,7 @@ VARIABLE_COMMENT How many threads we should keep in a cache for reuse. These are freed after 5 minutes of idle time NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 16384 -@@ -4705,7 +4705,7 @@ +@@ -4733,7 +4733,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 10 VARIABLE_SCOPE GLOBAL @@ -1220,7 +1220,7 @@ VARIABLE_COMMENT Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.This variable has no effect, and is deprecated. It will be removed in a future release. NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 512 -@@ -4918,7 +4918,7 @@ +@@ -4946,7 +4946,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MySQL will automatically convert it to an on-disk MyISAM or Aria table NUMERIC_MIN_VALUE 1024 @@ -1229,7 +1229,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -4929,7 +4929,7 @@ +@@ -4957,7 +4957,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 8192 VARIABLE_SCOPE SESSION @@ -1238,7 +1238,7 @@ VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -4943,7 +4943,7 @@ +@@ -4971,7 +4971,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 4096 VARIABLE_SCOPE SESSION @@ -1247,7 +1247,7 @@ VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log NUMERIC_MIN_VALUE 1024 NUMERIC_MAX_VALUE 134217728 -@@ -5041,7 +5041,7 @@ +@@ -5069,7 +5069,7 @@ GLOBAL_VALUE_ORIGIN COMPILE-TIME DEFAULT_VALUE 28800 VARIABLE_SCOPE SESSION @@ -1256,7 +1256,7 @@ VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it NUMERIC_MIN_VALUE 1 NUMERIC_MAX_VALUE 31536000 -@@ -5145,7 +5145,7 @@ +@@ -5173,7 +5173,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME OPEN_FILES_LIMIT VARIABLE_SCOPE GLOBAL @@ -1265,7 +1265,7 @@ VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors NUMERIC_MIN_VALUE 0 NUMERIC_MAX_VALUE 4294967295 -@@ -5158,7 +5158,7 @@ +@@ -5186,7 +5186,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1274,7 +1274,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -5168,7 +5168,7 @@ +@@ -5196,7 +5196,7 @@ VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes NUMERIC_MIN_VALUE 0 @@ -1283,7 +1283,7 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO -@@ -5253,7 +5253,7 @@ +@@ -5281,7 +5281,7 @@ VARIABLE_NAME LOG_TC_SIZE GLOBAL_VALUE_ORIGIN AUTO VARIABLE_SCOPE GLOBAL From bba224dd53105ca65e0b3ca304e95248363bfa24 Mon Sep 17 00:00:00 2001 From: Rasmus Johansson Date: Thu, 27 Oct 2016 23:24:44 +0300 Subject: [PATCH 41/71] Added server variable compression_default, which if 1/ON sets compression on for all new InnoDB/XtraDB tables by default by setting PAGE_COMPRESSED=1 --- .../r/innodb-page_compression_tables.result | 26 +++++++++++++++++++ .../t/innodb-page_compression_tables.test | 14 ++++++++++ storage/innobase/handler/ha_innodb.cc | 8 +++++- storage/xtradb/handler/ha_innodb.cc | 8 +++++- 4 files changed, 54 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/innodb/r/innodb-page_compression_tables.result b/mysql-test/suite/innodb/r/innodb-page_compression_tables.result index a0ac8986b9ec8..7d825e73aa420 100644 --- a/mysql-test/suite/innodb/r/innodb-page_compression_tables.result +++ b/mysql-test/suite/innodb/r/innodb-page_compression_tables.result @@ -123,5 +123,31 @@ drop procedure innodb_insert_proc; drop table innodb_normal; drop table innodb_compact; drop table innodb_dynamic; +CREATE TABLE no_compression (id INT NOT NULL, name VARCHAR(200)) ENGINE=InnoDB; +SET SESSION innodb_compression_default = 1; +CREATE TABLE default_compression (id INT NOT NULL, name VARCHAR(200)) ENGINE=InnoDB; +CREATE TABLE explicit_no_compression (id INT NOT NULL, name VARCHAR(200)) ENGINE=InnoDB PAGE_COMPRESSED=0; +SHOW CREATE TABLE no_compression; +Table Create Table +no_compression CREATE TABLE `no_compression` ( + `id` int(11) NOT NULL, + `name` varchar(200) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SHOW CREATE TABLE default_compression; +Table Create Table +default_compression CREATE TABLE `default_compression` ( + `id` int(11) NOT NULL, + `name` varchar(200) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`='ON' +SHOW CREATE TABLE explicit_no_compression; +Table Create Table +explicit_no_compression CREATE TABLE `explicit_no_compression` ( + `id` int(11) NOT NULL, + `name` varchar(200) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 `PAGE_COMPRESSED`=0 +DROP TABLE no_compression; +DROP TABLE default_compression; +DROP TABLE explicit_no_compression; +SET SESSION innodb_compression_default = 0; Warnings: Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_tables.test b/mysql-test/suite/innodb/t/innodb-page_compression_tables.test index 41d844d26b4d8..3a241810bbc1e 100644 --- a/mysql-test/suite/innodb/t/innodb-page_compression_tables.test +++ b/mysql-test/suite/innodb/t/innodb-page_compression_tables.test @@ -95,6 +95,20 @@ drop table innodb_normal; drop table innodb_compact; drop table innodb_dynamic; +# MDEV-9820 introducing variable for having page compression turned on by default on InnoDB tables +# test that innodb_compression_default works as expected, i.e. if it has a value of 1 (ON) tables are by default created with page_compressed=1; +CREATE TABLE no_compression (id INT NOT NULL, name VARCHAR(200)) ENGINE=InnoDB; +SET SESSION innodb_compression_default = 1; +CREATE TABLE default_compression (id INT NOT NULL, name VARCHAR(200)) ENGINE=InnoDB; +CREATE TABLE explicit_no_compression (id INT NOT NULL, name VARCHAR(200)) ENGINE=InnoDB PAGE_COMPRESSED=0; +SHOW CREATE TABLE no_compression; +SHOW CREATE TABLE default_compression; +SHOW CREATE TABLE explicit_no_compression; +DROP TABLE no_compression; +DROP TABLE default_compression; +DROP TABLE explicit_no_compression; +SET SESSION innodb_compression_default = 0; + # reset system --disable_query_log EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 30765ddd357a3..9f781c99920ca 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -684,6 +684,11 @@ srv_mbr_debug(const byte* data) static void innodb_remember_check_sysvar_funcs(); mysql_var_check_func check_sysvar_enum; +// should page compression be used by default for new tables +static MYSQL_THDVAR_BOOL(compression_default, PLUGIN_VAR_OPCMDARG, + "Is compression the default for new tables", + NULL, NULL, FALSE); + static MYSQL_THDVAR_UINT(default_encryption_key_id, PLUGIN_VAR_RQCMDARG, "Default encryption key id used for table encryption.", NULL, NULL, @@ -701,7 +706,7 @@ ha_create_table_option innodb_table_option_list[]= { /* With this option user can enable page compression feature for the table */ - HA_TOPTION_BOOL("PAGE_COMPRESSED", page_compressed, 0), + HA_TOPTION_SYSVAR("PAGE_COMPRESSED", page_compressed, compression_default), /* With this option user can set zip compression level for page compression for this table*/ HA_TOPTION_NUMBER("PAGE_COMPRESSION_LEVEL", page_compression_level, 0, 1, 9, 1), @@ -23810,6 +23815,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(fatal_semaphore_wait_threshold), /* Table page compression feature */ MYSQL_SYSVAR(use_trim), + MYSQL_SYSVAR(compression_default), MYSQL_SYSVAR(compression_algorithm), MYSQL_SYSVAR(mtflush_threads), MYSQL_SYSVAR(use_mtflush), diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 900d520d24280..bd02e97b73977 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -620,6 +620,11 @@ ib_cb_t innodb_api_cb[] = { static void innodb_remember_check_sysvar_funcs(); mysql_var_check_func check_sysvar_enum; +// should page compression be used by default for new tables +static MYSQL_THDVAR_BOOL(compression_default, PLUGIN_VAR_OPCMDARG, + "Is compression the default for new tables", + NULL, NULL, FALSE); + static MYSQL_THDVAR_UINT(default_encryption_key_id, PLUGIN_VAR_RQCMDARG, "Default encryption key id used for table encryption.", NULL, NULL, @@ -637,7 +642,7 @@ ha_create_table_option innodb_table_option_list[]= { /* With this option user can enable page compression feature for the table */ - HA_TOPTION_BOOL("PAGE_COMPRESSED", page_compressed, 0), + HA_TOPTION_BOOL("PAGE_COMPRESSED", page_compressed, compression_default), /* With this option user can set zip compression level for page compression for this table*/ HA_TOPTION_NUMBER("PAGE_COMPRESSION_LEVEL", page_compression_level, 0, 1, 9, 1), @@ -21433,6 +21438,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(fatal_semaphore_wait_threshold), /* Table page compression feature */ MYSQL_SYSVAR(use_trim), + MYSQL_SYSVAR(compression_default), MYSQL_SYSVAR(compression_algorithm), MYSQL_SYSVAR(mtflush_threads), MYSQL_SYSVAR(use_mtflush), From 72c9de13fd569116fb3306237387e5eddc151bad Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Mon, 7 Nov 2016 01:52:07 +0300 Subject: [PATCH 42/71] MDEV-10986 sphinx.union-5539 and sphinx.sphinx fail in buildbot and outside Do not include the suite into the default list until the tests are stable --- storage/sphinx/mysql-test/sphinx/suite.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/sphinx/mysql-test/sphinx/suite.pm b/storage/sphinx/mysql-test/sphinx/suite.pm index e4c3c1b9f74e6..06680cc087f8b 100644 --- a/storage/sphinx/mysql-test/sphinx/suite.pm +++ b/storage/sphinx/mysql-test/sphinx/suite.pm @@ -114,7 +114,7 @@ sub servers { ) } -sub is_default { 1 } +sub is_default { 0 } ############# return an object ###################### bless { }; From f5719fcf8cbaf81fcde12dd6261bb0144803c5b1 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Mon, 7 Nov 2016 03:20:04 +0300 Subject: [PATCH 43/71] Temporarily disable innodb.innodb_trx_weight test due to MDEV-11185 --- mysql-test/suite/innodb/disabled.def | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/innodb/disabled.def b/mysql-test/suite/innodb/disabled.def index 1580474de2944..b0e8f58c761fa 100644 --- a/mysql-test/suite/innodb/disabled.def +++ b/mysql-test/suite/innodb/disabled.def @@ -10,4 +10,5 @@ # ############################################################################## -innodb_defragment_fill_factor : MDEV-10771 \ No newline at end of file +innodb_defragment_fill_factor : MDEV-10771 +nnodb.innodb_trx_weight : MDEV-11185 From 458648e5daf736efea8d5228cfff555f30f0e793 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Mon, 7 Nov 2016 13:27:33 +0400 Subject: [PATCH 44/71] Fixed test suite name --- mysql-test/suite/innodb/disabled.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/suite/innodb/disabled.def b/mysql-test/suite/innodb/disabled.def index b0e8f58c761fa..09545bafefcd9 100644 --- a/mysql-test/suite/innodb/disabled.def +++ b/mysql-test/suite/innodb/disabled.def @@ -11,4 +11,4 @@ ############################################################################## innodb_defragment_fill_factor : MDEV-10771 -nnodb.innodb_trx_weight : MDEV-11185 +innodb.innodb_trx_weight : MDEV-11185 From 7c38a94435976e9f311e9b84953ffbb3a9139807 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Wed, 28 Sep 2016 13:23:31 -0400 Subject: [PATCH 45/71] MDEV-10041: Server crashes sporadically during bootstrap while running wsrep tests The crash is caused due to a race condition where wsrep startup threads invoke ha_maria::implicit_commit() method while maria_hton is partially initialized. The fix is to skip this method if plugins are uninitialized. --- storage/maria/ha_maria.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 844e862793964..fc8a39119e3c6 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -2839,9 +2839,10 @@ int ha_maria::implicit_commit(THD *thd, bool new_trn) int error; uint locked_tables; DYNAMIC_ARRAY used_tables; + extern my_bool plugins_are_initialized; DBUG_ENTER("ha_maria::implicit_commit"); - if (!maria_hton || !(trn= THD_TRN)) + if (!maria_hton || !plugins_are_initialized || !(trn= THD_TRN)) DBUG_RETURN(0); if (!new_trn && (thd->locked_tables_mode == LTM_LOCK_TABLES || thd->locked_tables_mode == LTM_PRELOCKED_UNDER_LOCK_TABLES)) From 6bb6f30ff9447c880ef90c4194b0fe0deca87ac6 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Wed, 28 Sep 2016 13:26:13 -0400 Subject: [PATCH 46/71] MDEV-9312: storage engine not enforced during galera cluster replication Perform a post initialization of plugin-related variables of wsrep threads after their global counterparts have been initialized. --- .../galera/r/enforce_storage_engine2.result | 24 ++++++ .../galera/t/enforce_storage_engine2.opt | 2 + .../galera/t/enforce_storage_engine2.test | 20 +++++ sql/mysqld.cc | 15 ++++ sql/sql_plugin.cc | 86 +++++++++++++------ sql/sql_plugin.h | 7 ++ sql/wsrep_mysqld.cc | 9 +- 7 files changed, 137 insertions(+), 26 deletions(-) create mode 100644 mysql-test/suite/galera/r/enforce_storage_engine2.result create mode 100644 mysql-test/suite/galera/t/enforce_storage_engine2.opt create mode 100644 mysql-test/suite/galera/t/enforce_storage_engine2.test diff --git a/mysql-test/suite/galera/r/enforce_storage_engine2.result b/mysql-test/suite/galera/r/enforce_storage_engine2.result new file mode 100644 index 0000000000000..053c37d6854ae --- /dev/null +++ b/mysql-test/suite/galera/r/enforce_storage_engine2.result @@ -0,0 +1,24 @@ +# +# MDEV-9312: storage engine not enforced during galera cluster +# replication +# +CREATE TABLE t1(i INT) ENGINE=INNODB; +CREATE TABLE t2(i INT) ENGINE=MYISAM; +Warnings: +Note 1266 Using storage engine InnoDB for table 't2' +SHOW TABLES; +Tables_in_test +t1 +t2 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `i` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +DROP TABLE t1, t2; +# End of tests diff --git a/mysql-test/suite/galera/t/enforce_storage_engine2.opt b/mysql-test/suite/galera/t/enforce_storage_engine2.opt new file mode 100644 index 0000000000000..03f7dc5e527c6 --- /dev/null +++ b/mysql-test/suite/galera/t/enforce_storage_engine2.opt @@ -0,0 +1,2 @@ +--enforce_storage_engine=innodb --sql_mode='' + diff --git a/mysql-test/suite/galera/t/enforce_storage_engine2.test b/mysql-test/suite/galera/t/enforce_storage_engine2.test new file mode 100644 index 0000000000000..7a822bced595f --- /dev/null +++ b/mysql-test/suite/galera/t/enforce_storage_engine2.test @@ -0,0 +1,20 @@ +--source include/galera_cluster.inc +--source include/have_innodb.inc + +--echo # +--echo # MDEV-9312: storage engine not enforced during galera cluster +--echo # replication +--echo # +--connection node_1 +CREATE TABLE t1(i INT) ENGINE=INNODB; +CREATE TABLE t2(i INT) ENGINE=MYISAM; + +--connection node_2 +SHOW TABLES; +SHOW CREATE TABLE t1; +SHOW CREATE TABLE t2; + +# Cleanup +DROP TABLE t1, t2; + +--echo # End of tests diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 8881e0423f5da..f0ed94b7790e3 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5171,6 +5171,12 @@ static int init_server_components() opt_bin_logname= my_once_strdup(buf, MYF(MY_WME)); } + /* + Since some wsrep threads (THDs) are create before plugins are + initialized, LOCK_plugin mutex needs to be initialized here. + */ + plugin_mutex_init(); + /* Wsrep initialization must happen at this point, because: - opt_bin_logname must be known when starting replication @@ -5412,6 +5418,15 @@ static int init_server_components() #endif #ifdef WITH_WSREP + /* + Now is the right time to initialize members of wsrep startup threads + that rely on plugins and other related global system variables to be + initialized. This initialization was not possible before, as plugins + (and thus some global system variables) are initialized after wsrep + startup threads are created. + */ + wsrep_plugins_post_init(); + if (WSREP_ON && !opt_bin_log) { wsrep_emulate_bin_log= 1; diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index ce46a76d10300..ed7a53904348c 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1555,9 +1555,6 @@ int plugin_init(int *argc, char **argv, int flags) get_bookmark_hash_key, NULL, HASH_UNIQUE)) goto err; - - mysql_mutex_init(key_LOCK_plugin, &LOCK_plugin, MY_MUTEX_INIT_FAST); - /* The 80 is from 2016-04-27 when we had 71 default plugins Big enough to avoid many mallocs even in future @@ -3138,28 +3135,19 @@ void plugin_thdvar_init(THD *thd) thd->variables.dynamic_variables_size= 0; thd->variables.dynamic_variables_ptr= 0; - if (IF_WSREP((!WSREP(thd) || !thd->wsrep_applier),1)) - { - mysql_mutex_lock(&LOCK_plugin); - thd->variables.table_plugin= - intern_plugin_lock(NULL, global_system_variables.table_plugin); - if (global_system_variables.tmp_table_plugin) - thd->variables.tmp_table_plugin= - intern_plugin_lock(NULL, global_system_variables.tmp_table_plugin); - if (global_system_variables.enforced_table_plugin) - thd->variables.enforced_table_plugin= - intern_plugin_lock(NULL, global_system_variables.enforced_table_plugin); - intern_plugin_unlock(NULL, old_table_plugin); - intern_plugin_unlock(NULL, old_tmp_table_plugin); - intern_plugin_unlock(NULL, old_enforced_table_plugin); - mysql_mutex_unlock(&LOCK_plugin); - } - else - { - thd->variables.table_plugin= NULL; - thd->variables.tmp_table_plugin= NULL; - thd->variables.enforced_table_plugin= NULL; - } + mysql_mutex_lock(&LOCK_plugin); + thd->variables.table_plugin= + intern_plugin_lock(NULL, global_system_variables.table_plugin); + if (global_system_variables.tmp_table_plugin) + thd->variables.tmp_table_plugin= + intern_plugin_lock(NULL, global_system_variables.tmp_table_plugin); + if (global_system_variables.enforced_table_plugin) + thd->variables.enforced_table_plugin= + intern_plugin_lock(NULL, global_system_variables.enforced_table_plugin); + intern_plugin_unlock(NULL, old_table_plugin); + intern_plugin_unlock(NULL, old_tmp_table_plugin); + intern_plugin_unlock(NULL, old_enforced_table_plugin); + mysql_mutex_unlock(&LOCK_plugin); DBUG_VOID_RETURN; } @@ -4298,3 +4286,51 @@ int thd_setspecific(MYSQL_THD thd, MYSQL_THD_KEY_T key, void *value) return 0; } +void plugin_mutex_init() +{ + mysql_mutex_init(key_LOCK_plugin, &LOCK_plugin, MY_MUTEX_INIT_FAST); +} + +#ifdef WITH_WSREP + +/* + Placeholder for global_system_variables.table_plugin required during + initialization of startup wsrep threads. +*/ +static st_plugin_int wsrep_dummy_plugin; +static st_plugin_int *wsrep_dummy_plugin_ptr; + +/* + Initialize wsrep_dummy_plugin and assign it to + global_system_variables.table_plugin. +*/ +void wsrep_plugins_pre_init() +{ + wsrep_dummy_plugin_ptr= &wsrep_dummy_plugin; + wsrep_dummy_plugin.state= PLUGIN_IS_DISABLED; + global_system_variables.table_plugin= + plugin_int_to_ref(wsrep_dummy_plugin_ptr); +} + +/* + This function is intended to be called after the plugins and related + global system variables are initialized. It re-initializes some data + members of wsrep startup threads with correct values, as these value + were not available at the time these threads were created. +*/ +void wsrep_plugins_post_init() +{ + THD *thd; + I_List_iterator it(threads); + + while ((thd= it++)) + { + if (IF_WSREP(thd->wsrep_applier,1)) + { + plugin_thdvar_init(thd); + } + } + + return; +} +#endif /* WITH_WSREP */ diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h index 317ccf482b618..9a0acea1d18bd 100644 --- a/sql/sql_plugin.h +++ b/sql/sql_plugin.h @@ -182,6 +182,7 @@ sys_var *find_plugin_sysvar(st_plugin_int *plugin, st_mysql_sys_var *var); void plugin_opt_set_limits(struct my_option *, const struct st_mysql_sys_var *); extern SHOW_COMP_OPTION plugin_status(const char *name, size_t len, int type); extern bool check_valid_path(const char *path, size_t length); +extern void plugin_mutex_init(); typedef my_bool (plugin_foreach_func)(THD *thd, plugin_ref plugin, @@ -199,3 +200,9 @@ sys_var *find_sys_var_ex(THD *thd, const char *str, size_t length, extern void sync_dynamic_session_variables(THD* thd, bool global_lock); #endif + +#ifdef WITH_WSREP +extern void wsrep_plugins_pre_init(); +extern void wsrep_plugins_post_init(); +#endif /* WITH_WSREP */ + diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index b8fae8dbd860d..7e6f9bbce6df6 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -36,6 +36,7 @@ #include #include "log_event.h" #include +#include "sql_plugin.h" /* wsrep_plugins_pre_init() */ wsrep_t *wsrep = NULL; /* @@ -792,7 +793,6 @@ void wsrep_thr_init() DBUG_VOID_RETURN; } - void wsrep_init_startup (bool first) { if (wsrep_init()) unireg_abort(1); @@ -803,6 +803,13 @@ void wsrep_init_startup (bool first) wsrep_debug, wsrep_convert_LOCK_to_trx, (wsrep_on_fun)wsrep_on); + /* + Pre-initialize global_system_variables.table_plugin with a dummy engine + (placeholder) required during the initialization of wsrep threads (THDs). + (see: plugin_thdvar_init()) + */ + wsrep_plugins_pre_init(); + /* Skip replication start if dummy wsrep provider is loaded */ if (!strcmp(wsrep_provider, WSREP_NONE)) return; From 7241258c1f6812d66adfb729e28734c90d0925ef Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Wed, 28 Sep 2016 13:27:34 -0400 Subject: [PATCH 47/71] MDEV-9416: MariaDB galera got signal 11 when altering table add unique index When a BF thread attempts to abort a victim thread's transaction, the victim thread is not locked and thus its not safe to rely on its data structures like htons registered for the trx. So, instead of getting the registered htons from victim, innodb's hton can be looked up directly from installed_htons[] and used to abort the transaction. (Same technique is used in older versions) --- sql/handler.cc | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index d7481f8e8ea70..ede0bfad5ce16 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -6103,6 +6103,13 @@ void handler::set_lock_type(enum thr_lock_type lock) @note Aborting the transaction does NOT end it, it still has to be rolled back with hton->rollback(). + @note It is safe to abort from one thread (bf_thd) the transaction, + running in another thread (victim_thd), because InnoDB's lock_sys and + trx_mutex guarantee the necessary protection. However, its not safe + to access victim_thd->transaction, because it's not protected from + concurrent accesses. And it's an overkill to take LOCK_plugin and + iterate the whole installed_htons[] array every time. + @param bf_thd brute force THD asking for the abort @param victim_thd victim THD to be aborted @@ -6119,29 +6126,16 @@ int ha_abort_transaction(THD *bf_thd, THD *victim_thd, my_bool signal) DBUG_RETURN(0); } - /* Try statement transaction if standard one is not set. */ - THD_TRANS *trans= (victim_thd->transaction.all.ha_list) ? - &victim_thd->transaction.all : &victim_thd->transaction.stmt; - - Ha_trx_info *ha_info= trans->ha_list, *ha_info_next; - - for (; ha_info; ha_info= ha_info_next) + handlerton *hton= installed_htons[DB_TYPE_INNODB]; + if (hton && hton->abort_transaction) { - handlerton *hton= ha_info->ht(); - if (!hton->abort_transaction) - { - /* Skip warning for binlog & wsrep. */ - if (hton->db_type != DB_TYPE_BINLOG && hton != wsrep_hton) - { - WSREP_WARN("Cannot abort transaction."); - } - } - else - { - hton->abort_transaction(hton, bf_thd, victim_thd, signal); - } - ha_info_next= ha_info->next(); + hton->abort_transaction(hton, bf_thd, victim_thd, signal); } + else + { + WSREP_WARN("Cannot abort InnoDB transaction"); + } + DBUG_RETURN(0); } From 9d89c182bc1f50ffcf4136320786a27b0027da20 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Thu, 29 Sep 2016 14:58:32 -0400 Subject: [PATCH 48/71] MDEV-9312: storage engine not enforced during galera cluster replication Postfix: The pre-initialization of wsrep threads is not needed for mysqldump sst method. --- sql/mysqld.cc | 4 +++- sql/wsrep_mysqld.cc | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index f0ed94b7790e3..1dd49d44b6291 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5424,8 +5424,10 @@ static int init_server_components() initialized. This initialization was not possible before, as plugins (and thus some global system variables) are initialized after wsrep startup threads are created. + Note: This only needs to be done for rsync, xtrabackup based SST methods. */ - wsrep_plugins_post_init(); + if (wsrep_before_SE()) + wsrep_plugins_post_init(); if (WSREP_ON && !opt_bin_log) { diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 7e6f9bbce6df6..01fb6d5e2c514 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -807,8 +807,12 @@ void wsrep_init_startup (bool first) Pre-initialize global_system_variables.table_plugin with a dummy engine (placeholder) required during the initialization of wsrep threads (THDs). (see: plugin_thdvar_init()) + Note: This only needs to be done for rsync & xtrabackup based SST methods. + In case of mysqldump SST method, the wsrep threads are created after the + server plugins & global system variables are initialized. */ - wsrep_plugins_pre_init(); + if (wsrep_before_SE()) + wsrep_plugins_pre_init(); /* Skip replication start if dummy wsrep provider is loaded */ if (!strcmp(wsrep_provider, WSREP_NONE)) return; From 9ddbf2c361d4e5638fb1cbaea8324308ef4c227b Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Mon, 3 Oct 2016 12:02:46 -0400 Subject: [PATCH 49/71] MDEV-10944: GALERA log-slave-updates FAIL after upgrading from 10.1.17 to 10.1.18 thd->variables.option_bits need to be restored after plugin_thdvar_init() during post initialization of wsrep threads. --- sql/sql_plugin.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index ed7a53904348c..2fd0ea341f4c5 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -4327,7 +4327,13 @@ void wsrep_plugins_post_init() { if (IF_WSREP(thd->wsrep_applier,1)) { + // Save options_bits as it will get overwritten in plugin_thdvar_init() + ulonglong option_bits_saved= thd->variables.option_bits; + plugin_thdvar_init(thd); + + // Restore option_bits + thd->variables.option_bits= option_bits_saved; } } From d5e6d8379d0bbcac07595b42c9f36eb9838fadf0 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Mon, 3 Oct 2016 17:03:02 -0400 Subject: [PATCH 50/71] Update test results in galera, galera_3nodes suites. --- mysql-test/suite/galera/r/GAL-382.result | 1 + mysql-test/suite/galera/r/MW-252.result | 3 +++ mysql-test/suite/galera/r/MW-44.result | 4 ++++ .../suite/galera/r/enforce_storage_engine2.result | 2 ++ .../suite/galera/r/galera_as_slave_autoinc.result | 8 ++++++++ mysql-test/suite/galera/r/galera_kill_ddl.result | 3 --- mysql-test/suite/galera/r/galera_pc_ignore_sb.result | 2 ++ .../suite/galera/r/galera_restart_nochanges.result | 3 +++ mysql-test/suite/galera/r/galera_roles.result | 2 ++ mysql-test/suite/galera/r/galera_split_brain.result | 6 ++++-- mysql-test/suite/galera/r/galera_var_desync_on.result | 1 + .../suite/galera/r/galera_var_dirty_reads.result | 2 ++ mysql-test/suite/galera/r/mdev_10518.result | 9 +++++++++ mysql-test/suite/galera/r/mysql-wsrep#31.result | 5 +++++ .../galera_3nodes/r/galera_certification_ccc.result | 11 +++++++++++ .../r/galera_certification_double_failure.result | 4 ++++ .../r/galera_parallel_apply_3nodes.result | 6 ++++++ 17 files changed, 67 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/galera/r/GAL-382.result b/mysql-test/suite/galera/r/GAL-382.result index 0c7365f3005bb..fb7c229bd5676 100644 --- a/mysql-test/suite/galera/r/GAL-382.result +++ b/mysql-test/suite/galera/r/GAL-382.result @@ -1,3 +1,4 @@ +connection node_1; create table t1 (i int, j int, k int, primary key pk(i)) engine=innodb; insert into t1 values (1, 1, 1), (2, 2, 2), (3, 3, 3); create table t2 (i int, j int, k int, primary key pk(i, j, k), index idx(i, k, j)) engine=innodb; diff --git a/mysql-test/suite/galera/r/MW-252.result b/mysql-test/suite/galera/r/MW-252.result index c422edcb82a77..795d3fff67073 100644 --- a/mysql-test/suite/galera/r/MW-252.result +++ b/mysql-test/suite/galera/r/MW-252.result @@ -1,7 +1,10 @@ +connection node_1; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; FLUSH TABLES WITH READ LOCK; SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 1 +connection node_2; +connection node_1; UNLOCK TABLES; DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/MW-44.result b/mysql-test/suite/galera/r/MW-44.result index 28a6f1ac8dd23..c007779bc7961 100644 --- a/mysql-test/suite/galera/r/MW-44.result +++ b/mysql-test/suite/galera/r/MW-44.result @@ -1,5 +1,8 @@ +connection node_1; TRUNCATE TABLE mysql.general_log; +connection node_2; TRUNCATE TABLE mysql.general_log; +connection node_1; SET SESSION wsrep_osu_method=TOI; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; SET SESSION wsrep_osu_method=RSU; @@ -8,6 +11,7 @@ SET SESSION wsrep_osu_method=TOI; SELECT COUNT(*) = 2 FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%'; COUNT(*) = 2 1 +connection node_2; SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument NOT LIKE 'SELECT%'; COUNT(*) = 0 1 diff --git a/mysql-test/suite/galera/r/enforce_storage_engine2.result b/mysql-test/suite/galera/r/enforce_storage_engine2.result index 053c37d6854ae..128994ed221bb 100644 --- a/mysql-test/suite/galera/r/enforce_storage_engine2.result +++ b/mysql-test/suite/galera/r/enforce_storage_engine2.result @@ -2,10 +2,12 @@ # MDEV-9312: storage engine not enforced during galera cluster # replication # +connection node_1; CREATE TABLE t1(i INT) ENGINE=INNODB; CREATE TABLE t2(i INT) ENGINE=MYISAM; Warnings: Note 1266 Using storage engine InnoDB for table 't2' +connection node_2; SHOW TABLES; Tables_in_test t1 diff --git a/mysql-test/suite/galera/r/galera_as_slave_autoinc.result b/mysql-test/suite/galera/r/galera_as_slave_autoinc.result index b6314b862c2d2..ac01ea100a0e0 100644 --- a/mysql-test/suite/galera/r/galera_as_slave_autoinc.result +++ b/mysql-test/suite/galera/r/galera_as_slave_autoinc.result @@ -1,4 +1,7 @@ +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2; START SLAVE; +connection node_1; SET SESSION binlog_format='STATEMENT'; CREATE TABLE t1 ( i int(11) NOT NULL AUTO_INCREMENT, @@ -40,6 +43,7 @@ Variable_name Value auto_increment_increment 7 auto_increment_offset 5 wsrep_auto_increment_control ON +connection node_2; select * from t1; i c 1 dummy_text @@ -58,6 +62,7 @@ binlog_format ROW show variables like 'auto_increment_increment'; Variable_name Value auto_increment_increment 2 +connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; select * from t1; i c 1 dummy_text @@ -76,7 +81,10 @@ binlog_format ROW show variables like 'auto_increment_increment'; Variable_name Value auto_increment_increment 2 +connection node_1; DROP TABLE t1; +connection node_2; STOP SLAVE; RESET SLAVE ALL; +connection node_1; RESET MASTER; diff --git a/mysql-test/suite/galera/r/galera_kill_ddl.result b/mysql-test/suite/galera/r/galera_kill_ddl.result index 9b15aaeb0af6b..aac316dffe396 100644 --- a/mysql-test/suite/galera/r/galera_kill_ddl.result +++ b/mysql-test/suite/galera/r/galera_kill_ddl.result @@ -11,7 +11,4 @@ SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1'; COUNT(*) = 2 1 connection node_1; -SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -VARIABLE_VALUE = 2 -1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_pc_ignore_sb.result b/mysql-test/suite/galera/r/galera_pc_ignore_sb.result index e02ec0a317961..ee79d3c1f006c 100644 --- a/mysql-test/suite/galera/r/galera_pc_ignore_sb.result +++ b/mysql-test/suite/galera/r/galera_pc_ignore_sb.result @@ -16,3 +16,5 @@ VARIABLE_VALUE = 'ON' 1 SET GLOBAL wsrep_cluster_address = ''; connection node_2; +disconnect node_2; +disconnect node_1; diff --git a/mysql-test/suite/galera/r/galera_restart_nochanges.result b/mysql-test/suite/galera/r/galera_restart_nochanges.result index 380a4812da1c0..b35ae50e2fbb9 100644 --- a/mysql-test/suite/galera/r/galera_restart_nochanges.result +++ b/mysql-test/suite/galera/r/galera_restart_nochanges.result @@ -4,6 +4,7 @@ connection node_1; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); connection node_2; +connection node_1; connection node_2a; SELECT COUNT(*) = 1 FROM t1; COUNT(*) = 1 @@ -12,3 +13,5 @@ SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_N VARIABLE_VALUE = 2 1 DROP TABLE t1; +disconnect node_2; +disconnect node_1; diff --git a/mysql-test/suite/galera/r/galera_roles.result b/mysql-test/suite/galera/r/galera_roles.result index f07cd81c03fbb..bef89acfc923c 100644 --- a/mysql-test/suite/galera/r/galera_roles.result +++ b/mysql-test/suite/galera/r/galera_roles.result @@ -171,6 +171,7 @@ DROP DATABASE test1; # # On node_1 +connection node_1; CREATE USER foo@localhost; CREATE ROLE role1; CREATE ROLE role2 WITH ADMIN CURRENT_USER; @@ -189,6 +190,7 @@ root@localhost role1 YES NO root@localhost role2 YES NO # On node_2 +connection node_2; SELECT * FROM mysql.roles_mapping; Host User Role Admin_option role1 role4 Y diff --git a/mysql-test/suite/galera/r/galera_split_brain.result b/mysql-test/suite/galera/r/galera_split_brain.result index 9c5952cfa288e..e770f15d63061 100644 --- a/mysql-test/suite/galera/r/galera_split_brain.result +++ b/mysql-test/suite/galera/r/galera_split_brain.result @@ -1,7 +1,7 @@ -call mtr.add_suppression("WSREP: TO isolation failed for: "); -connection node_1; connection node_1; connection node_2; +call mtr.add_suppression("WSREP: TO isolation failed for: "); +connection node_1; connection node_2; Killing server ... connection node_1; @@ -9,3 +9,5 @@ CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction SET GLOBAL wsrep_cluster_address = ''; connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +disconnect node_2; +disconnect node_1; diff --git a/mysql-test/suite/galera/r/galera_var_desync_on.result b/mysql-test/suite/galera/r/galera_var_desync_on.result index 54c30370c4a05..a26acbd4d6b0b 100644 --- a/mysql-test/suite/galera/r/galera_var_desync_on.result +++ b/mysql-test/suite/galera/r/galera_var_desync_on.result @@ -33,4 +33,5 @@ COUNT(*) = 11 1 CALL mtr.add_suppression("Protocol violation"); DROP TABLE t1; +connection node_1; CALL mtr.add_suppression("Protocol violation"); diff --git a/mysql-test/suite/galera/r/galera_var_dirty_reads.result b/mysql-test/suite/galera/r/galera_var_dirty_reads.result index 6b3a3ec0eb5a0..e596e0f8caeab 100644 --- a/mysql-test/suite/galera/r/galera_var_dirty_reads.result +++ b/mysql-test/suite/galera/r/galera_var_dirty_reads.result @@ -1,3 +1,5 @@ +connection node_1; +connection node_2; connection node_2; CREATE TABLE t1(i INT) ENGINE=INNODB; INSERT INTO t1 VALUES(1); diff --git a/mysql-test/suite/galera/r/mdev_10518.result b/mysql-test/suite/galera/r/mdev_10518.result index b2a3e0a65efd0..4ccd5fd1d2306 100644 --- a/mysql-test/suite/galera/r/mdev_10518.result +++ b/mysql-test/suite/galera/r/mdev_10518.result @@ -1,4 +1,5 @@ # On node_1 +connection node_1; list of GTID variables : gtid_domain_id 1 gtid_binlog_pos @@ -8,6 +9,7 @@ gtid_slave_pos wsrep_gtid_domain_id 4294967295 wsrep_gtid_mode 1 # On node_2 +connection node_2; list of GTID variables : gtid_domain_id 2 gtid_binlog_pos @@ -17,6 +19,7 @@ gtid_slave_pos wsrep_gtid_domain_id 4294967295 wsrep_gtid_mode 1 # On node_1 +connection node_1; CREATE TABLE t1(i INT) ENGINE=INNODB; CREATE TABLE t2(i INT) ENGINE=MEMORY; INSERT INTO t1 VALUES(1); @@ -34,6 +37,7 @@ gtid_slave_pos wsrep_gtid_domain_id 4294967295 wsrep_gtid_mode 1 # On node_2 +connection node_2; SELECT * FROM t1; i 1 @@ -46,6 +50,7 @@ gtid_slave_pos wsrep_gtid_domain_id 4294967295 wsrep_gtid_mode 1 # On node_1 +connection node_1; INSERT INTO t2 VALUES(1); SELECT * FROM t2; i @@ -59,6 +64,7 @@ gtid_slave_pos wsrep_gtid_domain_id 4294967295 wsrep_gtid_mode 1 # On node_2 +connection node_2; SELECT * FROM t2; i list of GTID variables : @@ -70,5 +76,8 @@ gtid_slave_pos wsrep_gtid_domain_id 4294967295 wsrep_gtid_mode 1 # On node_1 +connection node_1; DROP TABLE t1, t2; +disconnect node_2; +disconnect node_1; # End of test diff --git a/mysql-test/suite/galera/r/mysql-wsrep#31.result b/mysql-test/suite/galera/r/mysql-wsrep#31.result index 973f11543fae5..1092f4ddb0c00 100644 --- a/mysql-test/suite/galera/r/mysql-wsrep#31.result +++ b/mysql-test/suite/galera/r/mysql-wsrep#31.result @@ -1,4 +1,6 @@ connection node_1; +connection node_2; +connection node_1; CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; INSERT INTO t1 VALUES('test'); CREATE DATABASE db; @@ -11,3 +13,6 @@ Using --wsrep-start-position when starting mysqld ... connection node_1; DROP TABLE t1; DROP DATABASE db; +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +disconnect node_2; +disconnect node_1; diff --git a/mysql-test/suite/galera_3nodes/r/galera_certification_ccc.result b/mysql-test/suite/galera_3nodes/r/galera_certification_ccc.result index 96a2bec0d7ffe..b1bbb1406a1e2 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_certification_ccc.result +++ b/mysql-test/suite/galera_3nodes/r/galera_certification_ccc.result @@ -1,3 +1,7 @@ +connection node_1; +connection node_2; +connection node_3; +connection node_1; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; @@ -5,13 +9,20 @@ INSERT INTO t1 VALUES (1); SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 3 1 +connection node_3; SET GLOBAL wsrep_cluster_address = ''; +connection node_1; INSERT INTO t1 VALUES (2); SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 1 COMMIT; +connection node_2; SELECT COUNT(*) = 2 FROM t1; COUNT(*) = 2 1 +connection node_3; +connection node_1; DROP TABLE t1; +disconnect node_2; +disconnect node_1; diff --git a/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result b/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result index 9dc735d5d3d65..c2fdfc38dd5ac 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result +++ b/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result @@ -1,11 +1,15 @@ +connection node_1; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES (1); INSERT INTO t2 VALUES (1); +connection node_2; INSERT INTO t1 VALUES (1); +connection node_3; INSERT INTO t2 VALUES (1); +connection node_1; COMMIT; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction DROP TABLE t1; diff --git a/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result b/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result index ec97d392c0f13..4f9951c382f02 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result +++ b/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result @@ -1,8 +1,14 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); +connection node_3; SET GLOBAL wsrep_slave_threads = 2; +connection node_1; UPDATE t1 SET f1 = f1 + 10;; +connection node_2; UPDATE t1 SET f1 = f1 + 100;; +connection node_1; +connection node_2; +connection node_3; SELECT f1 = 111 FROM t1; f1 = 111 1 From db95beb365bde1d487a23de95eab118a3eb0e5ef Mon Sep 17 00:00:00 2001 From: Francisco Biete Date: Mon, 3 Oct 2016 11:30:12 +0100 Subject: [PATCH 51/71] MDEV-9903 - 10.2 : Check and run rsync daemon only in the needed IP See https://github.com/MariaDB/server/pull/235 I submit this code under the BSD-new license. --- scripts/wsrep_sst_rsync.sh | 50 ++++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh index 10d6896accd40..bc9cbd5f4db88 100644 --- a/scripts/wsrep_sst_rsync.sh +++ b/scripts/wsrep_sst_rsync.sh @@ -60,7 +60,8 @@ check_pid_and_port() { local pid_file=$1 local rsync_pid=$2 - local rsync_port=$3 + local rsync_addr=$3 + local rsync_port=$4 if ! which lsof > /dev/null; then wsrep_log_error "lsof tool not found in PATH! Make sure you have it installed." @@ -69,18 +70,44 @@ check_pid_and_port() local port_info=$(lsof -i :$rsync_port -Pn 2>/dev/null | \ grep "(LISTEN)") + local is_listening_all=$(echo $port_info | \ + grep "*:$rsync_port" 2>/dev/null) + local is_listening_addr=$(echo $port_info | \ + grep "$rsync_addr:$rsync_port" 2>/dev/null) local is_rsync=$(echo $port_info | \ grep -w '^rsync[[:space:]]\+'"$rsync_pid" 2>/dev/null) - if [ -n "$port_info" -a -z "$is_rsync" ]; then - wsrep_log_error "rsync daemon port '$rsync_port' has been taken" - exit 16 # EBUSY + if [ ! -z "$is_listening_all" -o ! -z "$is_listening_addr" ]; then + if [ -z "$is_rsync" ]; then + wsrep_log_error "rsync daemon port '$rsync_port' has been taken" + exit 16 # EBUSY + fi fi check_pid $pid_file && \ [ -n "$port_info" ] && [ -n "$is_rsync" ] && \ [ $(cat $pid_file) -eq $rsync_pid ] } +is_local_ip() +{ + local address="$1" + local get_addr_bin=`which ifconfig` + if [ -z "$get_addr_bin" ] + then + get_addr_bin=`which ip` + get_addr_bin="$get_addr_bin address show" + # Add an slash at the end, so we don't get false positive : 172.18.0.4 matches 172.18.0.41 + # ip output format is "X.X.X.X/mask" + address="${address}/" + else + # Add an space at the end, so we don't get false positive : 172.18.0.4 matches 172.18.0.41 + # ifconfig output format is "X.X.X.X " + address="$address " + fi + + $get_addr_bin | grep "$address" > /dev/null +} + MAGIC_FILE="$WSREP_SST_OPT_DATA/rsync_sst_complete" rm -rf "$MAGIC_FILE" @@ -271,6 +298,7 @@ then ADDR=$WSREP_SST_OPT_ADDR RSYNC_PORT=$(echo $ADDR | awk -F ':' '{ print $2 }') + RSYNC_ADDR=$(echo $ADDR | awk -F ':' '{ print $1 }') if [ -z "$RSYNC_PORT" ] then RSYNC_PORT=4444 @@ -303,11 +331,19 @@ EOF # rm -rf "$DATA"/ib_logfile* # we don't want old logs around - # listen at all interfaces (for firewalled setups) - rsync --daemon --no-detach --port $RSYNC_PORT --config "$RSYNC_CONF" & + # If the IP is local listen only in it + if is_local_ip $RSYNC_ADDR + then + rsync --daemon --no-detach --address $RSYNC_ADDR --port $RSYNC_PORT --config "$RSYNC_CONF" & + else + # Not local, possibly a NAT, listen in all interface + rsync --daemon --no-detach --port $RSYNC_PORT --config "$RSYNC_CONF" & + # Overwrite address with all + RSYNC_ADDR="*" + fi RSYNC_REAL_PID=$! - until check_pid_and_port $RSYNC_PID $RSYNC_REAL_PID $RSYNC_PORT + until check_pid_and_port $RSYNC_PID $RSYNC_REAL_PID $RSYNC_ADDR $RSYNC_PORT do sleep 0.2 done From 9b6bd3f17994175e1a67b2b8d3bedcb1d738c2a4 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Wed, 26 Oct 2016 12:06:54 -0400 Subject: [PATCH 52/71] MDEV-11149: wsrep_replicate_mysaim: DML fails when binlog checksum enabled During total-order replication, Query_log_event's checksum_alg should be explicitly set to the current binlog_checksum as it is not set for DML queries. Note: wsrep_replicate_myisam enables replication of DMLs on MyISAM tables using TOI. --- .../galera/r/galera_binlog_checksum.result | 16 ++++++++++++++ .../galera/t/galera_binlog_checksum.test | 21 +++++++++++++++++++ sql/wsrep_mysqld.cc | 6 +++++- 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/galera/r/galera_binlog_checksum.result b/mysql-test/suite/galera/r/galera_binlog_checksum.result index b0ea2293119e5..7303aa61122d9 100644 --- a/mysql-test/suite/galera/r/galera_binlog_checksum.result +++ b/mysql-test/suite/galera/r/galera_binlog_checksum.result @@ -11,3 +11,19 @@ SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; COUNT(*) = 1 1 DROP TABLE t1; +# +# MDEV-11149: wsrep_replicate_mysaim: DML fails when binlog checksum +# enabled +# +connection node_1; +SET @@global.wsrep_replicate_myisam=1; +CREATE TABLE t1 (i INT) ENGINE=MYISAM; +INSERT INTO t1 VALUES(1); +connection node_2; +SELECT * FROM t1; +i +1 +connection node_1; +DROP TABLE t1; +SET @@global.wsrep_replicate_myisam=0; +# End of tests. diff --git a/mysql-test/suite/galera/t/galera_binlog_checksum.test b/mysql-test/suite/galera/t/galera_binlog_checksum.test index 4866930524231..09d7a02f312a0 100644 --- a/mysql-test/suite/galera/t/galera_binlog_checksum.test +++ b/mysql-test/suite/galera/t/galera_binlog_checksum.test @@ -20,3 +20,24 @@ UPDATE t1 SET f1 = 2 WHERE f1 = 1; SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; DROP TABLE t1; + +--echo # +--echo # MDEV-11149: wsrep_replicate_mysaim: DML fails when binlog checksum +--echo # enabled +--echo # + +--connection node_1 +let $wsrep_replicate_myisam_saved= `SELECT @@wsrep_replicate_myisam`; +SET @@global.wsrep_replicate_myisam=1; + +CREATE TABLE t1 (i INT) ENGINE=MYISAM; +INSERT INTO t1 VALUES(1); + +--connection node_2 +SELECT * FROM t1; + +--connection node_1 +DROP TABLE t1; +eval SET @@global.wsrep_replicate_myisam=$wsrep_replicate_myisam_saved; + +--echo # End of tests. diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 01fb6d5e2c514..8c58ceddcd184 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -1248,9 +1248,11 @@ int wsrep_to_buf_helper( 65536, MYF(MY_WME))) return 1; int ret(0); + enum enum_binlog_checksum_alg current_binlog_check_alg= + (enum_binlog_checksum_alg) binlog_checksum_options; Format_description_log_event *tmp_fd= new Format_description_log_event(4); - tmp_fd->checksum_alg= (enum_binlog_checksum_alg)binlog_checksum_options; + tmp_fd->checksum_alg= current_binlog_check_alg; writer.write(tmp_fd); delete tmp_fd; @@ -1269,11 +1271,13 @@ int wsrep_to_buf_helper( Query_log_event ev(thd, thd->wsrep_TOI_pre_query, thd->wsrep_TOI_pre_query_len, FALSE, FALSE, FALSE, 0); + ev.checksum_alg= current_binlog_check_alg; if (writer.write(&ev)) ret= 1; } /* continue to append the actual query */ Query_log_event ev(thd, query, query_len, FALSE, FALSE, FALSE, 0); + ev.checksum_alg= current_binlog_check_alg; if (!ret && writer.write(&ev)) ret= 1; if (!ret && wsrep_write_cache_buf(&tmp_io_cache, buf, buf_len)) ret= 1; close_cached_file(&tmp_io_cache); From 491f42d50d17f73d7c3dd2460f9cf84b740fe760 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Tue, 1 Nov 2016 17:37:20 -0400 Subject: [PATCH 53/71] Fix/disable some failing galera tests. --- mysql-test/suite/galera/disabled.def | 6 ++++ .../include/auto_increment_offset_restore.inc | 6 ++++ .../include/auto_increment_offset_save.inc | 8 +++++ mysql-test/suite/galera/r/MW-258.result | 9 +++++ mysql-test/suite/galera/r/MW-259.result | 7 ++++ mysql-test/suite/galera/r/galera#414.result | 6 ++++ .../r/galera_autoinc_sst_xtrabackup.result | 11 ++++++ .../r/galera_binlog_event_max_size_max.result | 1 + .../suite/galera/r/galera_fulltext.result | 10 ++++++ .../r/galera_gcs_max_packet_size.result | 1 + .../galera/r/galera_ist_recv_bind.result | 8 +++++ .../suite/galera/r/galera_ist_rsync.result | 35 +++++++++++++++++++ .../galera/r/galera_kill_largechanges.result | 6 ++++ .../suite/galera/r/galera_many_columns.result | 8 +++++ .../suite/galera/r/galera_many_rows.result | 8 +++++ .../galera/r/galera_many_tables_nopk.result | 6 ++++ .../galera/r/galera_many_tables_pk.result | 8 +++++ .../r/galera_parallel_autoinc_largetrx.result | 9 +++++ .../r/galera_parallel_autoinc_manytrx.result | 5 +++ .../suite/galera/r/galera_rsu_add_pk.result | 3 ++ .../suite/galera/r/galera_rsu_drop_pk.result | 6 ++++ .../galera/r/galera_rsu_wsrep_desync.result | 5 ++- .../suite/galera/r/galera_sst_rsync.result | 35 +++++++++++++++++++ .../galera/r/galera_sync_wait_show.result | 4 +-- .../galera/r/galera_toi_ddl_error.result | 2 ++ .../r/galera_var_load_data_splitting.result | 3 ++ .../galera/r/galera_wan_restart_ist.result | 35 +++++++++++++++++++ .../galera/r/galera_wan_restart_sst.result | 29 +++++++++++++++ .../r/galera_wsrep_desync_wsrep_on.result | 5 +++ .../suite/galera/t/galera_sync_wait_show.test | 1 + .../galera/t/galera_wan_restart_ist.test | 17 +++++++-- mysql-test/suite/galera_3nodes/disabled.def | 2 ++ .../mysql-test/wsrep_info/r/plugin.result | 4 +++ 33 files changed, 304 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 5f8d9c6ddffcb..934ac121e6c1b 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -30,3 +30,9 @@ galera_gcs_fragment : Incorrect arguments to SET galera_flush_local : Fails sporadically galera_binlog_stmt_autoinc : TODO: investigate galera_concurrent_ctas : Test times out, investigate +galera_var_innodb_disallow_writes : MDEV-11035 +MW-286 : TODO: investigate +galera_sst_xtrabackup-v2-options : TODO: Fix test case +galera_sst_xtrabackup-v2 : MDEV-11208 +galera_sst_xtrabackup-v2_encrypt_with_key : MDEV-11208 +mysql-wsrep#33 : TODO: investigate diff --git a/mysql-test/suite/galera/include/auto_increment_offset_restore.inc b/mysql-test/suite/galera/include/auto_increment_offset_restore.inc index 6218dfd6f2c56..1248ed100ca4f 100644 --- a/mysql-test/suite/galera/include/auto_increment_offset_restore.inc +++ b/mysql-test/suite/galera/include/auto_increment_offset_restore.inc @@ -32,4 +32,10 @@ if ($node_3) --connection $node_3 --eval SET @@global.auto_increment_offset = $auto_increment_offset_node_3; } + +if ($node_4) +{ +--connection $node_4 +--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_4; +} --enable_query_log diff --git a/mysql-test/suite/galera/include/auto_increment_offset_save.inc b/mysql-test/suite/galera/include/auto_increment_offset_save.inc index 3c4db3f381cd1..216c689ec8cc7 100644 --- a/mysql-test/suite/galera/include/auto_increment_offset_save.inc +++ b/mysql-test/suite/galera/include/auto_increment_offset_save.inc @@ -13,6 +13,8 @@ # Connection handle for 2nd node # $node_3 (optional) # Connection handle for 3rd node +# $node_4 (optional) +# Connection handle for 4th node if (!$node_1) { @@ -35,3 +37,9 @@ if ($node_3) let $auto_increment_offset_node_3 = `SELECT @@global.auto_increment_offset`; } +if ($node_4) +{ + --connection $node_4 + let $auto_increment_offset_node_4 = `SELECT @@global.auto_increment_offset`; +} + diff --git a/mysql-test/suite/galera/r/MW-258.result b/mysql-test/suite/galera/r/MW-258.result index 1b4d4ae0de89b..1c2a1744c9869 100644 --- a/mysql-test/suite/galera/r/MW-258.result +++ b/mysql-test/suite/galera/r/MW-258.result @@ -1,3 +1,4 @@ +connection node_1; CREATE TABLE t1 (f1 INTEGER); LOCK TABLE t1 WRITE; value prior to RSU: @@ -7,12 +8,17 @@ wsrep_desync_count 0 SHOW VARIABLES LIKE 'wsrep_desync'; Variable_name Value wsrep_desync OFF +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; SET SESSION wsrep_sync_wait = 0; SET SESSION wsrep_osu_method = RSU; ALTER TABLE t1 ADD COLUMN f2 INTEGER;; +connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1b; SET SESSION wsrep_sync_wait = 0; SET SESSION wsrep_osu_method = RSU; ALTER TABLE t1 ADD COLUMN f3 INTEGER;; +connection node_1; value during RSU: SHOW STATUS LIKE 'wsrep_desync_count'; Variable_name Value @@ -21,6 +27,9 @@ SHOW VARIABLES LIKE 'wsrep_desync'; Variable_name Value wsrep_desync OFF UNLOCK TABLES; +connection node_1a; +connection node_1b; +connection node_1; value after RSU: SHOW STATUS LIKE 'wsrep_desync_count'; Variable_name Value diff --git a/mysql-test/suite/galera/r/MW-259.result b/mysql-test/suite/galera/r/MW-259.result index df76e959de551..5256a95c52cdd 100644 --- a/mysql-test/suite/galera/r/MW-259.result +++ b/mysql-test/suite/galera/r/MW-259.result @@ -1,3 +1,6 @@ +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1; CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; SET GLOBAL wsrep_desync=0; Warnings: @@ -5,8 +8,12 @@ Warning 1231 'wsrep_desync' is already OFF. SET wsrep_OSU_method=RSU; SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue'; ALTER TABLE t1 ADD COLUMN f2 INTEGER;; +connection node_1a; SET GLOBAL wsrep_desync=1;; +connection node_1b; SET DEBUG_SYNC= 'now SIGNAL continue'; DROP TABLE t1; SET GLOBAL wsrep_desync=0; +connection node_1; +connection node_1a; SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/suite/galera/r/galera#414.result b/mysql-test/suite/galera/r/galera#414.result index 029961f94639b..c9fc39ddc2100 100644 --- a/mysql-test/suite/galera/r/galera#414.result +++ b/mysql-test/suite/galera/r/galera#414.result @@ -1,5 +1,11 @@ +connection node_2; +connection node_1; SET SESSION wsrep_sync_wait = 0; SET SESSION wsrep_on = OFF; +connection node_2; +connection node_1; SET SESSION wsrep_on = ON; +connection node_1; CALL mtr.add_suppression("Failed to set packet size"); +connection node_2; CALL mtr.add_suppression("Failed to set packet size"); diff --git a/mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result b/mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result index 228d7c6f04194..d0fac1e3d147f 100644 --- a/mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result +++ b/mysql-test/suite/galera/r/galera_autoinc_sst_xtrabackup.result @@ -1,3 +1,4 @@ +connection node_1; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; CREATE PROCEDURE p1 () BEGIN @@ -9,12 +10,21 @@ COMMIT; END WHILE; END| CALL p1();; +connection node_2; CALL p1();; +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2a; Killing server ... INSERT INTO t1 VALUES (DEFAULT); +connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connection node_1a; INSERT INTO t1 VALUES (DEFAULT); +connection node_1; Got one of the listed errors +connection node_2; Got one of the listed errors +connection node_1a; +connection node_2a; count_equal 1 CALL mtr.add_suppression("WSREP: Action message in non-primary configuration from member 0"); @@ -24,6 +34,7 @@ VARIABLE_VALUE SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 1 +connection node_1a; SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE 2 diff --git a/mysql-test/suite/galera/r/galera_binlog_event_max_size_max.result b/mysql-test/suite/galera/r/galera_binlog_event_max_size_max.result index 4156c0c70a7c4..46582ff5c4bfc 100644 --- a/mysql-test/suite/galera/r/galera_binlog_event_max_size_max.result +++ b/mysql-test/suite/galera/r/galera_binlog_event_max_size_max.result @@ -2,6 +2,7 @@ CREATE TABLE ten (f1 INTEGER); INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); CREATE TABLE t1 (f1 VARCHAR(1000)); INSERT INTO t1 SELECT REPEAT('x', 1000) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; +connection node_2; SELECT COUNT(*) = 10000 FROM t1; COUNT(*) = 10000 1 diff --git a/mysql-test/suite/galera/r/galera_fulltext.result b/mysql-test/suite/galera/r/galera_fulltext.result index 84ae0a116a100..18e3bff40fc3c 100644 --- a/mysql-test/suite/galera/r/galera_fulltext.result +++ b/mysql-test/suite/galera/r/galera_fulltext.result @@ -1,24 +1,34 @@ CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +connection node_1; CREATE TABLE t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB; +connection node_2; SELECT COUNT(*) = 13 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name LIKE 'test/%'; COUNT(*) = 13 1 +connection node_1; INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3; +connection node_2; SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz'); COUNT(f2) = 1000 1 UPDATE t1 SET f2 = 'abcdefjhk'; +connection node_1; SELECT COUNT(f2) = 1000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk'); COUNT(f2) = 1000 1 +connection node_2; DROP TABLE t1; +connection node_1; CREATE TABLE t1 (f1 VARCHAR(100), FULLTEXT (f1)) ENGINE=InnoDB; +connection node_2; INSERT INTO t1 (f1) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3; +connection node_1; SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('foobarbaz'); COUNT(f1) = 1000 1 UPDATE t1 SET f1 = 'abcdefjhk'; +connection node_2; SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk'); COUNT(f1) = 1000 1 diff --git a/mysql-test/suite/galera/r/galera_gcs_max_packet_size.result b/mysql-test/suite/galera/r/galera_gcs_max_packet_size.result index 606cb549def30..ce74f3db43302 100644 --- a/mysql-test/suite/galera/r/galera_gcs_max_packet_size.result +++ b/mysql-test/suite/galera/r/galera_gcs_max_packet_size.result @@ -4,6 +4,7 @@ CREATE TABLE t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB; CREATE TABLE t2 (f1 VARCHAR(512) UNIQUE) ENGINE=InnoDB; INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; INSERT INTO t2 VALUES (REPEAT('x', 512)); +connection node_2; SELECT COUNT(*) = 10000 FROM t1; COUNT(*) = 10000 1 diff --git a/mysql-test/suite/galera/r/galera_ist_recv_bind.result b/mysql-test/suite/galera/r/galera_ist_recv_bind.result index de4e07fbe4194..ffc751d86721a 100644 --- a/mysql-test/suite/galera/r/galera_ist_recv_bind.result +++ b/mysql-test/suite/galera/r/galera_ist_recv_bind.result @@ -1,13 +1,21 @@ +connection node_1; SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%'; @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%' 1 +connection node_2; SELECT @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%'; @@wsrep_provider_options LIKE '%ist.recv_bind = 127.0.0.1%' 1 SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1'; +connection node_1; +connection node_2; SET SESSION wsrep_on = OFF; SET SESSION wsrep_on = ON; +connection node_1; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); +connection node_2; SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0'; +connection node_1; +connection node_2; DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_ist_rsync.result b/mysql-test/suite/galera/r/galera_ist_rsync.result index 0b25a299b242c..e4eb9d821fa01 100644 --- a/mysql-test/suite/galera/r/galera_ist_rsync.result +++ b/mysql-test/suite/galera/r/galera_ist_rsync.result @@ -1,4 +1,5 @@ Performing State Transfer on a server that has been temporarily disconnected +connection node_1; CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; @@ -8,6 +9,7 @@ INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); COMMIT; +connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node2_committed_before'); @@ -18,6 +20,7 @@ INSERT INTO t1 VALUES ('node2_committed_before'); COMMIT; Unloading wsrep provider ... SET GLOBAL wsrep_provider = 'none'; +connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node1_committed_during'); @@ -32,6 +35,7 @@ INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); @@ -39,6 +43,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +connection node_2; Loading wsrep provider ... SET AUTOCOMMIT=OFF; START TRANSACTION; @@ -48,6 +53,7 @@ INSERT INTO t1 VALUES ('node2_committed_after'); INSERT INTO t1 VALUES ('node2_committed_after'); INSERT INTO t1 VALUES ('node2_committed_after'); COMMIT; +connection node_1; INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); @@ -62,6 +68,7 @@ INSERT INTO t1 VALUES ('node1_committed_after'); INSERT INTO t1 VALUES ('node1_committed_after'); INSERT INTO t1 VALUES ('node1_committed_after'); COMMIT; +connection node_1a_galera_st_disconnect_slave; INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); @@ -76,6 +83,7 @@ COUNT(*) = 0 1 COMMIT; SET AUTOCOMMIT=ON; +connection node_1; SELECT COUNT(*) = 35 FROM t1; COUNT(*) = 35 1 @@ -86,6 +94,7 @@ DROP TABLE t1; COMMIT; SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been shut down cleanly and restarted +connection node_1; CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; @@ -95,6 +104,7 @@ INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); COMMIT; +connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node2_committed_before'); @@ -104,6 +114,7 @@ INSERT INTO t1 VALUES ('node2_committed_before'); INSERT INTO t1 VALUES ('node2_committed_before'); COMMIT; Shutting down server ... +connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node1_committed_during'); @@ -118,6 +129,7 @@ INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); @@ -125,6 +137,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; @@ -134,6 +147,7 @@ INSERT INTO t1 VALUES ('node2_committed_after'); INSERT INTO t1 VALUES ('node2_committed_after'); INSERT INTO t1 VALUES ('node2_committed_after'); COMMIT; +connection node_1; INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); @@ -148,6 +162,7 @@ INSERT INTO t1 VALUES ('node1_committed_after'); INSERT INTO t1 VALUES ('node1_committed_after'); INSERT INTO t1 VALUES ('node1_committed_after'); COMMIT; +connection node_1a_galera_st_shutdown_slave; INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); @@ -162,6 +177,7 @@ COUNT(*) = 0 1 COMMIT; SET AUTOCOMMIT=ON; +connection node_1; SELECT COUNT(*) = 35 FROM t1; COUNT(*) = 35 1 @@ -172,6 +188,7 @@ DROP TABLE t1; COMMIT; SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been killed and restarted +connection node_1; CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; @@ -181,6 +198,7 @@ INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); COMMIT; +connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node2_committed_before'); @@ -190,6 +208,7 @@ INSERT INTO t1 VALUES ('node2_committed_before'); INSERT INTO t1 VALUES ('node2_committed_before'); COMMIT; Killing server ... +connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node1_committed_during'); @@ -204,6 +223,7 @@ INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); @@ -211,6 +231,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +connection node_2; Performing --wsrep-recover ... Starting server ... Using --wsrep-start-position when starting mysqld ... @@ -222,6 +243,7 @@ INSERT INTO t1 VALUES ('node2_committed_after'); INSERT INTO t1 VALUES ('node2_committed_after'); INSERT INTO t1 VALUES ('node2_committed_after'); COMMIT; +connection node_1; INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); @@ -236,6 +258,7 @@ INSERT INTO t1 VALUES ('node1_committed_after'); INSERT INTO t1 VALUES ('node1_committed_after'); INSERT INTO t1 VALUES ('node1_committed_after'); COMMIT; +connection node_1a_galera_st_kill_slave; INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); @@ -250,6 +273,7 @@ COUNT(*) = 0 1 COMMIT; SET AUTOCOMMIT=ON; +connection node_1; SELECT COUNT(*) = 35 FROM t1; COUNT(*) = 35 1 @@ -261,6 +285,7 @@ COMMIT; SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been killed and restarted while a DDL was in progress on it +connection node_1; CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; @@ -269,6 +294,7 @@ INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); +connection node_2; START TRANSACTION; INSERT INTO t1 VALUES ('node2_committed_before'); INSERT INTO t1 VALUES ('node2_committed_before'); @@ -277,9 +303,12 @@ INSERT INTO t1 VALUES ('node2_committed_before'); INSERT INTO t1 VALUES ('node2_committed_before'); COMMIT; SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; +connection node_1; ALTER TABLE t1 ADD COLUMN f2 INTEGER; +connection node_2; SET wsrep_sync_wait = 0; Killing server ... +connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 (f1) VALUES ('node1_committed_during'); @@ -294,6 +323,7 @@ INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); @@ -301,7 +331,9 @@ INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); +connection node_2; Performing --wsrep-recover ... +connection node_2; Starting server ... Using --wsrep-start-position when starting mysqld ... SET AUTOCOMMIT=OFF; @@ -312,6 +344,7 @@ INSERT INTO t1 (f1) VALUES ('node2_committed_after'); INSERT INTO t1 (f1) VALUES ('node2_committed_after'); INSERT INTO t1 (f1) VALUES ('node2_committed_after'); COMMIT; +connection node_1; INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); @@ -326,6 +359,7 @@ INSERT INTO t1 (f1) VALUES ('node1_committed_after'); INSERT INTO t1 (f1) VALUES ('node1_committed_after'); INSERT INTO t1 (f1) VALUES ('node1_committed_after'); COMMIT; +connection node_1a_galera_st_kill_slave_ddl; INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); @@ -343,6 +377,7 @@ COUNT(*) = 0 1 COMMIT; SET AUTOCOMMIT=ON; +connection node_1; SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; COUNT(*) = 2 1 diff --git a/mysql-test/suite/galera/r/galera_kill_largechanges.result b/mysql-test/suite/galera/r/galera_kill_largechanges.result index a37056ad9b015..d04bd54894998 100644 --- a/mysql-test/suite/galera/r/galera_kill_largechanges.result +++ b/mysql-test/suite/galera/r/galera_kill_largechanges.result @@ -1,14 +1,20 @@ +connection node_1; SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; CREATE TABLE ten (f1 INTEGER); INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); CREATE TABLE t1 (f1 VARCHAR(128)) ENGINE=InnoDB; +connection node_2; Killing server ... +connection node_1; INSERT INTO t1 SELECT REPEAT('a', 128) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6; +connection node_2; +connection node_2a; SELECT COUNT(*) = 1000000 FROM t1; COUNT(*) = 1000000 1 SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 1 +connection node_1; DROP TABLE t1; DROP TABLE ten; diff --git a/mysql-test/suite/galera/r/galera_many_columns.result b/mysql-test/suite/galera/r/galera_many_columns.result index 6fa574e47c268..71e58f80537b1 100644 --- a/mysql-test/suite/galera/r/galera_many_columns.result +++ b/mysql-test/suite/galera/r/galera_many_columns.result @@ -1,22 +1,29 @@ INSERT INTO t1 (f1) VALUES (DEFAULT); +connection node_2; SELECT f1 = 'ABC', f1017 = 'ABC' FROM t1; f1 = 'ABC' f1017 = 'ABC' 1 1 UPDATE t1 SET f1 = 'XYZ', f1017 = 'XYZ' ; +connection node_1; SELECT f1 = 'XYZ', f1017 = 'XYZ' FROM t1 WHERE f1 = 'XYZ' AND f1017 = 'XYZ'; f1 = 'XYZ' f1017 = 'XYZ' 1 1 +connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; UPDATE t1 SET f2 = 'KLM' WHERE f1 = 'XYZ' AND f1017 = 'XYZ'; +connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; UPDATE t1 SET f2 = 'CDE' WHERE f1 = 'XYZ' AND f1017 = 'XYZ'; COMMIT; +connection node_1; COMMIT; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction ROLLBACK; +connection node_2; ROLLBACK; +connection node_1; START TRANSACTION; INSERT INTO t1 (f1, f1017) VALUES ('BCE','BCE'); INSERT INTO t1 (f1, f1017) VALUES ('CED','CED'); @@ -26,6 +33,7 @@ ROLLBACK; SELECT COUNT(*) = 1 FROM t1; COUNT(*) = 1 1 +connection node_2; SELECT COUNT(*) = 1 FROM t1; COUNT(*) = 1 1 diff --git a/mysql-test/suite/galera/r/galera_many_rows.result b/mysql-test/suite/galera/r/galera_many_rows.result index a34367d6e4643..ab43b96145898 100644 --- a/mysql-test/suite/galera/r/galera_many_rows.result +++ b/mysql-test/suite/galera/r/galera_many_rows.result @@ -1,9 +1,11 @@ +connection node_1; SET SESSION innodb_lock_wait_timeout=600; SET SESSION lock_wait_timeout=600; CREATE TABLE ten (f1 INTEGER); INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB; INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; +connection node_2; SET SESSION wsrep_sync_wait = 0; SET SESSION wsrep_sync_wait = 7; SET GLOBAL wsrep_provider_options = 'repl.causal_read_timeout=PT1H'; @@ -11,21 +13,27 @@ SELECT COUNT(*) = 100000 FROM t1; COUNT(*) = 100000 1 INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; +connection node_1; SELECT COUNT(*) = 200000 FROM t1; COUNT(*) = 200000 1 UPDATE t1 SET f2 = 1; +connection node_2; SELECT COUNT(*) = 200000 FROM t1 WHERE f2 = 1; COUNT(*) = 200000 1 +connection node_1; START TRANSACTION; SELECT COUNT(*) = 200000 FROM t1; COUNT(*) = 200000 1 UPDATE t1 SET f2 = 3; +connection node_2; START TRANSACTION; UPDATE t1 SET f2 = 4; +connection node_1; COMMIT; +connection node_2; COMMIT; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_many_tables_nopk.result b/mysql-test/suite/galera/r/galera_many_tables_nopk.result index 283905979ec64..3e30b33325054 100644 --- a/mysql-test/suite/galera/r/galera_many_tables_nopk.result +++ b/mysql-test/suite/galera/r/galera_many_tables_nopk.result @@ -1,16 +1,22 @@ +connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; COMMIT; +connection node_2; CREATE TABLE sum_table (f1 INTEGER); SELECT SUM(f1) = 900 FROM sum_table; SUM(f1) = 900 1 +connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; +connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; UPDATE t900 SET f1 = 3; +connection node_1; COMMIT; +connection node_2; COMMIT; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction DROP SCHEMA test; diff --git a/mysql-test/suite/galera/r/galera_many_tables_pk.result b/mysql-test/suite/galera/r/galera_many_tables_pk.result index d0aa1694e85fa..38cf19a8d8f3d 100644 --- a/mysql-test/suite/galera/r/galera_many_tables_pk.result +++ b/mysql-test/suite/galera/r/galera_many_tables_pk.result @@ -1,19 +1,27 @@ +connection node_1; +connection node_2; SELECT COUNT(*) = 900 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%'; COUNT(*) = 900 1 +connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; COMMIT; +connection node_2; CREATE TABLE sum_table (f1 INTEGER); SELECT SUM(f1) = 900 FROM sum_table; SUM(f1) = 900 1 +connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; +connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; UPDATE t900 SET f1 = 3; +connection node_1; COMMIT; +connection node_2; COMMIT; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction DROP SCHEMA test; diff --git a/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result b/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result index 1f163f4366ce7..336f46fcd7ed3 100644 --- a/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result +++ b/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result @@ -1,10 +1,18 @@ +connection node_1; CREATE TABLE ten (f1 INTEGER); INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB; +connection node_2; SET GLOBAL wsrep_slave_threads = 4; +connection node_1; INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;; +connection node_1a; INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;; +connection node_2; INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;; +connection node_1; +connection node_1a; +connection node_2; SELECT COUNT(*) = 30000 FROM t1; COUNT(*) = 30000 1 @@ -14,5 +22,6 @@ COUNT(DISTINCT f1) = 30000 SELECT COUNT(*) = 5 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; COUNT(*) = 5 1 +connection default; DROP TABLE t1; DROP TABLE ten; diff --git a/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result b/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result index 05ce328228a25..c8c07221cb15d 100644 --- a/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result +++ b/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result @@ -1,7 +1,11 @@ +connection node_1; CREATE TABLE ten (f1 INTEGER); INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB; +connection node_2; SET GLOBAL wsrep_slave_threads = 4; +connection node_1; +connection node_2; SELECT COUNT(*) = 20000 FROM t1; COUNT(*) = 20000 1 @@ -11,5 +15,6 @@ COUNT(DISTINCT f1) = 20000 SELECT COUNT(*) = 4 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE 'committed%'; COUNT(*) = 4 1 +connection default; DROP TABLE t1; DROP TABLE ten; diff --git a/mysql-test/suite/galera/r/galera_rsu_add_pk.result b/mysql-test/suite/galera/r/galera_rsu_add_pk.result index 3fd24af9ad71a..4c79da154e2a0 100644 --- a/mysql-test/suite/galera/r/galera_rsu_add_pk.result +++ b/mysql-test/suite/galera/r/galera_rsu_add_pk.result @@ -1,8 +1,10 @@ +connection node_1; CREATE TABLE ten (f1 INTEGER); INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;; +connection node_2; SET SESSION wsrep_OSU_method = "RSU"; ALTER TABLE t1 ADD PRIMARY KEY (f1); SET SESSION wsrep_OSU_method = "TOI"; @@ -13,6 +15,7 @@ COUNT(*) = 300000 SELECT MAX(f1) = 299999 FROM t1; MAX(f1) = 299999 1 +connection node_1; SELECT COUNT(*) = 300000 FROM t1; COUNT(*) = 300000 1 diff --git a/mysql-test/suite/galera/r/galera_rsu_drop_pk.result b/mysql-test/suite/galera/r/galera_rsu_drop_pk.result index 039fb68d244d3..f64649ef4e204 100644 --- a/mysql-test/suite/galera/r/galera_rsu_drop_pk.result +++ b/mysql-test/suite/galera/r/galera_rsu_drop_pk.result @@ -1,8 +1,10 @@ +connection node_1; CREATE TABLE ten (f1 INTEGER); INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;; +connection node_2; SET SESSION wsrep_OSU_method = "RSU"; ALTER TABLE t1 DROP PRIMARY KEY; SET SESSION wsrep_OSU_method = "TOI"; @@ -13,6 +15,7 @@ COUNT(*) = 300000 SELECT MAX(f1) = 299999 FROM t1; MAX(f1) = 299999 1 +connection node_1; SELECT COUNT(*) = 300000 FROM t1; COUNT(*) = 300000 1 @@ -22,8 +25,10 @@ MAX(f1) = 299999 SET SESSION wsrep_OSU_method = "RSU"; ALTER TABLE t1 DROP PRIMARY KEY; SET SESSION wsrep_OSU_method = "TOI"; +connection node_2; INSERT INTO t1 (f1) VALUES (1); INSERT INTO t1 (f1) VALUES (10); +connection node_1; SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 1; COUNT(*) = 2 1 @@ -32,6 +37,7 @@ COUNT(*) = 2 1 INSERT INTO t1 (f1) VALUES (100); INSERT INTO t1 (f1) VALUES (1000); +connection node_2; SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 100; COUNT(*) = 2 1 diff --git a/mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result b/mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result index aa0d20a34662f..a103e810588d3 100644 --- a/mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result +++ b/mysql-test/suite/galera/r/galera_rsu_wsrep_desync.result @@ -5,6 +5,7 @@ SET wsrep_OSU_method=RSU; SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue'; ALTER TABLE t1 ADD COLUMN f2 INTEGER;; connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; +connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1; connection node_1a; SET GLOBAL wsrep_desync=0; SET DEBUG_SYNC= 'now SIGNAL continue'; @@ -31,9 +32,11 @@ SET DEBUG_SYNC = 'alter_table_before_create_table_no_lock WAIT_FOR continue'; ALTER TABLE t1 ADD COLUMN f2 INTEGER;; connection node_1a; SET GLOBAL wsrep_desync=1;; +connection node_1b; SET DEBUG_SYNC= 'now SIGNAL continue'; -SET GLOBAL wsrep_desync=0; connection node_1; +connection node_1a; +SET GLOBAL wsrep_desync=0; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/suite/galera/r/galera_sst_rsync.result b/mysql-test/suite/galera/r/galera_sst_rsync.result index df2d9190a4b56..b16a496554beb 100644 --- a/mysql-test/suite/galera/r/galera_sst_rsync.result +++ b/mysql-test/suite/galera/r/galera_sst_rsync.result @@ -1,4 +1,5 @@ Performing State Transfer on a server that has been shut down cleanly and restarted +connection node_1; CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; @@ -8,6 +9,7 @@ INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); COMMIT; +connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node2_committed_before'); @@ -17,6 +19,7 @@ INSERT INTO t1 VALUES ('node2_committed_before'); INSERT INTO t1 VALUES ('node2_committed_before'); COMMIT; Shutting down server ... +connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node1_committed_during'); @@ -31,6 +34,7 @@ INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); @@ -38,6 +42,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; @@ -47,6 +52,7 @@ INSERT INTO t1 VALUES ('node2_committed_after'); INSERT INTO t1 VALUES ('node2_committed_after'); INSERT INTO t1 VALUES ('node2_committed_after'); COMMIT; +connection node_1; INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); @@ -61,6 +67,7 @@ INSERT INTO t1 VALUES ('node1_committed_after'); INSERT INTO t1 VALUES ('node1_committed_after'); INSERT INTO t1 VALUES ('node1_committed_after'); COMMIT; +connection node_1a_galera_st_shutdown_slave; INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); @@ -75,6 +82,7 @@ COUNT(*) = 0 1 COMMIT; SET AUTOCOMMIT=ON; +connection node_1; SELECT COUNT(*) = 35 FROM t1; COUNT(*) = 35 1 @@ -86,6 +94,7 @@ COMMIT; SET AUTOCOMMIT=ON; Performing State Transfer on a server that starts from a clean var directory This is accomplished by shutting down node #2 and removing its var directory before restarting it +connection node_1; CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; @@ -95,6 +104,7 @@ INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); COMMIT; +connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node2_committed_before'); @@ -104,6 +114,7 @@ INSERT INTO t1 VALUES ('node2_committed_before'); INSERT INTO t1 VALUES ('node2_committed_before'); COMMIT; Shutting down server ... +connection node_1; Cleaning var directory ... SET AUTOCOMMIT=OFF; START TRANSACTION; @@ -119,6 +130,7 @@ INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); @@ -126,6 +138,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +connection node_2; Starting server ... SET AUTOCOMMIT=OFF; START TRANSACTION; @@ -135,6 +148,7 @@ INSERT INTO t1 VALUES ('node2_committed_after'); INSERT INTO t1 VALUES ('node2_committed_after'); INSERT INTO t1 VALUES ('node2_committed_after'); COMMIT; +connection node_1; INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); @@ -149,6 +163,7 @@ INSERT INTO t1 VALUES ('node1_committed_after'); INSERT INTO t1 VALUES ('node1_committed_after'); INSERT INTO t1 VALUES ('node1_committed_after'); COMMIT; +connection node_1a_galera_st_clean_slave; INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); @@ -163,6 +178,7 @@ COUNT(*) = 0 1 COMMIT; SET AUTOCOMMIT=ON; +connection node_1; SELECT COUNT(*) = 35 FROM t1; COUNT(*) = 35 1 @@ -173,6 +189,7 @@ DROP TABLE t1; COMMIT; SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been killed and restarted +connection node_1; CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; @@ -182,6 +199,7 @@ INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); COMMIT; +connection node_2; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node2_committed_before'); @@ -191,6 +209,7 @@ INSERT INTO t1 VALUES ('node2_committed_before'); INSERT INTO t1 VALUES ('node2_committed_before'); COMMIT; Killing server ... +connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node1_committed_during'); @@ -205,6 +224,7 @@ INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); @@ -212,6 +232,7 @@ INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); +connection node_2; Performing --wsrep-recover ... Starting server ... Using --wsrep-start-position when starting mysqld ... @@ -223,6 +244,7 @@ INSERT INTO t1 VALUES ('node2_committed_after'); INSERT INTO t1 VALUES ('node2_committed_after'); INSERT INTO t1 VALUES ('node2_committed_after'); COMMIT; +connection node_1; INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); INSERT INTO t1 VALUES ('node1_to_be_committed_after'); @@ -237,6 +259,7 @@ INSERT INTO t1 VALUES ('node1_committed_after'); INSERT INTO t1 VALUES ('node1_committed_after'); INSERT INTO t1 VALUES ('node1_committed_after'); COMMIT; +connection node_1a_galera_st_kill_slave; INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); @@ -251,6 +274,7 @@ COUNT(*) = 0 1 COMMIT; SET AUTOCOMMIT=ON; +connection node_1; SELECT COUNT(*) = 35 FROM t1; COUNT(*) = 35 1 @@ -262,6 +286,7 @@ COMMIT; SET AUTOCOMMIT=ON; Performing State Transfer on a server that has been killed and restarted while a DDL was in progress on it +connection node_1; CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; SET AUTOCOMMIT=OFF; START TRANSACTION; @@ -270,6 +295,7 @@ INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); INSERT INTO t1 VALUES ('node1_committed_before'); +connection node_2; START TRANSACTION; INSERT INTO t1 VALUES ('node2_committed_before'); INSERT INTO t1 VALUES ('node2_committed_before'); @@ -278,9 +304,12 @@ INSERT INTO t1 VALUES ('node2_committed_before'); INSERT INTO t1 VALUES ('node2_committed_before'); COMMIT; SET GLOBAL debug_dbug = 'd,sync.alter_opened_table'; +connection node_1; ALTER TABLE t1 ADD COLUMN f2 INTEGER; +connection node_2; SET wsrep_sync_wait = 0; Killing server ... +connection node_1; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 (f1) VALUES ('node1_committed_during'); @@ -295,6 +324,7 @@ INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); +connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1; SET AUTOCOMMIT=OFF; START TRANSACTION; INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); @@ -302,7 +332,9 @@ INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); +connection node_2; Performing --wsrep-recover ... +connection node_2; Starting server ... Using --wsrep-start-position when starting mysqld ... SET AUTOCOMMIT=OFF; @@ -313,6 +345,7 @@ INSERT INTO t1 (f1) VALUES ('node2_committed_after'); INSERT INTO t1 (f1) VALUES ('node2_committed_after'); INSERT INTO t1 (f1) VALUES ('node2_committed_after'); COMMIT; +connection node_1; INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); @@ -327,6 +360,7 @@ INSERT INTO t1 (f1) VALUES ('node1_committed_after'); INSERT INTO t1 (f1) VALUES ('node1_committed_after'); INSERT INTO t1 (f1) VALUES ('node1_committed_after'); COMMIT; +connection node_1a_galera_st_kill_slave_ddl; INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); @@ -344,6 +378,7 @@ COUNT(*) = 0 1 COMMIT; SET AUTOCOMMIT=ON; +connection node_1; SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; COUNT(*) = 2 1 diff --git a/mysql-test/suite/galera/r/galera_sync_wait_show.result b/mysql-test/suite/galera/r/galera_sync_wait_show.result index 4a73a57304151..4c104eb54d8a5 100644 --- a/mysql-test/suite/galera/r/galera_sync_wait_show.result +++ b/mysql-test/suite/galera/r/galera_sync_wait_show.result @@ -42,8 +42,8 @@ CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a'; connection node_2; SHOW CREATE TRIGGER tr1; -Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation -tr1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a' latin1 latin1_swedish_ci latin1_swedish_ci +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation Created +tr1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a' latin1 latin1_swedish_ci latin1_swedish_ci # DROP TABLE t1; connection node_1; CREATE EVENT event1 ON SCHEDULE AT '2038-01-01 23:59:59' DO SELECT 1; diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_error.result b/mysql-test/suite/galera/r/galera_toi_ddl_error.result index 656e20bcc46f0..dafad15386737 100644 --- a/mysql-test/suite/galera/r/galera_toi_ddl_error.result +++ b/mysql-test/suite/galera/r/galera_toi_ddl_error.result @@ -3,6 +3,7 @@ INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t1 (f1) SELECT (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; INSERT INTO t1 (f1) SELECT MAX(f1) FROM t1; +connection node_2; ALTER TABLE t1 ADD PRIMARY KEY (f1); ERROR 23000: Duplicate entry '111110' for key 'PRIMARY' SHOW CREATE TABLE t1; @@ -10,6 +11,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `f1` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 +connection node_1; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/suite/galera/r/galera_var_load_data_splitting.result b/mysql-test/suite/galera/r/galera_var_load_data_splitting.result index db145fd15619a..3e451abbed135 100644 --- a/mysql-test/suite/galera/r/galera_var_load_data_splitting.result +++ b/mysql-test/suite/galera/r/galera_var_load_data_splitting.result @@ -1,9 +1,12 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +connection node_2; SET GLOBAL wsrep_load_data_splitting = TRUE; +connection node_2; SELECT COUNT(*) = 95000 FROM t1; COUNT(*) = 95000 1 wsrep_last_committed_diff 1 +connection node_1; SET GLOBAL wsrep_load_data_splitting = 1;; DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_wan_restart_ist.result b/mysql-test/suite/galera/r/galera_wan_restart_ist.result index e58bff34e54dd..8a2a7d0818e7c 100644 --- a/mysql-test/suite/galera/r/galera_wan_restart_ist.result +++ b/mysql-test/suite/galera/r/galera_wan_restart_ist.result @@ -1,53 +1,88 @@ +connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; +connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4; +connection node_1; +connection node_2; +connection node_3; +connection node_4; SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 4 1 +connection node_1; CREATE TABLE t1 (f1 INTEGER); INSERT INTO t1 VALUES (1); +connection node_2; INSERT INTO t1 VALUES (2); +connection node_3; INSERT INTO t1 VALUES (3); +connection node_4; INSERT INTO t1 VALUES (4); +connection node_3; INSERT INTO t1 VALUES (13); Shutting down server ... +connection node_1; INSERT INTO t1 VALUES (11); +connection node_2; INSERT INTO t1 VALUES (12); +connection node_4; INSERT INTO t1 VALUES (14); +connection node_3; INSERT INTO t1 VALUES (131); +connection node_2; INSERT INTO t1 VALUES (22); Shutting down server ... +connection node_1; INSERT INTO t1 VALUES (21); +connection node_3; INSERT INTO t1 VALUES (23); +connection node_4; INSERT INTO t1 VALUES (24); +connection node_2; INSERT INTO t1 VALUES (221); +connection node_4; INSERT INTO t1 VALUES (34); Shutting down server ... +connection node_1; INSERT INTO t1 VALUES (31); +connection node_2; INSERT INTO t1 VALUES (32); +connection node_3; INSERT INTO t1 VALUES (33); +connection node_4; INSERT INTO t1 VALUES (341); +connection node_1; SELECT COUNT(*) = 19 FROM t1; COUNT(*) = 19 1 +connection node_2; SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 4 1 SELECT COUNT(*) = 19 FROM t1; COUNT(*) = 19 1 +connection node_3; SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 4 1 SELECT COUNT(*) = 19 FROM t1; COUNT(*) = 19 1 +connection node_4; SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 4 1 SELECT COUNT(*) = 19 FROM t1; COUNT(*) = 19 1 +connection node_1; DROP TABLE t1; CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside"); +connection node_2; CALL mtr.add_suppression("Action message in non-primary configuration from member 0"); +connection node_3; CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside"); CALL mtr.add_suppression("Action message in non-primary configuration from member 0"); +connection node_4; CALL mtr.add_suppression("Action message in non-primary configuration from member 0"); +disconnect node_2; +disconnect node_1; diff --git a/mysql-test/suite/galera/r/galera_wan_restart_sst.result b/mysql-test/suite/galera/r/galera_wan_restart_sst.result index 15de0fab3428c..71786cdd023ab 100644 --- a/mysql-test/suite/galera/r/galera_wan_restart_sst.result +++ b/mysql-test/suite/galera/r/galera_wan_restart_sst.result @@ -1,54 +1,83 @@ SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 4 1 +connection node_1; CREATE TABLE t1 (f1 INTEGER); INSERT INTO t1 VALUES (1); +connection node_2; INSERT INTO t1 VALUES (2); +connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; +connection node_3; INSERT INTO t1 VALUES (3); +connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4; +connection node_4; INSERT INTO t1 VALUES (4); +connection node_3; INSERT INTO t1 VALUES (13); Killing server ... +connection node_1; INSERT INTO t1 VALUES (11); +connection node_2; INSERT INTO t1 VALUES (12); +connection node_4; INSERT INTO t1 VALUES (14); +connection node_3; INSERT INTO t1 VALUES (131); +connection node_2; INSERT INTO t1 VALUES (22); Killing server ... +connection node_1; INSERT INTO t1 VALUES (21); +connection node_3; INSERT INTO t1 VALUES (23); +connection node_4; INSERT INTO t1 VALUES (24); +connection node_2; INSERT INTO t1 VALUES (221); +connection node_4; INSERT INTO t1 VALUES (34); Killing server ... +connection node_1; INSERT INTO t1 VALUES (31); +connection node_2; INSERT INTO t1 VALUES (32); +connection node_3; INSERT INTO t1 VALUES (33); +connection node_4; INSERT INTO t1 VALUES (341); +connection node_1; SELECT COUNT(*) = 19 FROM t1; COUNT(*) = 19 1 +connection node_2; SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 4 1 SELECT COUNT(*) = 19 FROM t1; COUNT(*) = 19 1 +connection node_3; SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 4 1 SELECT COUNT(*) = 19 FROM t1; COUNT(*) = 19 1 +connection node_4; SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 4 1 SELECT COUNT(*) = 19 FROM t1; COUNT(*) = 19 1 +connection node_1; DROP TABLE t1; CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside"); CALL mtr.add_suppression("WSREP: gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)"); +connection node_2; CALL mtr.add_suppression("Action message in non-primary configuration from member 0"); +connection node_3; CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside"); CALL mtr.add_suppression("Action message in non-primary configuration from member 0"); +connection node_4; CALL mtr.add_suppression("Action message in non-primary configuration from member 0"); diff --git a/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result b/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result index 06fc27ae7ed8e..5324d1c11ddc0 100644 --- a/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result +++ b/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result @@ -1,7 +1,9 @@ +connection node_1; CREATE TABLE ten (f1 INTEGER); INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; +connection node_2; SET GLOBAL wsrep_desync = TRUE; SET SESSION wsrep_on = FALSE; ALTER TABLE t1 ADD PRIMARY KEY (f1); @@ -14,6 +16,7 @@ COUNT(*) = 200000 SELECT MAX(f1) = 199999 FROM t1; MAX(f1) = 199999 1 +connection node_1; SELECT COUNT(*) = 200000 FROM t1; COUNT(*) = 200000 1 @@ -25,8 +28,10 @@ SET SESSION wsrep_on = FALSE; ALTER TABLE t1 ADD PRIMARY KEY (f1); SET SESSION wsrep_on = TRUE; SET GLOBAL wsrep_desync = FALSE; +connection node_2; INSERT INTO t1 (f1) VALUES (1); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +connection node_1; INSERT INTO t1 (f1) VALUES (100); ERROR 23000: Duplicate entry '100' for key 'PRIMARY' DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_sync_wait_show.test b/mysql-test/suite/galera/t/galera_sync_wait_show.test index 250b1f76e98ad..3707b7ebaf16d 100644 --- a/mysql-test/suite/galera/t/galera_sync_wait_show.test +++ b/mysql-test/suite/galera/t/galera_sync_wait_show.test @@ -57,6 +57,7 @@ CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a'; --connection node_2 +--replace_column 7 # SHOW CREATE TRIGGER tr1; DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/galera_wan_restart_ist.test b/mysql-test/suite/galera/t/galera_wan_restart_ist.test index 42f63df3acc63..1cf5d4c7f74ee 100644 --- a/mysql-test/suite/galera/t/galera_wan_restart_ist.test +++ b/mysql-test/suite/galera/t/galera_wan_restart_ist.test @@ -12,6 +12,16 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 +--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4 + +# Save original auto_increment_offset values. +--let $node_1=node_1 +--let $node_2=node_2 +--let $node_3=node_3 +--let $node_4=node_4 +--source include/auto_increment_offset_save.inc + SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; --connection node_1 @@ -21,11 +31,9 @@ INSERT INTO t1 VALUES (1); --connection node_2 INSERT INTO t1 VALUES (2); ---connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 --connection node_3 INSERT INTO t1 VALUES (3); ---connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4 --connection node_4 INSERT INTO t1 VALUES (4); @@ -146,3 +154,8 @@ CALL mtr.add_suppression("Action message in non-primary configuration from membe --connection node_4 CALL mtr.add_suppression("Action message in non-primary configuration from member 0"); + +# Restore original auto_increment_offset values. +--source include/auto_increment_offset_restore.inc + +--source include/galera_end.inc diff --git a/mysql-test/suite/galera_3nodes/disabled.def b/mysql-test/suite/galera_3nodes/disabled.def index fb23a81bfb8b8..ca55c41ff72f4 100644 --- a/mysql-test/suite/galera_3nodes/disabled.def +++ b/mysql-test/suite/galera_3nodes/disabled.def @@ -3,3 +3,5 @@ galera_evs_suspect_timeout : TODO: investigate galera_innobackupex_backup : TODO: investigate galera_slave_options_do :MDEV-8798 galera_slave_options_ignore : MDEV-8798 +galera_pc_bootstrap : TODO: Investigate: Timeout in wait_condition.inc +galera_pc_weight : Test times out diff --git a/plugin/wsrep_info/mysql-test/wsrep_info/r/plugin.result b/plugin/wsrep_info/mysql-test/wsrep_info/r/plugin.result index 1aef7c30fc773..12baf6c941b39 100644 --- a/plugin/wsrep_info/mysql-test/wsrep_info/r/plugin.result +++ b/plugin/wsrep_info/mysql-test/wsrep_info/r/plugin.result @@ -1,4 +1,5 @@ # On node 1 +connection node_1; SELECT * FROM INFORMATION_SCHEMA.WSREP_STATUS; NODE_INDEX NODE_STATUS CLUSTER_STATUS CLUSTER_SIZE CLUSTER_STATE_UUID CLUSTER_STATE_SEQNO CLUSTER_CONF_ID GAP PROTOCOL_VERSION Synced Primary 2 0 2 NO 3 @@ -7,6 +8,7 @@ INDEX UUID NAME ADDRESS test-node-1
test-node-2
# On node 2 +connection node_2; SELECT * FROM INFORMATION_SCHEMA.WSREP_STATUS; NODE_INDEX NODE_STATUS CLUSTER_STATUS CLUSTER_SIZE CLUSTER_STATE_UUID CLUSTER_STATE_SEQNO CLUSTER_CONF_ID GAP PROTOCOL_VERSION Synced Primary 2 0 2 YES 3 @@ -14,4 +16,6 @@ SELECT * FROM INFORMATION_SCHEMA.WSREP_MEMBERSHIP ORDER BY NAME; INDEX UUID NAME ADDRESS test-node-1
test-node-2
+disconnect node_2; +disconnect node_1; # End of test From f8b4015459375857b7ced2f0553ba32dc05276fa Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 29 Sep 2016 11:50:13 +0200 Subject: [PATCH 54/71] init plugin psi keys before LOCK_plugin --- sql/sql_plugin.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 2fd0ea341f4c5..58d6ff4cd00ca 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -1543,10 +1543,6 @@ int plugin_init(int *argc, char **argv, int flags) dlopen_count =0; -#ifdef HAVE_PSI_INTERFACE - init_plugin_psi_keys(); -#endif - init_alloc_root(&plugin_mem_root, 4096, 4096, MYF(0)); init_alloc_root(&plugin_vars_mem_root, 4096, 4096, MYF(0)); init_alloc_root(&tmp_root, 4096, 4096, MYF(0)); @@ -4288,6 +4284,9 @@ int thd_setspecific(MYSQL_THD thd, MYSQL_THD_KEY_T key, void *value) void plugin_mutex_init() { +#ifdef HAVE_PSI_INTERFACE + init_plugin_psi_keys(); +#endif mysql_mutex_init(key_LOCK_plugin, &LOCK_plugin, MY_MUTEX_INIT_FAST); } From 90c5b2f505855c13e0bdc2e73e11fa83983712bd Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Sat, 8 Oct 2016 14:20:06 +0200 Subject: [PATCH 55/71] MDEV-10982 - Show real version number in 'ready for connections' message --- sql/mysqld.cc | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 1dd49d44b6291..e7fb7b7e0c9b2 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6027,11 +6027,26 @@ int mysqld_main(int argc, char **argv) } disable_log_notes= 0; /* Startup done, now we can give notes again */ - sql_print_information(ER_DEFAULT(ER_STARTUP),my_progname,server_version, - ((mysql_socket_getfd(unix_sock) == INVALID_SOCKET) ? - (char*) "" : mysqld_unix_port), - mysqld_port, - MYSQL_COMPILATION_COMMENT); + + if (IS_SYSVAR_AUTOSIZE(&server_version_ptr)) + sql_print_information(ER_DEFAULT(ER_STARTUP), my_progname, server_version, + ((mysql_socket_getfd(unix_sock) == INVALID_SOCKET) ? + (char*) "" : mysqld_unix_port), + mysqld_port, MYSQL_COMPILATION_COMMENT); + else + { + char real_server_version[2 * SERVER_VERSION_LENGTH + 10]; + + set_server_version(real_server_version, sizeof(real_server_version)); + strcat(real_server_version, "' as '"); + strcat(real_server_version, server_version); + + sql_print_information(ER_DEFAULT(ER_STARTUP), my_progname, + real_server_version, + ((mysql_socket_getfd(unix_sock) == INVALID_SOCKET) ? + (char*) "" : mysqld_unix_port), + mysqld_port, MYSQL_COMPILATION_COMMENT); + } // try to keep fd=0 busy if (!freopen(IF_WIN("NUL","/dev/null"), "r", stdin)) From 0259b3cbbe47448beb385a33348af56300004aa6 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 8 Nov 2016 20:57:19 +0400 Subject: [PATCH 56/71] MDEV-11255 LDML: allow defining 2-level UCA collations --- mysql-test/r/ctype_ldml.result | 1708 +++++++++++++++++ mysql-test/std_data/ldml/Index.xml | 39 + .../suite/innodb/r/innodb_ctype_ldml.result | 6 + mysql-test/t/ctype_ldml.test | 103 + mysys/charset.c | 45 +- strings/ctype-uca.c | 187 +- strings/ctype.c | 2 + 7 files changed, 2000 insertions(+), 90 deletions(-) diff --git a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result index 34e862d022293..237646ade7767 100644 --- a/mysql-test/r/ctype_ldml.result +++ b/mysql-test/r/ctype_ldml.result @@ -483,6 +483,9 @@ ucs2_vn_ci ucs2 359 8 ucs2_5624_1 ucs2 360 8 utf8_5624_5 utf8 368 8 utf8_5624_5_bad utf8 369 8 +utf8_czech_test_w2 utf8 370 4 +utf8_czech_test_nopad_w2 utf8 371 4 +utf8_czech_test_bad_w2 utf8 372 4 utf32_test_ci utf32 391 8 utf8_maxuserid_ci utf8 2047 8 show collation like '%test%'; @@ -491,6 +494,9 @@ latin1_test latin1 99 Yes 1 latin1_test2 latin1 332 1 latin1_test2_cs latin1 333 1 utf8_test_ci utf8 353 8 +utf8_czech_test_w2 utf8 370 4 +utf8_czech_test_nopad_w2 utf8 371 4 +utf8_czech_test_bad_w2 utf8 372 4 ucs2_test_ci ucs2 358 8 utf8mb4_test_ci utf8mb4 326 8 utf8mb4_test_400_ci utf8mb4 328 8 @@ -1326,3 +1332,1705 @@ HEX(a) REPLACE(a,' ','') 6120 a 61 a DROP TABLE t1; +SET NAMES utf8 COLLATE utf8_czech_test_w2; +CREATE TABLE t1 AS SELECT SPACE(10) AS c1 LIMIT 0; +insert into t1 values ('A'),('a'); +insert into t1 values ('B'),('b'); +insert into t1 values ('C'),('c'); +insert into t1 values ('D'),('d'); +insert into t1 values ('E'),('e'); +insert into t1 values ('F'),('f'); +insert into t1 values ('G'),('g'); +insert into t1 values ('H'),('h'); +insert into t1 values ('I'),('i'); +insert into t1 values ('J'),('j'); +insert into t1 values ('K'),('k'); +insert into t1 values ('L'),('l'); +insert into t1 values ('M'),('m'); +insert into t1 values ('N'),('n'); +insert into t1 values ('O'),('o'); +insert into t1 values ('P'),('p'); +insert into t1 values ('Q'),('q'); +insert into t1 values ('R'),('r'); +insert into t1 values ('S'),('s'); +insert into t1 values ('T'),('t'); +insert into t1 values ('U'),('u'); +insert into t1 values ('V'),('v'); +insert into t1 values ('W'),('w'); +insert into t1 values ('X'),('x'); +insert into t1 values ('Y'),('y'); +insert into t1 values ('Z'),('z'); +insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0); +insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1); +insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2); +insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3); +insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4); +insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5); +insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6); +insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7); +insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8); +insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9); +insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca); +insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb); +insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc); +insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd); +insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce); +insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf); +insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0); +insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1); +insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2); +insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3); +insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4); +insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5); +insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6); +insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7); +insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8); +insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9); +insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da); +insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db); +insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc); +insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd); +insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de); +insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df); +insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103); +insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107); +insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b); +insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f); +insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113); +insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117); +insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b); +insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f); +insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123); +insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127); +insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b); +insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f); +insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133); +insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137); +insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b); +insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f); +insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143); +insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147); +insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b); +insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f); +insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153); +insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157); +insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b); +insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f); +insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163); +insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167); +insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b); +insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f); +insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173); +insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177); +insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b); +insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f); +insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183); +insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187); +insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b); +insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f); +insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193); +insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197); +insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b); +insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f); +insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3); +insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7); +insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab); +insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af); +insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3); +insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7); +insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb); +insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf); +insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3); +insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7); +insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb); +insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf); +insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3); +insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7); +insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db); +insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df); +insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3); +insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7); +insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb); +insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef); +insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3); +insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7); +insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb); +insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff); +INSERT INTO t1 VALUES (_ucs2 0x1EA0),(_ucs2 0x1EA1),(_ucs2 0x1EA2),(_ucs2 0x1EA3); +INSERT INTO t1 VALUES (_ucs2 0x1EA4),(_ucs2 0x1EA5),(_ucs2 0x1EA6),(_ucs2 0x1EA7); +INSERT INTO t1 VALUES (_ucs2 0x1EA8),(_ucs2 0x1EA9),(_ucs2 0x1EAA),(_ucs2 0x1EAB); +INSERT INTO t1 VALUES (_ucs2 0x1EAC),(_ucs2 0x1EAD),(_ucs2 0x1EAE),(_ucs2 0x1EAF); +INSERT INTO t1 VALUES (_ucs2 0x1EB0),(_ucs2 0x1EB1),(_ucs2 0x1EB2),(_ucs2 0x1EB3); +INSERT INTO t1 VALUES (_ucs2 0x1EB4),(_ucs2 0x1EB5),(_ucs2 0x1EB6),(_ucs2 0x1EB7); +INSERT INTO t1 VALUES (_ucs2 0x1EB8),(_ucs2 0x1EB9),(_ucs2 0x1EBA),(_ucs2 0x1EBB); +INSERT INTO t1 VALUES (_ucs2 0x1EBC),(_ucs2 0x1EBD),(_ucs2 0x1EBE),(_ucs2 0x1EBF); +INSERT INTO t1 VALUES (_ucs2 0x1EC0),(_ucs2 0x1EC1),(_ucs2 0x1EC2),(_ucs2 0x1EC3); +INSERT INTO t1 VALUES (_ucs2 0x1EC4),(_ucs2 0x1EC5),(_ucs2 0x1EC6),(_ucs2 0x1EC7); +INSERT INTO t1 VALUES (_ucs2 0x1EC8),(_ucs2 0x1EC9),(_ucs2 0x1ECA),(_ucs2 0x1ECB); +INSERT INTO t1 VALUES (_ucs2 0x1ECC),(_ucs2 0x1ECD),(_ucs2 0x1ECE),(_ucs2 0x1ECF); +INSERT INTO t1 VALUES (_ucs2 0x1ED0),(_ucs2 0x1ED1),(_ucs2 0x1ED2),(_ucs2 0x1ED3); +INSERT INTO t1 VALUES (_ucs2 0x1ED4),(_ucs2 0x1ED5),(_ucs2 0x1ED6),(_ucs2 0x1ED7); +INSERT INTO t1 VALUES (_ucs2 0x1ED8),(_ucs2 0x1ED9),(_ucs2 0x1EDA),(_ucs2 0x1EDB); +INSERT INTO t1 VALUES (_ucs2 0x1EDC),(_ucs2 0x1EDD),(_ucs2 0x1EDE),(_ucs2 0x1EDF); +INSERT INTO t1 VALUES (_ucs2 0x1EE0),(_ucs2 0x1EE1),(_ucs2 0x1EE2),(_ucs2 0x1EE3); +INSERT INTO t1 VALUES (_ucs2 0x1EE4),(_ucs2 0x1EE5),(_ucs2 0x1EE6),(_ucs2 0x1EE7); +INSERT INTO t1 VALUES (_ucs2 0x1EE8),(_ucs2 0x1EE9),(_ucs2 0x1EEA),(_ucs2 0x1EEB); +INSERT INTO t1 VALUES (_ucs2 0x1EEC),(_ucs2 0x1EED),(_ucs2 0x1EEE),(_ucs2 0x1EEF); +INSERT INTO t1 VALUES (_ucs2 0x1EF0),(_ucs2 0x1EF1); +insert into t1 values ('AA'),('Aa'),('aa'),('aA'); +insert into t1 values ('AE'),('Ae'),('ae'),('aE'); +insert into t1 values ('CH'),('Ch'),('ch'),('cH'); +insert into t1 values ('DZ'),('Dz'),('dz'),('dZ'); +insert into t1 values ('DŽ'),('Dž'),('dž'),('dŽ'); +insert into t1 values ('IJ'),('Ij'),('ij'),('iJ'); +insert into t1 values ('LJ'),('Lj'),('lj'),('lJ'); +insert into t1 values ('LL'),('Ll'),('ll'),('lL'); +insert into t1 values ('NJ'),('Nj'),('nj'),('nJ'); +insert into t1 values ('OE'),('Oe'),('oe'),('oE'); +insert into t1 values ('SS'),('Ss'),('ss'),('sS'); +insert into t1 values ('RR'),('Rr'),('rr'),('rR'); +INSERT INTO t1 VALUES ('a '); +SELECT c1, HEX(WEIGHT_STRING(c1 LEVEL 1)), HEX(WEIGHT_STRING(c1 LEVEL 2)) FROM t1 ORDER BY c1, BINARY c1; +c1 HEX(WEIGHT_STRING(c1 LEVEL 1)) HEX(WEIGHT_STRING(c1 LEVEL 2)) +÷ 0552 0020 +× 0553 0020 +A 120F 0020 +a 120F 0020 +a 120F020A 00200020 +Á 120F 00200032 +á 120F 00200032 +À 120F 00200035 +à 120F 00200035 +Ă 120F 00200037 +ă 120F 00200037 +Ắ 120F 002000370032 +ắ 120F 002000370032 +Ằ 120F 002000370035 +ằ 120F 002000370035 +Ẵ 120F 00200037004E +ẵ 120F 00200037004E +Ẳ 120F 002000370064 +ẳ 120F 002000370064 + 120F 0020003C +â 120F 0020003C +Ấ 120F 0020003C0032 +ấ 120F 0020003C0032 +Ầ 120F 0020003C0035 +ầ 120F 0020003C0035 +Ẫ 120F 0020003C004E +ẫ 120F 0020003C004E +Ẩ 120F 0020003C0064 +ẩ 120F 0020003C0064 +Ǎ 120F 00200041 +ǎ 120F 00200041 +Å 120F 00200043 +å 120F 00200043 +Ǻ 120F 002000430032 +ǻ 120F 002000430032 +Ä 120F 00200047 +ä 120F 00200047 +Ǟ 120F 00200047005B +ǟ 120F 00200047005B +à 120F 0020004E +ã 120F 0020004E +Ǡ 120F 00200052005B +ǡ 120F 00200052005B +Ą 120F 00200059 +ą 120F 00200059 +Ā 120F 0020005B +ā 120F 0020005B +Ả 120F 00200064 +ả 120F 00200064 +Ạ 120F 00200070 +ạ 120F 00200070 +Ặ 120F 002000700037 +ặ 120F 002000700037 +Ậ 120F 00200070003C +ậ 120F 00200070003C +AA 120F120F 00200020 +Aa 120F120F 00200020 +aA 120F120F 00200020 +aa 120F120F 00200020 +AE 120F126B 00200020 +Ae 120F126B 00200020 +aE 120F126B 00200020 +ae 120F126B 00200020 +Æ 120F126B 002001590020 +æ 120F126B 002001590020 +Ǽ 120F126B 0020015900200032 +ǽ 120F126B 0020015900200032 +Ǣ 120F126B 002001590020005B +ǣ 120F126B 002001590020005B +B 1225 0020 +b 1225 0020 +ƀ 122D 0020 +Ɓ 1235 0020 +Ƃ 1239 0020 +ƃ 1239 0020 +C 123D 0020 +c 123D 0020 +Ć 123D 00200032 +ć 123D 00200032 +Ĉ 123D 0020003C +ĉ 123D 0020003C +Ċ 123D 00200052 +ċ 123D 00200052 +Ç 123D 00200056 +ç 123D 00200056 +cH 123D12D3 00200020 +Č 123E 0020 +č 123E 0020 +Ƈ 1246 0020 +ƈ 1246 0020 +D 1250 0020 +d 1250 0020 +Ď 1250 00200041 +ď 1250 00200041 +Đ 1250 0020007D +đ 1250 0020007D +Ð 1250 00200159 +ð 1250 00200159 +DZ 125014AD 00200020 +Dz 125014AD 00200020 +dZ 125014AD 00200020 +dz 125014AD 00200020 +DZ 125014AD 00200020 +Dz 125014AD 00200020 +dz 125014AD 00200020 +DŽ 125014AD 002000200041 +Dž 125014AD 002000200041 +dž 125014AD 002000200041 +DŽ 125014AE 00200020 +Dž 125014AE 00200020 +dŽ 125014AE 00200020 +dž 125014AE 00200020 +Ɖ 1258 0020 +Ɗ 125C 0020 +Ƌ 1261 0020 +ƌ 1261 0020 +E 126B 0020 +e 126B 0020 +É 126B 00200032 +é 126B 00200032 +È 126B 00200035 +è 126B 00200035 +Ĕ 126B 00200037 +ĕ 126B 00200037 +Ê 126B 0020003C +ê 126B 0020003C +Ế 126B 0020003C0032 +ế 126B 0020003C0032 +Ề 126B 0020003C0035 +ề 126B 0020003C0035 +Ễ 126B 0020003C004E +ễ 126B 0020003C004E +Ể 126B 0020003C0064 +ể 126B 0020003C0064 +Ě 126B 00200041 +ě 126B 00200041 +Ë 126B 00200047 +ë 126B 00200047 +Ẽ 126B 0020004E +ẽ 126B 0020004E +Ė 126B 00200052 +ė 126B 00200052 +Ę 126B 00200059 +ę 126B 00200059 +Ē 126B 0020005B +ē 126B 0020005B +Ẻ 126B 00200064 +ẻ 126B 00200064 +Ẹ 126B 00200070 +ẹ 126B 00200070 +Ệ 126B 00200070003C +ệ 126B 00200070003C +Ǝ 1276 0020 +ǝ 1276 0020 +Ə 127B 0020 +Ɛ 1280 0020 +F 12A3 0020 +f 12A3 0020 +Ƒ 12AA 0020 +ƒ 12AA 0020 +G 12B0 0020 +g 12B0 0020 +Ǵ 12B0 00200032 +ǵ 12B0 00200032 +Ğ 12B0 00200037 +ğ 12B0 00200037 +Ĝ 12B0 0020003C +ĝ 12B0 0020003C +Ǧ 12B0 00200041 +ǧ 12B0 00200041 +Ġ 12B0 00200052 +ġ 12B0 00200052 +Ģ 12B0 00200056 +ģ 12B0 00200056 +Ǥ 12BC 0020 +ǥ 12BC 0020 +Ɠ 12C1 0020 +Ɣ 12CB 0020 +Ƣ 12CF 0020 +ƣ 12CF 0020 +H 12D3 0020 +h 12D3 0020 +Ĥ 12D3 0020003C +ĥ 12D3 0020003C +Ħ 12D3 0020007D +ħ 12D3 0020007D +CH 12D4 0020 +Ch 12D4 0020 +ch 12D4 0020 +ƕ 12DB 0020 +Ƕ 12DB 0020 +I 12EC 0020 +i 12EC 0020 +Í 12EC 00200032 +í 12EC 00200032 +Ì 12EC 00200035 +ì 12EC 00200035 +Ĭ 12EC 00200037 +ĭ 12EC 00200037 +Î 12EC 0020003C +î 12EC 0020003C +Ǐ 12EC 00200041 +ǐ 12EC 00200041 +Ï 12EC 00200047 +ï 12EC 00200047 +Ĩ 12EC 0020004E +ĩ 12EC 0020004E +İ 12EC 00200052 +Į 12EC 00200059 +į 12EC 00200059 +Ī 12EC 0020005B +ī 12EC 0020005B +Ỉ 12EC 00200064 +ỉ 12EC 00200064 +Ị 12EC 00200070 +ị 12EC 00200070 +IJ 12EC1305 00200020 +Ij 12EC1305 00200020 +iJ 12EC1305 00200020 +ij 12EC1305 00200020 +IJ 12EC1305 00200020 +ij 12EC1305 00200020 +ı 12F0 0020 +Ɨ 12FA 0020 +Ɩ 1300 0020 +J 1305 0020 +j 1305 0020 +Ĵ 1305 0020003C +ĵ 1305 0020003C +ǰ 1305 00200041 +K 131E 0020 +k 131E 0020 +Ǩ 131E 00200041 +ǩ 131E 00200041 +Ķ 131E 00200056 +ķ 131E 00200056 +Ƙ 1324 0020 +ƙ 1324 0020 +L 1330 0020 +l 1330 0020 +Ĺ 1330 00200032 +ĺ 1330 00200032 +Ľ 1330 00200041 +ľ 1330 00200041 +Ļ 1330 00200056 +ļ 1330 00200056 +Ł 1330 0020007D +ł 1330 0020007D +Ŀ 1330 00200159 +ŀ 1330 00200159 +LJ 13301305 00200020 +Lj 13301305 00200020 +lJ 13301305 00200020 +lj 13301305 00200020 +LJ 13301305 00200020 +Lj 13301305 00200020 +lj 13301305 00200020 +LL 13301330 00200020 +Ll 13301330 00200020 +lL 13301330 00200020 +ll 13301330 00200020 +ƚ 133B 0020 +ƛ 1357 0020 +M 135F 0020 +m 135F 0020 +N 136D 0020 +n 136D 0020 +Ń 136D 00200032 +ń 136D 00200032 +Ǹ 136D 00200035 +ǹ 136D 00200035 +Ň 136D 00200041 +ň 136D 00200041 +Ñ 136D 0020004E +ñ 136D 0020004E +Ņ 136D 00200056 +ņ 136D 00200056 +NJ 136D1305 00200020 +Nj 136D1305 00200020 +nJ 136D1305 00200020 +nj 136D1305 00200020 +NJ 136D1305 00200020 +Nj 136D1305 00200020 +nj 136D1305 00200020 +Ɲ 1378 0020 +ƞ 137C 0020 +Ŋ 138A 0020 +ŋ 138A 0020 +O 138E 0020 +o 138E 0020 +Ó 138E 00200032 +ó 138E 00200032 +Ò 138E 00200035 +ò 138E 00200035 +Ŏ 138E 00200037 +ŏ 138E 00200037 +Ô 138E 0020003C +ô 138E 0020003C +Ố 138E 0020003C0032 +ố 138E 0020003C0032 +Ồ 138E 0020003C0035 +ồ 138E 0020003C0035 +Ỗ 138E 0020003C004E +ỗ 138E 0020003C004E +Ổ 138E 0020003C0064 +ổ 138E 0020003C0064 +Ǒ 138E 00200041 +ǒ 138E 00200041 +Ö 138E 00200047 +ö 138E 00200047 +Ő 138E 0020004D +ő 138E 0020004D +Õ 138E 0020004E +õ 138E 0020004E +Ø 138E 00200054 +ø 138E 00200054 +Ǿ 138E 002000540032 +ǿ 138E 002000540032 +Ǫ 138E 00200059 +ǫ 138E 00200059 +Ǭ 138E 00200059005B +ǭ 138E 00200059005B +Ō 138E 0020005B +ō 138E 0020005B +Ỏ 138E 00200064 +ỏ 138E 00200064 +Ơ 138E 00200068 +ơ 138E 00200068 +Ớ 138E 002000680032 +ớ 138E 002000680032 +Ờ 138E 002000680035 +ờ 138E 002000680035 +Ỡ 138E 00200068004E +ỡ 138E 00200068004E +Ở 138E 002000680064 +ở 138E 002000680064 +Ợ 138E 002000680070 +ợ 138E 002000680070 +Ọ 138E 00200070 +ọ 138E 00200070 +Ộ 138E 00200070003C +ộ 138E 00200070003C +OE 138E126B 00200020 +Oe 138E126B 00200020 +oE 138E126B 00200020 +oe 138E126B 00200020 +Œ 138E126B 002001590020 +œ 138E126B 002001590020 +Ɔ 139A 0020 +Ɵ 13A5 0020 +P 13B3 0020 +p 13B3 0020 +Ƥ 13BC 0020 +ƥ 13BC 0020 +Q 13C8 0020 +q 13C8 0020 +ĸ 13D6 0020 +R 13DA 0020 +r 13DA 0020 +Ŕ 13DA 00200032 +ŕ 13DA 00200032 +Ŗ 13DA 00200056 +ŗ 13DA 00200056 +RR 13DA13DA 00200020 +Rr 13DA13DA 00200020 +rR 13DA13DA 00200020 +rr 13DA13DA 00200020 +Ř 13DB 0020 +ř 13DB 0020 +Ʀ 13DE 0020 +S 1410 0020 +s 1410 0020 +Ś 1410 00200032 +ś 1410 00200032 +Ŝ 1410 0020003C +ŝ 1410 0020003C +Ş 1410 00200056 +ş 1410 00200056 +ſ 1410 0020015A +SS 14101410 00200020 +Ss 14101410 00200020 +sS 14101410 00200020 +ss 14101410 00200020 +ß 14101410 002001590020 +Š 1411 0020 +š 1411 0020 +Ʃ 1421 0020 +ƪ 1426 0020 +T 1433 0020 +t 1433 0020 +Ť 1433 00200041 +ť 1433 00200041 +Ţ 1433 00200056 +ţ 1433 00200056 +ƾ 14331410 00200020 +Ŧ 1438 0020 +ŧ 1438 0020 +ƫ 143E 0020 +Ƭ 1442 0020 +ƭ 1442 0020 +Ʈ 1446 0020 +U 1453 0020 +u 1453 0020 +Ú 1453 00200032 +ú 1453 00200032 +Ù 1453 00200035 +ù 1453 00200035 +Ŭ 1453 00200037 +ŭ 1453 00200037 +Û 1453 0020003C +û 1453 0020003C +Ǔ 1453 00200041 +ǔ 1453 00200041 +Ů 1453 00200043 +ů 1453 00200043 +Ü 1453 00200047 +ü 1453 00200047 +Ǘ 1453 002000470032 +ǘ 1453 002000470032 +Ǜ 1453 002000470035 +ǜ 1453 002000470035 +Ǚ 1453 002000470041 +ǚ 1453 002000470041 +Ǖ 1453 00200047005B +ǖ 1453 00200047005B +Ű 1453 0020004D +ű 1453 0020004D +Ũ 1453 0020004E +ũ 1453 0020004E +Ų 1453 00200059 +ų 1453 00200059 +Ū 1453 0020005B +ū 1453 0020005B +Ủ 1453 00200064 +ủ 1453 00200064 +Ư 1453 00200068 +ư 1453 00200068 +Ứ 1453 002000680032 +ứ 1453 002000680032 +Ừ 1453 002000680035 +ừ 1453 002000680035 +Ữ 1453 00200068004E +ữ 1453 00200068004E +Ử 1453 002000680064 +ử 1453 002000680064 +Ự 1453 002000680070 +ự 1453 002000680070 +Ụ 1453 00200070 +ụ 1453 00200070 +Ɯ 146D 0020 +Ʊ 1476 0020 +V 147B 0020 +v 147B 0020 +Ʋ 1482 0020 +W 148D 0020 +w 148D 0020 +Ŵ 148D 0020003C +ŵ 148D 0020003C +X 1497 0020 +x 1497 0020 +Y 149C 0020 +y 149C 0020 +Ý 149C 00200032 +ý 149C 00200032 +Ŷ 149C 0020003C +ŷ 149C 0020003C +ÿ 149C 00200047 +Ÿ 149C 00200047 +Ƴ 14A8 0020 +ƴ 14A8 0020 +Z 14AD 0020 +z 14AD 0020 +Ź 14AD 00200032 +ź 14AD 00200032 +Ż 14AD 00200052 +ż 14AD 00200052 +ƍ 14AD148D 00200020 +Ž 14AE 0020 +ž 14AE 0020 +Ƶ 14B2 0020 +ƶ 14B2 0020 +Ʒ 14CA 0020 +Ǯ 14CA 00200041 +ǯ 14CA 00200041 +Ƹ 14CF 0020 +ƹ 14CF 0020 +ƺ 14D4 0020 +Þ 14E0 0020 +þ 14E0 0020 +ƿ 14E6 0020 +Ƿ 14E6 0020 +ƻ 14EF 0020 +Ƨ 14F6 0020 +ƨ 14F6 0020 +Ƽ 14FA 0020 +ƽ 14FA 0020 +Ƅ 14FE 0020 +ƅ 14FE 0020 +ʼn 150B136D 00200020 +ǀ 1525 0020 +ǁ 1529 0020 +ǂ 152D 0020 +ǃ 1531 0020 +SELECT c1, HEX(WEIGHT_STRING(c1 AS CHAR(3) LEVEL 1)), HEX(WEIGHT_STRING(c1 AS CHAR(3) LEVEL 2)) FROM t1 WHERE c1 BETWEEN 'a' AND 'aZ' ORDER BY c1, BINARY c1; +c1 HEX(WEIGHT_STRING(c1 AS CHAR(3) LEVEL 1)) HEX(WEIGHT_STRING(c1 AS CHAR(3) LEVEL 2)) +A 120F020A020A 002000200020 +a 120F020A020A 002000200020 +a 120F020A020A 002000200020 +Á 120F020A020A 002000320020 +á 120F020A020A 002000320020 +À 120F020A020A 002000350020 +à 120F020A020A 002000350020 +Ă 120F020A020A 002000370020 +ă 120F020A020A 002000370020 +Ắ 120F020A020A 002000370032 +ắ 120F020A020A 002000370032 +Ằ 120F020A020A 002000370035 +ằ 120F020A020A 002000370035 +Ẵ 120F020A020A 00200037004E +ẵ 120F020A020A 00200037004E +Ẳ 120F020A020A 002000370064 +ẳ 120F020A020A 002000370064 + 120F020A020A 0020003C0020 +â 120F020A020A 0020003C0020 +Ấ 120F020A020A 0020003C0032 +ấ 120F020A020A 0020003C0032 +Ầ 120F020A020A 0020003C0035 +ầ 120F020A020A 0020003C0035 +Ẫ 120F020A020A 0020003C004E +ẫ 120F020A020A 0020003C004E +Ẩ 120F020A020A 0020003C0064 +ẩ 120F020A020A 0020003C0064 +Ǎ 120F020A020A 002000410020 +ǎ 120F020A020A 002000410020 +Å 120F020A020A 002000430020 +å 120F020A020A 002000430020 +Ǻ 120F020A020A 002000430032 +ǻ 120F020A020A 002000430032 +Ä 120F020A020A 002000470020 +ä 120F020A020A 002000470020 +Ǟ 120F020A020A 00200047005B +ǟ 120F020A020A 00200047005B +à 120F020A020A 0020004E0020 +ã 120F020A020A 0020004E0020 +Ǡ 120F020A020A 00200052005B +ǡ 120F020A020A 00200052005B +Ą 120F020A020A 002000590020 +ą 120F020A020A 002000590020 +Ā 120F020A020A 0020005B0020 +ā 120F020A020A 0020005B0020 +Ả 120F020A020A 002000640020 +ả 120F020A020A 002000640020 +Ạ 120F020A020A 002000700020 +ạ 120F020A020A 002000700020 +Ặ 120F020A020A 002000700037 +ặ 120F020A020A 002000700037 +Ậ 120F020A020A 00200070003C +ậ 120F020A020A 00200070003C +AA 120F120F020A 002000200020 +Aa 120F120F020A 002000200020 +aA 120F120F020A 002000200020 +aa 120F120F020A 002000200020 +AE 120F126B020A 002000200020 +Ae 120F126B020A 002000200020 +aE 120F126B020A 002000200020 +ae 120F126B020A 002000200020 +Æ 120F126B020A 002001590020 +æ 120F126B020A 002001590020 +Ǽ 120F126B020A 002001590020 +ǽ 120F126B020A 002001590020 +Ǣ 120F126B020A 002001590020 +ǣ 120F126B020A 002001590020 +DROP TABLE t1; +SELECT 'a' = 'a '; +'a' = 'a ' +1 +SELECT 'a' < 'á'; +'a' < 'á' +1 +SELECT 'áa' < 'ab'; +'áa' < 'ab' +1 +SELECT 'á' < 'ä'; +'á' < 'ä' +1 +SELECT 'äa' < 'áb'; +'äa' < 'áb' +1 +SELECT 'c' < 'č'; +'c' < 'č' +1 +SELECT 'cb' < 'ča'; +'cb' < 'ča' +1 +SELECT 'd' < 'ď'; +'d' < 'ď' +1 +SELECT 'ďa' < 'db'; +'ďa' < 'db' +1 +SELECT 'e' < 'é'; +'e' < 'é' +1 +SELECT 'éa' < 'eb'; +'éa' < 'eb' +1 +SELECT 'é' < 'ě'; +'é' < 'ě' +1 +SELECT 'ěa' < 'éb'; +'ěa' < 'éb' +1 +SELECT 'i' < 'í'; +'i' < 'í' +1 +SELECT 'ía' < 'ib'; +'ía' < 'ib' +1 +SELECT 'n' < 'ň'; +'n' < 'ň' +1 +SELECT 'ňa' < 'nb'; +'ňa' < 'nb' +1 +SELECT 'o' < 'ó'; +'o' < 'ó' +1 +SELECT 'óa' < 'ob'; +'óa' < 'ob' +1 +SELECT 'ó' < 'ö'; +'ó' < 'ö' +1 +SELECT 'öa' < 'ób'; +'öa' < 'ób' +1 +SELECT 'r' < 'ř'; +'r' < 'ř' +1 +SELECT 'rb' < 'řa'; +'rb' < 'řa' +1 +SELECT 's' < 'š'; +'s' < 'š' +1 +SELECT 'sb' < 'ša'; +'sb' < 'ša' +1 +SELECT 't' < 'ť'; +'t' < 'ť' +1 +SELECT 'ťa' < 'tb'; +'ťa' < 'tb' +1 +SELECT 'u' < 'ú'; +'u' < 'ú' +1 +SELECT 'úa' < 'ub'; +'úa' < 'ub' +1 +SELECT 'ú' < 'ů'; +'ú' < 'ů' +1 +SELECT 'ůa' < 'úb'; +'ůa' < 'úb' +1 +SELECT 'ů' < 'ü'; +'ů' < 'ü' +1 +SELECT 'üa' < 'ůb'; +'üa' < 'ůb' +1 +SELECT 'y' < 'ý'; +'y' < 'ý' +1 +SELECT 'ýa' < 'yb'; +'ýa' < 'yb' +1 +SELECT 'z' < 'ž'; +'z' < 'ž' +1 +SELECT 'zb' < 'ža'; +'zb' < 'ža' +1 +SELECT 'hž' < 'ch'; +'hž' < 'ch' +1 +SELECT 'chž'< 'i'; +'chž'< 'i' +1 +SET NAMES utf8 COLLATE utf8_czech_test_nopad_w2; +CREATE TABLE t1 AS SELECT SPACE(10) AS c1 LIMIT 0; +insert into t1 values ('A'),('a'); +insert into t1 values ('B'),('b'); +insert into t1 values ('C'),('c'); +insert into t1 values ('D'),('d'); +insert into t1 values ('E'),('e'); +insert into t1 values ('F'),('f'); +insert into t1 values ('G'),('g'); +insert into t1 values ('H'),('h'); +insert into t1 values ('I'),('i'); +insert into t1 values ('J'),('j'); +insert into t1 values ('K'),('k'); +insert into t1 values ('L'),('l'); +insert into t1 values ('M'),('m'); +insert into t1 values ('N'),('n'); +insert into t1 values ('O'),('o'); +insert into t1 values ('P'),('p'); +insert into t1 values ('Q'),('q'); +insert into t1 values ('R'),('r'); +insert into t1 values ('S'),('s'); +insert into t1 values ('T'),('t'); +insert into t1 values ('U'),('u'); +insert into t1 values ('V'),('v'); +insert into t1 values ('W'),('w'); +insert into t1 values ('X'),('x'); +insert into t1 values ('Y'),('y'); +insert into t1 values ('Z'),('z'); +insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0); +insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1); +insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2); +insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3); +insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4); +insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5); +insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6); +insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7); +insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8); +insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9); +insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca); +insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb); +insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc); +insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd); +insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce); +insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf); +insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0); +insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1); +insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2); +insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3); +insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4); +insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5); +insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6); +insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7); +insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8); +insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9); +insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da); +insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db); +insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc); +insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd); +insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de); +insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df); +insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103); +insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107); +insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b); +insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f); +insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113); +insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117); +insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b); +insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f); +insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123); +insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127); +insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b); +insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f); +insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133); +insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137); +insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b); +insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f); +insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143); +insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147); +insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b); +insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f); +insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153); +insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157); +insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b); +insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f); +insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163); +insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167); +insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b); +insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f); +insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173); +insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177); +insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b); +insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f); +insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183); +insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187); +insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b); +insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f); +insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193); +insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197); +insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b); +insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f); +insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3); +insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7); +insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab); +insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af); +insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3); +insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7); +insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb); +insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf); +insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3); +insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7); +insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb); +insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf); +insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3); +insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7); +insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db); +insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df); +insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3); +insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7); +insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb); +insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef); +insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3); +insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7); +insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb); +insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff); +INSERT INTO t1 VALUES (_ucs2 0x1EA0),(_ucs2 0x1EA1),(_ucs2 0x1EA2),(_ucs2 0x1EA3); +INSERT INTO t1 VALUES (_ucs2 0x1EA4),(_ucs2 0x1EA5),(_ucs2 0x1EA6),(_ucs2 0x1EA7); +INSERT INTO t1 VALUES (_ucs2 0x1EA8),(_ucs2 0x1EA9),(_ucs2 0x1EAA),(_ucs2 0x1EAB); +INSERT INTO t1 VALUES (_ucs2 0x1EAC),(_ucs2 0x1EAD),(_ucs2 0x1EAE),(_ucs2 0x1EAF); +INSERT INTO t1 VALUES (_ucs2 0x1EB0),(_ucs2 0x1EB1),(_ucs2 0x1EB2),(_ucs2 0x1EB3); +INSERT INTO t1 VALUES (_ucs2 0x1EB4),(_ucs2 0x1EB5),(_ucs2 0x1EB6),(_ucs2 0x1EB7); +INSERT INTO t1 VALUES (_ucs2 0x1EB8),(_ucs2 0x1EB9),(_ucs2 0x1EBA),(_ucs2 0x1EBB); +INSERT INTO t1 VALUES (_ucs2 0x1EBC),(_ucs2 0x1EBD),(_ucs2 0x1EBE),(_ucs2 0x1EBF); +INSERT INTO t1 VALUES (_ucs2 0x1EC0),(_ucs2 0x1EC1),(_ucs2 0x1EC2),(_ucs2 0x1EC3); +INSERT INTO t1 VALUES (_ucs2 0x1EC4),(_ucs2 0x1EC5),(_ucs2 0x1EC6),(_ucs2 0x1EC7); +INSERT INTO t1 VALUES (_ucs2 0x1EC8),(_ucs2 0x1EC9),(_ucs2 0x1ECA),(_ucs2 0x1ECB); +INSERT INTO t1 VALUES (_ucs2 0x1ECC),(_ucs2 0x1ECD),(_ucs2 0x1ECE),(_ucs2 0x1ECF); +INSERT INTO t1 VALUES (_ucs2 0x1ED0),(_ucs2 0x1ED1),(_ucs2 0x1ED2),(_ucs2 0x1ED3); +INSERT INTO t1 VALUES (_ucs2 0x1ED4),(_ucs2 0x1ED5),(_ucs2 0x1ED6),(_ucs2 0x1ED7); +INSERT INTO t1 VALUES (_ucs2 0x1ED8),(_ucs2 0x1ED9),(_ucs2 0x1EDA),(_ucs2 0x1EDB); +INSERT INTO t1 VALUES (_ucs2 0x1EDC),(_ucs2 0x1EDD),(_ucs2 0x1EDE),(_ucs2 0x1EDF); +INSERT INTO t1 VALUES (_ucs2 0x1EE0),(_ucs2 0x1EE1),(_ucs2 0x1EE2),(_ucs2 0x1EE3); +INSERT INTO t1 VALUES (_ucs2 0x1EE4),(_ucs2 0x1EE5),(_ucs2 0x1EE6),(_ucs2 0x1EE7); +INSERT INTO t1 VALUES (_ucs2 0x1EE8),(_ucs2 0x1EE9),(_ucs2 0x1EEA),(_ucs2 0x1EEB); +INSERT INTO t1 VALUES (_ucs2 0x1EEC),(_ucs2 0x1EED),(_ucs2 0x1EEE),(_ucs2 0x1EEF); +INSERT INTO t1 VALUES (_ucs2 0x1EF0),(_ucs2 0x1EF1); +insert into t1 values ('AA'),('Aa'),('aa'),('aA'); +insert into t1 values ('AE'),('Ae'),('ae'),('aE'); +insert into t1 values ('CH'),('Ch'),('ch'),('cH'); +insert into t1 values ('DZ'),('Dz'),('dz'),('dZ'); +insert into t1 values ('DŽ'),('Dž'),('dž'),('dŽ'); +insert into t1 values ('IJ'),('Ij'),('ij'),('iJ'); +insert into t1 values ('LJ'),('Lj'),('lj'),('lJ'); +insert into t1 values ('LL'),('Ll'),('ll'),('lL'); +insert into t1 values ('NJ'),('Nj'),('nj'),('nJ'); +insert into t1 values ('OE'),('Oe'),('oe'),('oE'); +insert into t1 values ('SS'),('Ss'),('ss'),('sS'); +insert into t1 values ('RR'),('Rr'),('rr'),('rR'); +INSERT INTO t1 VALUES ('a '); +SELECT c1, HEX(WEIGHT_STRING(c1 LEVEL 1)), HEX(WEIGHT_STRING(c1 LEVEL 2)) FROM t1 ORDER BY c1, BINARY c1; +c1 HEX(WEIGHT_STRING(c1 LEVEL 1)) HEX(WEIGHT_STRING(c1 LEVEL 2)) +÷ 0552 0020 +× 0553 0020 +A 120F 0020 +a 120F 0020 +Á 120F 00200032 +á 120F 00200032 +À 120F 00200035 +à 120F 00200035 +Ă 120F 00200037 +ă 120F 00200037 +Ắ 120F 002000370032 +ắ 120F 002000370032 +Ằ 120F 002000370035 +ằ 120F 002000370035 +Ẵ 120F 00200037004E +ẵ 120F 00200037004E +Ẳ 120F 002000370064 +ẳ 120F 002000370064 + 120F 0020003C +â 120F 0020003C +Ấ 120F 0020003C0032 +ấ 120F 0020003C0032 +Ầ 120F 0020003C0035 +ầ 120F 0020003C0035 +Ẫ 120F 0020003C004E +ẫ 120F 0020003C004E +Ẩ 120F 0020003C0064 +ẩ 120F 0020003C0064 +Ǎ 120F 00200041 +ǎ 120F 00200041 +Å 120F 00200043 +å 120F 00200043 +Ǻ 120F 002000430032 +ǻ 120F 002000430032 +Ä 120F 00200047 +ä 120F 00200047 +Ǟ 120F 00200047005B +ǟ 120F 00200047005B +à 120F 0020004E +ã 120F 0020004E +Ǡ 120F 00200052005B +ǡ 120F 00200052005B +Ą 120F 00200059 +ą 120F 00200059 +Ā 120F 0020005B +ā 120F 0020005B +Ả 120F 00200064 +ả 120F 00200064 +Ạ 120F 00200070 +ạ 120F 00200070 +Ặ 120F 002000700037 +ặ 120F 002000700037 +Ậ 120F 00200070003C +ậ 120F 00200070003C +a 120F020A 00200020 +AA 120F120F 00200020 +Aa 120F120F 00200020 +aA 120F120F 00200020 +aa 120F120F 00200020 +AE 120F126B 00200020 +Ae 120F126B 00200020 +aE 120F126B 00200020 +ae 120F126B 00200020 +Æ 120F126B 002001590020 +æ 120F126B 002001590020 +Ǽ 120F126B 0020015900200032 +ǽ 120F126B 0020015900200032 +Ǣ 120F126B 002001590020005B +ǣ 120F126B 002001590020005B +B 1225 0020 +b 1225 0020 +ƀ 122D 0020 +Ɓ 1235 0020 +Ƃ 1239 0020 +ƃ 1239 0020 +C 123D 0020 +c 123D 0020 +Ć 123D 00200032 +ć 123D 00200032 +Ĉ 123D 0020003C +ĉ 123D 0020003C +Ċ 123D 00200052 +ċ 123D 00200052 +Ç 123D 00200056 +ç 123D 00200056 +cH 123D12D3 00200020 +Č 123E 0020 +č 123E 0020 +Ƈ 1246 0020 +ƈ 1246 0020 +D 1250 0020 +d 1250 0020 +Ď 1250 00200041 +ď 1250 00200041 +Đ 1250 0020007D +đ 1250 0020007D +Ð 1250 00200159 +ð 1250 00200159 +DZ 125014AD 00200020 +Dz 125014AD 00200020 +dZ 125014AD 00200020 +dz 125014AD 00200020 +DZ 125014AD 00200020 +Dz 125014AD 00200020 +dz 125014AD 00200020 +DŽ 125014AD 002000200041 +Dž 125014AD 002000200041 +dž 125014AD 002000200041 +DŽ 125014AE 00200020 +Dž 125014AE 00200020 +dŽ 125014AE 00200020 +dž 125014AE 00200020 +Ɖ 1258 0020 +Ɗ 125C 0020 +Ƌ 1261 0020 +ƌ 1261 0020 +E 126B 0020 +e 126B 0020 +É 126B 00200032 +é 126B 00200032 +È 126B 00200035 +è 126B 00200035 +Ĕ 126B 00200037 +ĕ 126B 00200037 +Ê 126B 0020003C +ê 126B 0020003C +Ế 126B 0020003C0032 +ế 126B 0020003C0032 +Ề 126B 0020003C0035 +ề 126B 0020003C0035 +Ễ 126B 0020003C004E +ễ 126B 0020003C004E +Ể 126B 0020003C0064 +ể 126B 0020003C0064 +Ě 126B 00200041 +ě 126B 00200041 +Ë 126B 00200047 +ë 126B 00200047 +Ẽ 126B 0020004E +ẽ 126B 0020004E +Ė 126B 00200052 +ė 126B 00200052 +Ę 126B 00200059 +ę 126B 00200059 +Ē 126B 0020005B +ē 126B 0020005B +Ẻ 126B 00200064 +ẻ 126B 00200064 +Ẹ 126B 00200070 +ẹ 126B 00200070 +Ệ 126B 00200070003C +ệ 126B 00200070003C +Ǝ 1276 0020 +ǝ 1276 0020 +Ə 127B 0020 +Ɛ 1280 0020 +F 12A3 0020 +f 12A3 0020 +Ƒ 12AA 0020 +ƒ 12AA 0020 +G 12B0 0020 +g 12B0 0020 +Ǵ 12B0 00200032 +ǵ 12B0 00200032 +Ğ 12B0 00200037 +ğ 12B0 00200037 +Ĝ 12B0 0020003C +ĝ 12B0 0020003C +Ǧ 12B0 00200041 +ǧ 12B0 00200041 +Ġ 12B0 00200052 +ġ 12B0 00200052 +Ģ 12B0 00200056 +ģ 12B0 00200056 +Ǥ 12BC 0020 +ǥ 12BC 0020 +Ɠ 12C1 0020 +Ɣ 12CB 0020 +Ƣ 12CF 0020 +ƣ 12CF 0020 +H 12D3 0020 +h 12D3 0020 +Ĥ 12D3 0020003C +ĥ 12D3 0020003C +Ħ 12D3 0020007D +ħ 12D3 0020007D +CH 12D4 0020 +Ch 12D4 0020 +ch 12D4 0020 +ƕ 12DB 0020 +Ƕ 12DB 0020 +I 12EC 0020 +i 12EC 0020 +Í 12EC 00200032 +í 12EC 00200032 +Ì 12EC 00200035 +ì 12EC 00200035 +Ĭ 12EC 00200037 +ĭ 12EC 00200037 +Î 12EC 0020003C +î 12EC 0020003C +Ǐ 12EC 00200041 +ǐ 12EC 00200041 +Ï 12EC 00200047 +ï 12EC 00200047 +Ĩ 12EC 0020004E +ĩ 12EC 0020004E +İ 12EC 00200052 +Į 12EC 00200059 +į 12EC 00200059 +Ī 12EC 0020005B +ī 12EC 0020005B +Ỉ 12EC 00200064 +ỉ 12EC 00200064 +Ị 12EC 00200070 +ị 12EC 00200070 +IJ 12EC1305 00200020 +Ij 12EC1305 00200020 +iJ 12EC1305 00200020 +ij 12EC1305 00200020 +IJ 12EC1305 00200020 +ij 12EC1305 00200020 +ı 12F0 0020 +Ɨ 12FA 0020 +Ɩ 1300 0020 +J 1305 0020 +j 1305 0020 +Ĵ 1305 0020003C +ĵ 1305 0020003C +ǰ 1305 00200041 +K 131E 0020 +k 131E 0020 +Ǩ 131E 00200041 +ǩ 131E 00200041 +Ķ 131E 00200056 +ķ 131E 00200056 +Ƙ 1324 0020 +ƙ 1324 0020 +L 1330 0020 +l 1330 0020 +Ĺ 1330 00200032 +ĺ 1330 00200032 +Ľ 1330 00200041 +ľ 1330 00200041 +Ļ 1330 00200056 +ļ 1330 00200056 +Ł 1330 0020007D +ł 1330 0020007D +Ŀ 1330 00200159 +ŀ 1330 00200159 +LJ 13301305 00200020 +Lj 13301305 00200020 +lJ 13301305 00200020 +lj 13301305 00200020 +LJ 13301305 00200020 +Lj 13301305 00200020 +lj 13301305 00200020 +LL 13301330 00200020 +Ll 13301330 00200020 +lL 13301330 00200020 +ll 13301330 00200020 +ƚ 133B 0020 +ƛ 1357 0020 +M 135F 0020 +m 135F 0020 +N 136D 0020 +n 136D 0020 +Ń 136D 00200032 +ń 136D 00200032 +Ǹ 136D 00200035 +ǹ 136D 00200035 +Ň 136D 00200041 +ň 136D 00200041 +Ñ 136D 0020004E +ñ 136D 0020004E +Ņ 136D 00200056 +ņ 136D 00200056 +NJ 136D1305 00200020 +Nj 136D1305 00200020 +nJ 136D1305 00200020 +nj 136D1305 00200020 +NJ 136D1305 00200020 +Nj 136D1305 00200020 +nj 136D1305 00200020 +Ɲ 1378 0020 +ƞ 137C 0020 +Ŋ 138A 0020 +ŋ 138A 0020 +O 138E 0020 +o 138E 0020 +Ó 138E 00200032 +ó 138E 00200032 +Ò 138E 00200035 +ò 138E 00200035 +Ŏ 138E 00200037 +ŏ 138E 00200037 +Ô 138E 0020003C +ô 138E 0020003C +Ố 138E 0020003C0032 +ố 138E 0020003C0032 +Ồ 138E 0020003C0035 +ồ 138E 0020003C0035 +Ỗ 138E 0020003C004E +ỗ 138E 0020003C004E +Ổ 138E 0020003C0064 +ổ 138E 0020003C0064 +Ǒ 138E 00200041 +ǒ 138E 00200041 +Ö 138E 00200047 +ö 138E 00200047 +Ő 138E 0020004D +ő 138E 0020004D +Õ 138E 0020004E +õ 138E 0020004E +Ø 138E 00200054 +ø 138E 00200054 +Ǿ 138E 002000540032 +ǿ 138E 002000540032 +Ǫ 138E 00200059 +ǫ 138E 00200059 +Ǭ 138E 00200059005B +ǭ 138E 00200059005B +Ō 138E 0020005B +ō 138E 0020005B +Ỏ 138E 00200064 +ỏ 138E 00200064 +Ơ 138E 00200068 +ơ 138E 00200068 +Ớ 138E 002000680032 +ớ 138E 002000680032 +Ờ 138E 002000680035 +ờ 138E 002000680035 +Ỡ 138E 00200068004E +ỡ 138E 00200068004E +Ở 138E 002000680064 +ở 138E 002000680064 +Ợ 138E 002000680070 +ợ 138E 002000680070 +Ọ 138E 00200070 +ọ 138E 00200070 +Ộ 138E 00200070003C +ộ 138E 00200070003C +OE 138E126B 00200020 +Oe 138E126B 00200020 +oE 138E126B 00200020 +oe 138E126B 00200020 +Œ 138E126B 002001590020 +œ 138E126B 002001590020 +Ɔ 139A 0020 +Ɵ 13A5 0020 +P 13B3 0020 +p 13B3 0020 +Ƥ 13BC 0020 +ƥ 13BC 0020 +Q 13C8 0020 +q 13C8 0020 +ĸ 13D6 0020 +R 13DA 0020 +r 13DA 0020 +Ŕ 13DA 00200032 +ŕ 13DA 00200032 +Ŗ 13DA 00200056 +ŗ 13DA 00200056 +RR 13DA13DA 00200020 +Rr 13DA13DA 00200020 +rR 13DA13DA 00200020 +rr 13DA13DA 00200020 +Ř 13DB 0020 +ř 13DB 0020 +Ʀ 13DE 0020 +S 1410 0020 +s 1410 0020 +Ś 1410 00200032 +ś 1410 00200032 +Ŝ 1410 0020003C +ŝ 1410 0020003C +Ş 1410 00200056 +ş 1410 00200056 +ſ 1410 0020015A +SS 14101410 00200020 +Ss 14101410 00200020 +sS 14101410 00200020 +ss 14101410 00200020 +ß 14101410 002001590020 +Š 1411 0020 +š 1411 0020 +Ʃ 1421 0020 +ƪ 1426 0020 +T 1433 0020 +t 1433 0020 +Ť 1433 00200041 +ť 1433 00200041 +Ţ 1433 00200056 +ţ 1433 00200056 +ƾ 14331410 00200020 +Ŧ 1438 0020 +ŧ 1438 0020 +ƫ 143E 0020 +Ƭ 1442 0020 +ƭ 1442 0020 +Ʈ 1446 0020 +U 1453 0020 +u 1453 0020 +Ú 1453 00200032 +ú 1453 00200032 +Ù 1453 00200035 +ù 1453 00200035 +Ŭ 1453 00200037 +ŭ 1453 00200037 +Û 1453 0020003C +û 1453 0020003C +Ǔ 1453 00200041 +ǔ 1453 00200041 +Ů 1453 00200043 +ů 1453 00200043 +Ü 1453 00200047 +ü 1453 00200047 +Ǘ 1453 002000470032 +ǘ 1453 002000470032 +Ǜ 1453 002000470035 +ǜ 1453 002000470035 +Ǚ 1453 002000470041 +ǚ 1453 002000470041 +Ǖ 1453 00200047005B +ǖ 1453 00200047005B +Ű 1453 0020004D +ű 1453 0020004D +Ũ 1453 0020004E +ũ 1453 0020004E +Ų 1453 00200059 +ų 1453 00200059 +Ū 1453 0020005B +ū 1453 0020005B +Ủ 1453 00200064 +ủ 1453 00200064 +Ư 1453 00200068 +ư 1453 00200068 +Ứ 1453 002000680032 +ứ 1453 002000680032 +Ừ 1453 002000680035 +ừ 1453 002000680035 +Ữ 1453 00200068004E +ữ 1453 00200068004E +Ử 1453 002000680064 +ử 1453 002000680064 +Ự 1453 002000680070 +ự 1453 002000680070 +Ụ 1453 00200070 +ụ 1453 00200070 +Ɯ 146D 0020 +Ʊ 1476 0020 +V 147B 0020 +v 147B 0020 +Ʋ 1482 0020 +W 148D 0020 +w 148D 0020 +Ŵ 148D 0020003C +ŵ 148D 0020003C +X 1497 0020 +x 1497 0020 +Y 149C 0020 +y 149C 0020 +Ý 149C 00200032 +ý 149C 00200032 +Ŷ 149C 0020003C +ŷ 149C 0020003C +ÿ 149C 00200047 +Ÿ 149C 00200047 +Ƴ 14A8 0020 +ƴ 14A8 0020 +Z 14AD 0020 +z 14AD 0020 +Ź 14AD 00200032 +ź 14AD 00200032 +Ż 14AD 00200052 +ż 14AD 00200052 +ƍ 14AD148D 00200020 +Ž 14AE 0020 +ž 14AE 0020 +Ƶ 14B2 0020 +ƶ 14B2 0020 +Ʒ 14CA 0020 +Ǯ 14CA 00200041 +ǯ 14CA 00200041 +Ƹ 14CF 0020 +ƹ 14CF 0020 +ƺ 14D4 0020 +Þ 14E0 0020 +þ 14E0 0020 +ƿ 14E6 0020 +Ƿ 14E6 0020 +ƻ 14EF 0020 +Ƨ 14F6 0020 +ƨ 14F6 0020 +Ƽ 14FA 0020 +ƽ 14FA 0020 +Ƅ 14FE 0020 +ƅ 14FE 0020 +ʼn 150B136D 00200020 +ǀ 1525 0020 +ǁ 1529 0020 +ǂ 152D 0020 +ǃ 1531 0020 +SELECT c1, HEX(WEIGHT_STRING(c1 AS CHAR(3) LEVEL 1)), HEX(WEIGHT_STRING(c1 AS CHAR(3) LEVEL 2)) FROM t1 WHERE c1 BETWEEN 'a' AND 'aZ' ORDER BY c1, BINARY c1; +c1 HEX(WEIGHT_STRING(c1 AS CHAR(3) LEVEL 1)) HEX(WEIGHT_STRING(c1 AS CHAR(3) LEVEL 2)) +A 120F02000200 002000200020 +a 120F02000200 002000200020 +Á 120F02000200 002000320020 +á 120F02000200 002000320020 +À 120F02000200 002000350020 +à 120F02000200 002000350020 +Ă 120F02000200 002000370020 +ă 120F02000200 002000370020 +Ắ 120F02000200 002000370032 +ắ 120F02000200 002000370032 +Ằ 120F02000200 002000370035 +ằ 120F02000200 002000370035 +Ẵ 120F02000200 00200037004E +ẵ 120F02000200 00200037004E +Ẳ 120F02000200 002000370064 +ẳ 120F02000200 002000370064 + 120F02000200 0020003C0020 +â 120F02000200 0020003C0020 +Ấ 120F02000200 0020003C0032 +ấ 120F02000200 0020003C0032 +Ầ 120F02000200 0020003C0035 +ầ 120F02000200 0020003C0035 +Ẫ 120F02000200 0020003C004E +ẫ 120F02000200 0020003C004E +Ẩ 120F02000200 0020003C0064 +ẩ 120F02000200 0020003C0064 +Ǎ 120F02000200 002000410020 +ǎ 120F02000200 002000410020 +Å 120F02000200 002000430020 +å 120F02000200 002000430020 +Ǻ 120F02000200 002000430032 +ǻ 120F02000200 002000430032 +Ä 120F02000200 002000470020 +ä 120F02000200 002000470020 +Ǟ 120F02000200 00200047005B +ǟ 120F02000200 00200047005B +à 120F02000200 0020004E0020 +ã 120F02000200 0020004E0020 +Ǡ 120F02000200 00200052005B +ǡ 120F02000200 00200052005B +Ą 120F02000200 002000590020 +ą 120F02000200 002000590020 +Ā 120F02000200 0020005B0020 +ā 120F02000200 0020005B0020 +Ả 120F02000200 002000640020 +ả 120F02000200 002000640020 +Ạ 120F02000200 002000700020 +ạ 120F02000200 002000700020 +Ặ 120F02000200 002000700037 +ặ 120F02000200 002000700037 +Ậ 120F02000200 00200070003C +ậ 120F02000200 00200070003C +a 120F020A0200 002000200020 +AA 120F120F0200 002000200020 +Aa 120F120F0200 002000200020 +aA 120F120F0200 002000200020 +aa 120F120F0200 002000200020 +AE 120F126B0200 002000200020 +Ae 120F126B0200 002000200020 +aE 120F126B0200 002000200020 +ae 120F126B0200 002000200020 +Æ 120F126B0200 002001590020 +æ 120F126B0200 002001590020 +Ǽ 120F126B0200 002001590020 +ǽ 120F126B0200 002001590020 +Ǣ 120F126B0200 002001590020 +ǣ 120F126B0200 002001590020 +DROP TABLE t1; +SELECT 'a' = 'a '; +'a' = 'a ' +0 +SELECT 'a' < 'á'; +'a' < 'á' +1 +SELECT 'áa' < 'ab'; +'áa' < 'ab' +1 +SELECT 'á' < 'ä'; +'á' < 'ä' +1 +SELECT 'äa' < 'áb'; +'äa' < 'áb' +1 +SELECT 'c' < 'č'; +'c' < 'č' +1 +SELECT 'cb' < 'ča'; +'cb' < 'ča' +1 +SELECT 'd' < 'ď'; +'d' < 'ď' +1 +SELECT 'ďa' < 'db'; +'ďa' < 'db' +1 +SELECT 'e' < 'é'; +'e' < 'é' +1 +SELECT 'éa' < 'eb'; +'éa' < 'eb' +1 +SELECT 'é' < 'ě'; +'é' < 'ě' +1 +SELECT 'ěa' < 'éb'; +'ěa' < 'éb' +1 +SELECT 'i' < 'í'; +'i' < 'í' +1 +SELECT 'ía' < 'ib'; +'ía' < 'ib' +1 +SELECT 'n' < 'ň'; +'n' < 'ň' +1 +SELECT 'ňa' < 'nb'; +'ňa' < 'nb' +1 +SELECT 'o' < 'ó'; +'o' < 'ó' +1 +SELECT 'óa' < 'ob'; +'óa' < 'ob' +1 +SELECT 'ó' < 'ö'; +'ó' < 'ö' +1 +SELECT 'öa' < 'ób'; +'öa' < 'ób' +1 +SELECT 'r' < 'ř'; +'r' < 'ř' +1 +SELECT 'rb' < 'řa'; +'rb' < 'řa' +1 +SELECT 's' < 'š'; +'s' < 'š' +1 +SELECT 'sb' < 'ša'; +'sb' < 'ša' +1 +SELECT 't' < 'ť'; +'t' < 'ť' +1 +SELECT 'ťa' < 'tb'; +'ťa' < 'tb' +1 +SELECT 'u' < 'ú'; +'u' < 'ú' +1 +SELECT 'úa' < 'ub'; +'úa' < 'ub' +1 +SELECT 'ú' < 'ů'; +'ú' < 'ů' +1 +SELECT 'ůa' < 'úb'; +'ůa' < 'úb' +1 +SELECT 'ů' < 'ü'; +'ů' < 'ü' +1 +SELECT 'üa' < 'ůb'; +'üa' < 'ůb' +1 +SELECT 'y' < 'ý'; +'y' < 'ý' +1 +SELECT 'ýa' < 'yb'; +'ýa' < 'yb' +1 +SELECT 'z' < 'ž'; +'z' < 'ž' +1 +SELECT 'zb' < 'ža'; +'zb' < 'ža' +1 +SELECT 'hž' < 'ch'; +'hž' < 'ch' +1 +SELECT 'chž'< 'i'; +'chž'< 'i' +1 +SELECT 'a' COLLATE utf8_czech_test_bad_w2; +ERROR HY000: Unknown collation: 'utf8_czech_test_bad_w2' diff --git a/mysql-test/std_data/ldml/Index.xml b/mysql-test/std_data/ldml/Index.xml index 55e754c700973..0435b2ab689d3 100644 --- a/mysql-test/std_data/ldml/Index.xml +++ b/mysql-test/std_data/ldml/Index.xml @@ -1167,6 +1167,45 @@ + + + + C

\u010D

\u010C + H

ch

ChCH + R

\u0159

\u0158 + S

\u0161

\u0160 + Z

\u017E

\u017D +
+
+ + + + + C

\u010D

\u010C + H

ch

ChCH + R

\u0159

\u0158 + S

\u0161

\u0160 + Z

\u017E

\u017D +
+
+ + + + + + C

\u010D

\u010C + H

ch

ChCH + R

\u0159

\u0158 + S

\u0161

\u0160 + Z

\u017E

\u017D +
+
+ diff --git a/mysql-test/suite/innodb/r/innodb_ctype_ldml.result b/mysql-test/suite/innodb/r/innodb_ctype_ldml.result index 375d8b72f3c56..12a234a1bdeed 100644 --- a/mysql-test/suite/innodb/r/innodb_ctype_ldml.result +++ b/mysql-test/suite/innodb/r/innodb_ctype_ldml.result @@ -419,6 +419,9 @@ ucs2_vn_ci ucs2 359 8 ucs2_5624_1 ucs2 360 8 utf8_5624_5 utf8 368 8 utf8_5624_5_bad utf8 369 8 +utf8_czech_test_w2 utf8 370 4 +utf8_czech_test_nopad_w2 utf8 371 4 +utf8_czech_test_bad_w2 utf8 372 4 utf32_test_ci utf32 391 8 utf8_maxuserid_ci utf8 2047 8 show collation like '%test%'; @@ -427,6 +430,9 @@ latin1_test latin1 99 Yes 1 latin1_test2 latin1 332 1 latin1_test2_cs latin1 333 1 utf8_test_ci utf8 353 8 +utf8_czech_test_w2 utf8 370 4 +utf8_czech_test_nopad_w2 utf8 371 4 +utf8_czech_test_bad_w2 utf8 372 4 ucs2_test_ci ucs2 358 8 utf8mb4_test_ci utf8mb4 326 8 utf8mb4_test_400_ci utf8mb4 328 8 diff --git a/mysql-test/t/ctype_ldml.test b/mysql-test/t/ctype_ldml.test index 956e48ba4af89..1d58daa89e4d6 100644 --- a/mysql-test/t/ctype_ldml.test +++ b/mysql-test/t/ctype_ldml.test @@ -499,3 +499,106 @@ SELECT HEX(a), REPLACE(a,' ','') FROM t1 WHERE a='a'; SELECT HEX(a), REPLACE(a,' ','') FROM t1 ORDER BY a; SELECT HEX(a), REPLACE(a,' ','') FROM t1 ORDER BY a DESC; DROP TABLE t1; + + +SET NAMES utf8 COLLATE utf8_czech_test_w2; +CREATE TABLE t1 AS SELECT SPACE(10) AS c1 LIMIT 0; +--source include/ctype_unicode_latin.inc +INSERT INTO t1 VALUES ('a '); +SELECT c1, HEX(WEIGHT_STRING(c1 LEVEL 1)), HEX(WEIGHT_STRING(c1 LEVEL 2)) FROM t1 ORDER BY c1, BINARY c1; +SELECT c1, HEX(WEIGHT_STRING(c1 AS CHAR(3) LEVEL 1)), HEX(WEIGHT_STRING(c1 AS CHAR(3) LEVEL 2)) FROM t1 WHERE c1 BETWEEN 'a' AND 'aZ' ORDER BY c1, BINARY c1; +DROP TABLE t1; + +SELECT 'a' = 'a '; +SELECT 'a' < 'á'; +SELECT 'áa' < 'ab'; +SELECT 'á' < 'ä'; +SELECT 'äa' < 'áb'; +SELECT 'c' < 'č'; +SELECT 'cb' < 'ča'; +SELECT 'd' < 'ď'; +SELECT 'ďa' < 'db'; +SELECT 'e' < 'é'; +SELECT 'éa' < 'eb'; +SELECT 'é' < 'ě'; +SELECT 'ěa' < 'éb'; +SELECT 'i' < 'í'; +SELECT 'ía' < 'ib'; +SELECT 'n' < 'ň'; +SELECT 'ňa' < 'nb'; +SELECT 'o' < 'ó'; +SELECT 'óa' < 'ob'; +SELECT 'ó' < 'ö'; +SELECT 'öa' < 'ób'; +SELECT 'r' < 'ř'; +SELECT 'rb' < 'řa'; +SELECT 's' < 'š'; +SELECT 'sb' < 'ša'; +SELECT 't' < 'ť'; +SELECT 'ťa' < 'tb'; +SELECT 'u' < 'ú'; +SELECT 'úa' < 'ub'; +SELECT 'ú' < 'ů'; +SELECT 'ůa' < 'úb'; +SELECT 'ů' < 'ü'; +SELECT 'üa' < 'ůb'; +SELECT 'y' < 'ý'; +SELECT 'ýa' < 'yb'; +SELECT 'z' < 'ž'; +SELECT 'zb' < 'ža'; +SELECT 'hž' < 'ch'; +SELECT 'chž'< 'i'; + + + +SET NAMES utf8 COLLATE utf8_czech_test_nopad_w2; +CREATE TABLE t1 AS SELECT SPACE(10) AS c1 LIMIT 0; +--source include/ctype_unicode_latin.inc +INSERT INTO t1 VALUES ('a '); +SELECT c1, HEX(WEIGHT_STRING(c1 LEVEL 1)), HEX(WEIGHT_STRING(c1 LEVEL 2)) FROM t1 ORDER BY c1, BINARY c1; +SELECT c1, HEX(WEIGHT_STRING(c1 AS CHAR(3) LEVEL 1)), HEX(WEIGHT_STRING(c1 AS CHAR(3) LEVEL 2)) FROM t1 WHERE c1 BETWEEN 'a' AND 'aZ' ORDER BY c1, BINARY c1; +DROP TABLE t1; + +SELECT 'a' = 'a '; +SELECT 'a' < 'á'; +SELECT 'áa' < 'ab'; +SELECT 'á' < 'ä'; +SELECT 'äa' < 'áb'; +SELECT 'c' < 'č'; +SELECT 'cb' < 'ča'; +SELECT 'd' < 'ď'; +SELECT 'ďa' < 'db'; +SELECT 'e' < 'é'; +SELECT 'éa' < 'eb'; +SELECT 'é' < 'ě'; +SELECT 'ěa' < 'éb'; +SELECT 'i' < 'í'; +SELECT 'ía' < 'ib'; +SELECT 'n' < 'ň'; +SELECT 'ňa' < 'nb'; +SELECT 'o' < 'ó'; +SELECT 'óa' < 'ob'; +SELECT 'ó' < 'ö'; +SELECT 'öa' < 'ób'; +SELECT 'r' < 'ř'; +SELECT 'rb' < 'řa'; +SELECT 's' < 'š'; +SELECT 'sb' < 'ša'; +SELECT 't' < 'ť'; +SELECT 'ťa' < 'tb'; +SELECT 'u' < 'ú'; +SELECT 'úa' < 'ub'; +SELECT 'ú' < 'ů'; +SELECT 'ůa' < 'úb'; +SELECT 'ů' < 'ü'; +SELECT 'üa' < 'ůb'; +SELECT 'y' < 'ý'; +SELECT 'ýa' < 'yb'; +SELECT 'z' < 'ž'; +SELECT 'zb' < 'ža'; +SELECT 'hž' < 'ch'; +SELECT 'chž'< 'i'; + + +--error ER_UNKNOWN_COLLATION +SELECT 'a' COLLATE utf8_czech_test_bad_w2; diff --git a/mysys/charset.c b/mysys/charset.c index 016d0fc301237..8939b6d7a4fd2 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -258,12 +258,38 @@ static my_bool simple_cs_is_full(CHARSET_INFO *cs) #if defined(HAVE_UCA_COLLATIONS) && (defined(HAVE_CHARSET_ucs2) || defined(HAVE_CHARSET_utf8)) +/** + Initialize a loaded collation. + @param [OUT] to - The new charset_info_st structure to initialize. + @param [IN] from - A template collation, to fill the missing data from. + @param [IN] loaded - The collation data loaded from the LDML file. + some data may be missing in "loaded". +*/ static void -copy_uca_collation(struct charset_info_st *to, CHARSET_INFO *from) +copy_uca_collation(struct charset_info_st *to, CHARSET_INFO *from, + CHARSET_INFO *loaded) { to->cset= from->cset; to->coll= from->coll; - to->strxfrm_multiply= from->strxfrm_multiply; + /* + Single-level UCA collation have strnxfrm_multiple=8. + In case of a multi-level UCA collation we use strnxfrm_multiply=4. + That means MY_COLLATION_HANDLER::strnfrmlen() will request the caller + to allocate a buffer smaller size for each level, for performance purpose, + and to fit longer VARCHARs to @@max_sort_length. + This makes filesort produce non-precise order for some rare Unicode + characters that produce more than 4 weights (long expansions). + UCA requires 2 bytes per weight multiplied by the number of levels. + In case of a 2-level collation, each character requires 4*2=8 bytes. + Therefore, the longest VARCHAR that fits into the default @@max_sort_length + is 1024/8=VARCHAR(128). With strnxfrm_multiply==8, only VARCHAR(64) + would fit. + Note, the built-in collation utf8_thai_520_w2 also uses strnxfrm_multiply=4, + for the same purpose. + TODO: we could add a new LDML syntax to choose strxfrm_multiply value. + */ + to->strxfrm_multiply= loaded->levels_for_order > 1 ? + 4 : from->strxfrm_multiply; to->min_sort_char= from->min_sort_char; to->max_sort_char= from->max_sort_char; to->mbminlen= from->mbminlen; @@ -312,7 +338,8 @@ static int add_collation(struct charset_info_st *cs) #if defined(HAVE_CHARSET_ucs2) && defined(HAVE_UCA_COLLATIONS) copy_uca_collation(newcs, newcs->state & MY_CS_NOPAD ? &my_charset_ucs2_unicode_nopad_ci : - &my_charset_ucs2_unicode_ci); + &my_charset_ucs2_unicode_ci, + cs); newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED | MY_CS_NONASCII; #endif } @@ -321,7 +348,8 @@ static int add_collation(struct charset_info_st *cs) #if defined (HAVE_CHARSET_utf8) && defined(HAVE_UCA_COLLATIONS) copy_uca_collation(newcs, newcs->state & MY_CS_NOPAD ? &my_charset_utf8_unicode_nopad_ci : - &my_charset_utf8_unicode_ci); + &my_charset_utf8_unicode_ci, + cs); newcs->ctype= my_charset_utf8_unicode_ci.ctype; if (init_state_maps(newcs)) return MY_XML_ERROR; @@ -332,7 +360,8 @@ static int add_collation(struct charset_info_st *cs) #if defined (HAVE_CHARSET_utf8mb4) && defined(HAVE_UCA_COLLATIONS) copy_uca_collation(newcs, newcs->state & MY_CS_NOPAD ? &my_charset_utf8mb4_unicode_nopad_ci : - &my_charset_utf8mb4_unicode_ci); + &my_charset_utf8mb4_unicode_ci, + cs); newcs->ctype= my_charset_utf8mb4_unicode_ci.ctype; newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED; #endif @@ -342,7 +371,8 @@ static int add_collation(struct charset_info_st *cs) #if defined (HAVE_CHARSET_utf16) && defined(HAVE_UCA_COLLATIONS) copy_uca_collation(newcs, newcs->state & MY_CS_NOPAD ? &my_charset_utf16_unicode_nopad_ci : - &my_charset_utf16_unicode_ci); + &my_charset_utf16_unicode_ci, + cs); newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED | MY_CS_NONASCII; #endif } @@ -351,7 +381,8 @@ static int add_collation(struct charset_info_st *cs) #if defined (HAVE_CHARSET_utf32) && defined(HAVE_UCA_COLLATIONS) copy_uca_collation(newcs, newcs->state & MY_CS_NOPAD ? &my_charset_utf32_unicode_nopad_ci : - &my_charset_utf32_unicode_ci); + &my_charset_utf32_unicode_ci, + cs); newcs->state|= MY_CS_AVAILABLE | MY_CS_LOADED | MY_CS_NONASCII; #endif } diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 73a813feed9d7..79ad8ca7302bc 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -6542,6 +6542,17 @@ MY_UCA_INFO my_uca_v400= }, 0 /* levelno */ }, + { + 0, + NULL, + NULL, + { + 0, + NULL, + NULL + }, + 1 /* levelno */ + }, }, /* Logical positions */ @@ -30134,6 +30145,18 @@ MY_UCA_INFO my_uca_v520= }, 0 /* levelno */ }, + + { + 0x10FFFF, /* maxchar */ + (uchar *) uca520_length_w2, + (uint16 **) uca520_weight_w2, + { /* Contractions: */ + 0, /* nitems */ + NULL, /* item */ + NULL /* flags */ + }, + 1 /* levelno */ + }, }, 0x0009, /* first_non_ignorable p != ignore */ @@ -31851,6 +31874,25 @@ static int my_strnncoll_uca_multilevel(CHARSET_INFO *cs, } +static int +my_strnncollsp_generic_uca_nopad_multilevel(CHARSET_INFO *cs, + const uchar *s, size_t slen, + const uchar *t, size_t tlen) +{ + uint num_level= cs->levels_for_order; + uint i; + for (i= 0; i != num_level; i++) + { + int ret= my_strnncoll_uca_onelevel(cs, &my_any_uca_scanner_handler, + &cs->uca->level[i], + s, slen, t, tlen, FALSE); + if (ret) + return ret; + } + return 0; +} + + static inline int my_space_weight(const MY_UCA_WEIGHT_LEVEL *level) { @@ -32181,6 +32223,16 @@ my_strnxfrm_uca_onelevel(CHARSET_INFO *cs, } +/* + Return the minimum possible weight on a level. +*/ +static uint min_weight_on_level(MY_UCA_WEIGHT_LEVEL *level) +{ + DBUG_ASSERT(level->levelno < 2); /* No 3-level NOPAD collations yet */ + return level->levelno == 0 ? 0x0200 : 0x0020; +} + + static uchar * my_strnxfrm_uca_nopad_onelevel(CHARSET_INFO *cs, my_uca_scanner_handler *scanner_handler, @@ -32194,12 +32246,9 @@ my_strnxfrm_uca_nopad_onelevel(CHARSET_INFO *cs, dst, de, &nweights, src, srclen); DBUG_ASSERT(dst <= de); - /* - Pad with the minimum possible primary weight 0x0200. - */ - DBUG_ASSERT(level->levelno == 0); /* No multi-level NOPAD collations yet */ + /* Pad with the minimum possible weight on this level */ if (dst < de && nweights && (flags & MY_STRXFRM_PAD_WITH_SPACE)) - dst= my_strnxfrm_uca_padn(dst, de, nweights, 0x0200); + dst= my_strnxfrm_uca_padn(dst, de, nweights, min_weight_on_level(level)); DBUG_ASSERT(dst <= de); my_strxfrm_desc_and_reverse(d0, dst, flags, 0); return dst; @@ -32294,7 +32343,12 @@ my_strnxfrm_uca_multilevel(CHARSET_INFO *cs, { if (!(flags & MY_STRXFRM_LEVEL_ALL) || (flags & (MY_STRXFRM_LEVEL1 << current_level))) - dst= my_strnxfrm_uca_onelevel(cs, scanner_handler, + dst= cs->state & MY_CS_NOPAD ? + my_strnxfrm_uca_nopad_onelevel(cs, scanner_handler, + &cs->uca->level[current_level], + dst, de, nweights, + src, srclen, flags) : + my_strnxfrm_uca_onelevel(cs, scanner_handler, &cs->uca->level[current_level], dst, de, nweights, src, srclen, flags); @@ -32970,6 +33024,7 @@ typedef enum typedef struct my_coll_rules_st { uint version; /* Unicode version, e.g. 400 or 520 */ + uint strength; /* Number of levels */ MY_UCA_INFO *uca; /* Unicode weight data */ size_t nrules; /* Number of rules in the rule array */ size_t mrules; /* Number of allocated rules */ @@ -33251,6 +33306,10 @@ my_coll_parser_scan_setting(MY_COLL_RULE_PARSER *p) { rules->shift_after_method= my_shift_method_simple; } + else if (!lex_cmp(lexem, C_STRING_WITH_LEN("[strength 1]"))) + rules->strength= 1; + else if (!lex_cmp(lexem, C_STRING_WITH_LEN("[strength 2]"))) + rules->strength= 2; else { return 0; @@ -34189,6 +34248,10 @@ init_weight_level(MY_CHARSET_LOADER *loader, MY_COLL_RULES *rules, } +MY_COLLATION_HANDLER my_collation_any_uca_handler_multilevel; +MY_COLLATION_HANDLER my_collation_generic_uca_nopad_handler_multilevel; + + /* This function copies an UCS2 collation from the default Unicode Collation Algorithm (UCA) @@ -34213,66 +34276,6 @@ create_tailoring(struct charset_info_st *cs, MY_COLL_RULES rules; MY_UCA_INFO new_uca, *src_uca= NULL; int rc= 0; - - *loader->error= '\0'; - - if (!cs->tailoring) - return 0; /* Ok to add a collation without tailoring */ - - memset(&rules, 0, sizeof(rules)); - rules.loader= loader; - rules.uca= cs->uca ? cs->uca : &my_uca_v400; /* For logical positions, etc */ - memset(&new_uca, 0, sizeof(new_uca)); - - /* Parse ICU Collation Customization expression */ - if ((rc= my_coll_rule_parse(&rules, - cs->tailoring, - cs->tailoring + strlen(cs->tailoring)))) - goto ex; - - if (rules.version == 520) /* Unicode-5.2.0 requested */ - { - src_uca= &my_uca_v520; - cs->caseinfo= &my_unicase_unicode520; - } - else if (rules.version == 400) /* Unicode-4.0.0 requested */ - { - src_uca= &my_uca_v400; - cs->caseinfo= &my_unicase_default; - } - else /* No Unicode version specified */ - { - src_uca= cs->uca ? cs->uca : &my_uca_v400; - if (!cs->caseinfo) - cs->caseinfo= &my_unicase_default; - } - - if ((rc= init_weight_level(loader, &rules, - &new_uca.level[0], &src_uca->level[0]))) - goto ex; - - if (!(cs->uca= (MY_UCA_INFO *) (loader->once_alloc)(sizeof(MY_UCA_INFO)))) - { - rc= 1; - goto ex; - } - cs->uca[0]= new_uca; - -ex: - (loader->free)(rules.rule); - if (rc != 0 && loader->error[0]) - loader->reporter(ERROR_LEVEL, "%s", loader->error); - return rc; -} - -static my_bool -create_tailoring_multilevel(struct charset_info_st *cs, - MY_CHARSET_LOADER *loader) -{ - uint num_level= cs->levels_for_order; - MY_COLL_RULES rules; - MY_UCA_INFO new_uca, *src_uca= NULL; - int rc= 0; uint i; *loader->error= '\0'; @@ -34307,9 +34310,17 @@ create_tailoring_multilevel(struct charset_info_st *cs, if (!cs->caseinfo) cs->caseinfo= &my_unicase_default; } + cs->levels_for_order= rules.strength ? rules.strength : 1; - for (i= 0; i != num_level; i++) + for (i= 0; i != cs->levels_for_order; i++) { + if ((rc= (src_uca->level[i].maxchar == 0))) + { + my_snprintf(loader->error, sizeof(loader->error) - 1, + "%s: no level #%d data for this Unicode version.", + cs->name, i + 1); + goto ex; + } if ((rc= init_weight_level(loader, &rules, &new_uca.level[i], &src_uca->level[i]))) goto ex; @@ -34321,6 +34332,10 @@ create_tailoring_multilevel(struct charset_info_st *cs, goto ex; } cs->uca[0]= new_uca; + if (cs->levels_for_order > 1) + cs->coll= (cs->state & MY_CS_NOPAD) ? + &my_collation_generic_uca_nopad_handler_multilevel : + &my_collation_any_uca_handler_multilevel; ex: (loader->free)(rules.rule); @@ -34345,16 +34360,6 @@ my_coll_init_uca(struct charset_info_st *cs, MY_CHARSET_LOADER *loader) return create_tailoring(cs, loader); } -static my_bool -my_coll_init_uca_multilevel(struct charset_info_st *cs, - MY_CHARSET_LOADER *loader) -{ - cs->pad_char= ' '; - cs->ctype= my_charset_utf8_unicode_ci.ctype; - if (!cs->caseinfo) - cs->caseinfo= &my_unicase_default; - return create_tailoring_multilevel(cs, loader); -} static int my_strnncoll_any_uca(CHARSET_INFO *cs, const uchar *s, size_t slen, @@ -34489,7 +34494,7 @@ MY_COLLATION_HANDLER my_collation_generic_uca_nopad_handler = MY_COLLATION_HANDLER my_collation_any_uca_handler_multilevel= { - my_coll_init_uca_multilevel, + my_coll_init_uca, my_strnncoll_any_uca_multilevel, my_strnncollsp_any_uca_multilevel, my_strnxfrm_any_uca_multilevel, @@ -34503,6 +34508,22 @@ MY_COLLATION_HANDLER my_collation_any_uca_handler_multilevel= }; +MY_COLLATION_HANDLER my_collation_generic_uca_nopad_handler_multilevel = +{ + my_coll_init_uca, + my_strnncoll_any_uca_multilevel, + my_strnncollsp_generic_uca_nopad_multilevel, + my_strnxfrm_any_uca_multilevel, + my_strnxfrmlen_any_uca_multilevel, + my_like_range_generic, + my_wildcmp_uca, + NULL, + my_instr_mb, + my_hash_sort_generic_uca_nopad, + my_propagate_complex +}; + + #ifdef HAVE_CHARSET_ucs2 /* UCS2 optimized CHARSET_INFO compatible wrappers. @@ -35342,7 +35363,7 @@ struct charset_info_st my_charset_ucs2_thai_520_w2= "ucs2", /* csname */ "ucs2_thai_520_w2", /* name */ "", /* comment */ - "", /* tailoring */ + "[strength 2]", /* tailoring */ NULL, /* ctype */ NULL, /* to_lower */ NULL, /* to_upper */ @@ -36363,7 +36384,7 @@ struct charset_info_st my_charset_utf8_thai_520_w2= MY_UTF8MB3, /* csname */ MY_UTF8MB3 "_thai_520_w2",/* name */ "", /* comment */ - "", /* tailoring */ + "[strength 2]", /* tailoring */ ctype_utf8, /* ctype */ NULL, /* to_lower */ NULL, /* to_upper */ @@ -37275,7 +37296,7 @@ struct charset_info_st my_charset_utf8mb4_thai_520_w2= MY_UTF8MB4, /* csname */ MY_UTF8MB4 "_thai_520_w2", /* name */ "", /* comment */ - "", /* tailoring */ + "[strength 2]", /* tailoring */ ctype_utf8, /* ctype */ NULL, /* to_lower */ NULL, /* to_upper */ @@ -38237,7 +38258,7 @@ struct charset_info_st my_charset_utf32_thai_520_w2= "utf32", /* csname */ "utf32_thai_520_w2",/* name */ "", /* comment */ - "", /* tailoring */ + "[strength 2]", /* tailoring */ NULL, /* ctype */ NULL, /* to_lower */ NULL, /* to_upper */ @@ -39204,7 +39225,7 @@ struct charset_info_st my_charset_utf16_thai_520_w2= "utf16", /* cs name */ "utf16_thai_520_w2",/* name */ "", /* comment */ - "", /* tailoring */ + "[strength 2]", /* tailoring */ NULL, /* ctype */ NULL, /* to_lower */ NULL, /* to_upper */ diff --git a/strings/ctype.c b/strings/ctype.c index 7348cbfa1f914..12d511162d7de 100644 --- a/strings/ctype.c +++ b/strings/ctype.c @@ -667,6 +667,8 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, size_t len) case _CS_ST_STRENGTH: /* 1, 2, 3, 4, 5, or primary, secondary, tertiary, quaternary, identical */ rc= tailoring_append(st, "[strength %.*s]", len, attr); + if (len && attr[0] >= '1' && attr[0] <= '9') + i->cs.levels_for_order= attr[0] - '0'; break; case _CS_ST_ALTERNATE: From 8e5f532dc2cb5922ee59fd6c9a33e9d1614b7b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 9 Nov 2016 13:32:43 +0200 Subject: [PATCH 57/71] MDEV-10692: InnoDB: Failing assertion: lock->trx->lock.wait_lock == lock This is not a fix, this is instrumentation to find the bug. --- storage/innobase/lock/lock0lock.cc | 25 ++++++++++++++++++++++++- storage/xtradb/lock/lock0lock.cc | 25 ++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 56d17e4fe1f8a..d17cef18f7657 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -776,10 +776,33 @@ lock_reset_lock_and_trx_wait( /*=========================*/ lock_t* lock) /*!< in/out: record lock */ { - ut_ad(lock->trx->lock.wait_lock == lock); ut_ad(lock_get_wait(lock)); ut_ad(lock_mutex_own()); + if (lock->trx->lock.wait_lock != lock) { + const char* stmt=NULL; + const char* stmt2=NULL; + size_t stmt_len; + trx_id_t trx_id = 0; + stmt = innobase_get_stmt_unsafe(lock->trx->mysql_thd, &stmt_len); + + if (lock->trx->lock.wait_lock && + lock->trx->lock.wait_lock->trx) { + trx_id = lock->trx->lock.wait_lock->trx->id; + stmt2 = innobase_get_stmt_unsafe(lock->trx->lock.wait_lock->trx->mysql_thd, &stmt_len); + } + + ib::info() << + "Trx id " << lock->trx->id + << " is waiting a lock in statement " + << (stmt ? stmt : "NULL") + << " for this trx id " << trx_id + << " and statement " + << (stmt2 ? stmt2 : "NULL") + << "wait_lock " << lock->trx->lock.wait_lock; + ut_error; + } + lock->trx->lock.wait_lock = NULL; lock->type_mode &= ~LOCK_WAIT; } diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc index 341c452cd15fb..29f89dcbf4f52 100644 --- a/storage/xtradb/lock/lock0lock.cc +++ b/storage/xtradb/lock/lock0lock.cc @@ -887,10 +887,33 @@ lock_reset_lock_and_trx_wait( /*=========================*/ lock_t* lock) /*!< in/out: record lock */ { - ut_ad(lock->trx->lock.wait_lock == lock); ut_ad(lock_get_wait(lock)); ut_ad(lock_mutex_own()); + if (lock->trx->lock.wait_lock != lock) { + const char* stmt=NULL; + const char* stmt2=NULL; + size_t stmt_len; + trx_id_t trx_id = 0; + stmt = innobase_get_stmt(lock->trx->mysql_thd, &stmt_len); + + if (lock->trx->lock.wait_lock && + lock->trx->lock.wait_lock->trx) { + trx_id = lock->trx->lock.wait_lock->trx->id; + stmt2 = innobase_get_stmt(lock->trx->lock.wait_lock->trx->mysql_thd, &stmt_len); + } + + ib_logf(IB_LOG_LEVEL_INFO, + "Trx id %lu is waiting a lock in statement %s" + " for this trx id %lu and statement %s wait_lock %p", + lock->trx->id, + stmt ? stmt : "NULL", + trx_id, + stmt2 ? stmt2 : "NULL", + lock->trx->lock.wait_lock); + ut_error; + } + lock->trx->lock.wait_lock = NULL; lock->type_mode &= ~LOCK_WAIT; } From ada3d7581bd619a729f1243a730499eb4d07b054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 9 Nov 2016 15:17:55 +0200 Subject: [PATCH 58/71] MDEV-10692: InnoDB: Failing assertion: lock->trx->lock.wait_lock == lock When we enter here wait_lock could be already gone i.e. NULL, that should be allowed. --- storage/innobase/lock/lock0lock.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index d17cef18f7657..12a79aacb4add 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -779,7 +779,8 @@ lock_reset_lock_and_trx_wait( ut_ad(lock_get_wait(lock)); ut_ad(lock_mutex_own()); - if (lock->trx->lock.wait_lock != lock) { + if (lock->trx->lock.wait_lock && + lock->trx->lock.wait_lock != lock) { const char* stmt=NULL; const char* stmt2=NULL; size_t stmt_len; @@ -800,7 +801,7 @@ lock_reset_lock_and_trx_wait( << " and statement " << (stmt2 ? stmt2 : "NULL") << "wait_lock " << lock->trx->lock.wait_lock; - ut_error; + ut_ad(lock->trx->lock.wait_lock != lock); } lock->trx->lock.wait_lock = NULL; From 8c038239748f6a9666e07e601a46967d3a0381d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 10 Nov 2016 09:42:49 +0200 Subject: [PATCH 59/71] MDEV-11250: mtflush threads stall on shutdown Code calling mtflush threads to exit was too late. --- storage/innobase/srv/srv0start.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 7b4d460139b8b..4be92906851da 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -3,7 +3,7 @@ Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2008, Google Inc. Copyright (c) 2009, Percona Inc. -Copyright (c) 2013, 2015, MariaDB Corporation +Copyright (c) 2013, 2016, MariaDB Corporation Portions of this file contain modifications contributed and copyrighted by Google, Inc. Those modifications are gratefully acknowledged and are described @@ -1292,6 +1292,11 @@ srv_shutdown_all_bg_threads() logs_empty_and_mark_files_at_shutdown() and should have already quit or is quitting right now. */ + if (srv_use_mtflush) { + /* g. Exit the multi threaded flush threads */ + buf_mtflu_io_thread_exit(); + } + bool active = os_thread_active(); os_thread_sleep(100000); @@ -2809,11 +2814,6 @@ innobase_shutdown_for_mysql(void) /* 2. Make all threads created by InnoDB to exit */ srv_shutdown_all_bg_threads(); - if (srv_use_mtflush) { - /* g. Exit the multi threaded flush threads */ - buf_mtflu_io_thread_exit(); - } - if (srv_monitor_file) { fclose(srv_monitor_file); srv_monitor_file = 0; From d50ca3535e8b1821863ff9ea23c09615f1a2e6cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Tue, 8 Nov 2016 22:15:33 +0200 Subject: [PATCH 60/71] Deb: clean up, strip legacy and simplify autobake-deb.sh --- debian/autobake-deb.sh | 53 +++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index 1201e28009fcc..4c8bc74c2cd57 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -1,15 +1,11 @@ #!/bin/bash - -# Build MariaDB .deb packages. -# Based on OurDelta .deb packaging scripts, which are in turn based on Debian -# MySQL packages. +# +# Build MariaDB .deb packages for test and release at mariadb.org +# # Exit immediately on any error set -e -# Debug script and command lines -#set -x - # On Buildbot, don't run the mysql-test-run test suite as part of build. # It takes a lot of time, and we will do a better test anyway in # Buildbot, running the test suite from installed .debs on a clean VM. @@ -21,29 +17,23 @@ then export DEB_BUILD_OPTIONS="nocheck" fi -# Don't include test suite package on Travis-CI to make the build time shorter +# Travis-CI optimizations if [[ $TRAVIS ]] then + # On Travis-CI, the log must stay under 4MB so make the build less verbose + sed -i -e '/Add support for verbose builds/,+2d' debian/rules + + # Don't include test suite package on Travis-CI to make the build time shorter sed '/Package: mariadb-test-data/,+26d' -i debian/control sed '/Package: mariadb-test/,+34d' -i debian/control fi -export MARIADB_OPTIONAL_DEBS="" -# Find major.minor version. -# -source ./VERSION -UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}" -PATCHLEVEL="+maria" -LOGSTRING="MariaDB build" - -# Look up distro-version specific stuff. +# Look up distro-version specific stuff # Always keep the actual packaging as up-to-date as possible following the latest # Debian policy and targetting Debian Sid. Then case-by-case run in autobake-deb.sh # tests for backwards compatibility and strip away parts on older builders. -CODENAME="$(lsb_release -sc)" - # If libcrack2 (>= 2.9.0) is not available (before Debian Jessie and Ubuntu Trusty) # clean away the cracklib stanzas so the package can build without them. if ! apt-cache madison libcrack2-dev | grep 'libcrack2-dev *| *2\.9' >/dev/null 2>&1 @@ -74,30 +64,25 @@ then sed '/mariadb-service-convert/d' -i debian/mariadb-server-10.2.install fi -# On Travis-CI, the log must stay under 4MB so make the build less verbose -if [[ $TRAVIS ]] -then - sed -i -e '/Add support for verbose builds/,+2d' debian/rules -fi - - -# Adjust changelog, add new version. -# +# Adjust changelog, add new version echo "Incrementing changelog and starting build scripts" +# Find major.minor version +source ./VERSION +UPSTREAM="${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}" +PATCHLEVEL="+maria" +LOGSTRING="MariaDB build" +CODENAME="$(lsb_release -sc)" + dch -b -D ${CODENAME} -v "${UPSTREAM}${PATCHLEVEL}~${CODENAME}" "Automatic build with ${LOGSTRING}." echo "Creating package version ${UPSTREAM}${PATCHLEVEL}~${CODENAME} ... " -# Build the package. +# Build the package # Pass -I so that .git and other unnecessary temporary and source control files -# will be ignored by dpkg-source when createing the tar.gz source package +# will be ignored by dpkg-source when creating the tar.gz source package. # Use -b to build binary only packages as there is no need to waste time on # generating the source package. fakeroot dpkg-buildpackage -us -uc -I -b -[ -e debian/autorm-file ] && rm -vf `cat debian/autorm-file` - echo "Build complete" - -# end of autobake script From e820dec1f98c7d8e85fc856b9ed81aed053cea7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Tue, 8 Nov 2016 22:18:19 +0200 Subject: [PATCH 61/71] Deb: List package contents as part of the build log --- debian/autobake-deb.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh index 4c8bc74c2cd57..38c1d64a5e28b 100755 --- a/debian/autobake-deb.sh +++ b/debian/autobake-deb.sh @@ -85,4 +85,17 @@ echo "Creating package version ${UPSTREAM}${PATCHLEVEL}~${CODENAME} ... " # generating the source package. fakeroot dpkg-buildpackage -us -uc -I -b +# Don't log package contents on Travis-CI to save time and log size +if [[ ! $TRAVIS ]] +then + echo "List package contents ..." + cd .. + for package in `ls *.deb` + do + echo $package | cut -d '_' -f 1 + dpkg-deb -c $package | awk '{print $1 " " $2 " " $6}' | sort -k 3 + echo "------------------------------------------------" + done +fi + echo "Build complete" From f2219c8d3fb4a54da1fff74b8849c74b9a7de0c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Wed, 9 Nov 2016 21:15:17 +0200 Subject: [PATCH 62/71] Deb: add gdb as a build dependency for stack traces on test suite failures If mysqld crashed during the test suite run and gdb is available, a stack trace will be printed automatically. --- .travis.yml | 1 + debian/control | 1 + 2 files changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 24ccd5228689f..273491ccc7c23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,7 @@ addons: - debhelper - dh-apparmor - dpatch + - gdb - libaio-dev - libboost-dev - libjudy-dev diff --git a/debian/control b/debian/control index cd36704ea634b..c8b0dfb67855c 100644 --- a/debian/control +++ b/debian/control @@ -9,6 +9,7 @@ Build-Depends: bison, dh-apparmor, dh-systemd, dpatch, + gdb, libaio-dev [linux-any], libboost-dev, libcrack2-dev (>= 2.9.0), From 92bcb906a01515874eb3095eabfde7057f4f8d50 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Sun, 13 Nov 2016 14:46:33 -0800 Subject: [PATCH 63/71] Fixed bug mdev-11278. If a recursive CTE referred to a materialized view/derived table then the query that used this CTE returned a bogus error message. --- mysql-test/r/cte_recursive.result | 26 ++++++++++++++++++++++++++ mysql-test/t/cte_recursive.test | 27 +++++++++++++++++++++++++++ sql/sql_cte.cc | 11 ----------- 3 files changed, 53 insertions(+), 11 deletions(-) diff --git a/mysql-test/r/cte_recursive.result b/mysql-test/r/cte_recursive.result index f22370870c257..a624b5453b89a 100644 --- a/mysql-test/r/cte_recursive.result +++ b/mysql-test/r/cte_recursive.result @@ -1836,3 +1836,29 @@ id select_type table type possible_keys key key_len ref rows Extra 4 RECURSIVE UNION t2 ALL NULL NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join) NULL UNION RESULT ALL NULL NULL NULL NULL NULL drop table t1,t2; +# +# MDEV-11278: non-mergeable view in the spec of recursive CTE +# +create table t1 (a int); +insert into t1 values +(0), (1), (2), (3), (4); +create table t2 (a int); +insert into t2 values +(1), (2), (3), (4), (5); +create view v1 as +select a from t2 where a < 3 +union +select a from t2 where a > 4; +with recursive +t1 as +( +select a from v1 where a=1 +union +select v1.a from t1,v1 where t1.a+1=v1.a +) +select * from t1; +a +1 +2 +drop view v1; +drop table t1,t2; diff --git a/mysql-test/t/cte_recursive.test b/mysql-test/t/cte_recursive.test index 8a07b3ae75aca..e6a259b8f5821 100644 --- a/mysql-test/t/cte_recursive.test +++ b/mysql-test/t/cte_recursive.test @@ -1361,4 +1361,31 @@ select * from t1; drop table t1,t2; +--echo # +--echo # MDEV-11278: non-mergeable view in the spec of recursive CTE +--echo # + +create table t1 (a int); +insert into t1 values + (0), (1), (2), (3), (4); +create table t2 (a int); +insert into t2 values + (1), (2), (3), (4), (5); + +create view v1 as + select a from t2 where a < 3 + union + select a from t2 where a > 4; + +with recursive +t1 as +( +select a from v1 where a=1 +union +select v1.a from t1,v1 where t1.a+1=v1.a +) +select * from t1; + +drop view v1; +drop table t1,t2; diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc index 7e98a9bd1ff56..a4ceae52e5e7f 100644 --- a/sql/sql_cte.cc +++ b/sql/sql_cte.cc @@ -1121,17 +1121,6 @@ bool With_element::check_unrestricted_recursive(st_select_lex *sel, { if(!tbl->is_with_table()) { - if (tbl->is_materialized_derived()) - { - table_map dep_map; - check_dependencies_in_unit(unit, NULL, false, &dep_map); - if (dep_map & get_elem_map()) - { - my_error(ER_REF_TO_RECURSIVE_WITH_TABLE_IN_DERIVED, - MYF(0), query_name->str); - return true; - } - } if (check_unrestricted_recursive(unit->first_select(), unrestricted, encountered)) From 8283d7f70e9fd2b4da80426ac9f8c18f65c145f8 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Sun, 13 Nov 2016 14:55:50 -0800 Subject: [PATCH 64/71] Added the test case from mdev-11259. --- mysql-test/r/cte_recursive.result | 465 ++++++++++++++++++++++++++++++ mysql-test/t/cte_recursive.test | 94 ++++++ 2 files changed, 559 insertions(+) diff --git a/mysql-test/r/cte_recursive.result b/mysql-test/r/cte_recursive.result index a624b5453b89a..4a3ca4d1caafe 100644 --- a/mysql-test/r/cte_recursive.result +++ b/mysql-test/r/cte_recursive.result @@ -1862,3 +1862,468 @@ a 2 drop view v1; drop table t1,t2; +# +# MDEV-11259: recursive CTE with concatenation operation +# +DROP TABLE IF EXISTS edges; +Warnings: +Note 1051 Unknown table 'test.edges' +CREATE TABLE edges( +a int(10) unsigned NOT NULL, +b int(10) unsigned NOT NULL, +PRIMARY KEY (a,b), +KEY b(b) +); +INSERT INTO edges +VALUES (1,3),(2,1),(2,4),(3,4),(3,5),(3,6),(4,7),(5,1),(5,6),(6,1); +DROP TABLE IF EXISTS edges2; +Warnings: +Note 1051 Unknown table 'test.edges2' +CREATE VIEW edges2 (a, b) AS +SELECT a, b FROM edges UNION ALL SELECT b, a FROM edges; +WITH RECURSIVE transitive_closure(a, b, distance, path_string) AS +( SELECT a, b, 1 AS distance, +concat(a, '.', b, '.') AS path_string +FROM edges +UNION ALL +SELECT tc.a, e.b, tc.distance + 1, +concat(tc.path_string, e.b, '.') AS path_string +FROM edges AS e +JOIN transitive_closure AS tc +ON e.a = tc.b +WHERE tc.path_string NOT LIKE concat('%', e.b, '.%') +) +SELECT * FROM transitive_closure +ORDER BY a, b, distance; +a b distance path_string +1 3 1 1.3. +1 4 2 1.3.4. +1 5 2 1.3.5. +1 6 2 1.3.6. +1 6 3 1.3.5.6. +1 7 3 1.3.4.7. +2 1 1 2.1. +2 3 2 2.1.3. +2 4 1 2.4. +2 4 3 2.1.3.4. +2 5 3 2.1.3.5. +2 6 3 2.1.3.6. +2 6 4 2.1.3.5.6. +2 7 2 2.4.7. +2 7 4 2.1.3.4.7. +3 1 2 3.6.1. +3 1 2 3.5.1. +3 1 3 3.5.6.1. +3 4 1 3.4. +3 5 1 3.5. +3 6 1 3.6. +3 6 2 3.5.6. +3 7 2 3.4.7. +4 7 1 4.7. +5 1 1 5.1. +5 1 2 5.6.1. +5 3 2 5.1.3. +5 3 3 5.6.1.3. +5 4 3 5.1.3.4. +5 4 4 5.6.1.3.4. +5 6 1 5.6. +5 6 3 5.1.3.6. +5 7 4 5.1.3.4.7. +5 7 5 5.6.1.3.4.7. +6 1 1 6.1. +6 3 2 6.1.3. +6 4 3 6.1.3.4. +6 5 3 6.1.3.5. +6 7 4 6.1.3.4.7. +WITH RECURSIVE transitive_closure(a, b, distance, path_string) AS +( SELECT a, b, 1 AS distance, +concat(a, '.', b, '.') AS path_string +FROM edges +WHERE a = 1 -- source +UNION ALL +SELECT tc.a, e.b, tc.distance + 1, +concat(tc.path_string, e.b, '.') AS path_string +FROM edges AS e +JOIN transitive_closure AS tc ON e.a = tc.b +WHERE tc.path_string NOT LIKE concat('%', e.b, '.%') +) +SELECT * FROM transitive_closure +WHERE b = 6 -- destination +ORDER BY a, b, distance; +a b distance path_string +1 6 2 1.3.6. +1 6 3 1.3.5.6. +WITH RECURSIVE transitive_closure(a, b, distance, path_string) AS +( SELECT a, b, 1 AS distance, +concat(a, '.', b, '.') AS path_string +FROM edges2 +UNION ALL +SELECT tc.a, e.b, tc.distance + 1, +concat(tc.path_string, e.b, '.') AS path_string +FROM edges2 AS e +JOIN transitive_closure AS tc ON e.a = tc.b +WHERE tc.path_string NOT LIKE concat('%', e.b, '.%') +) +SELECT * FROM transitive_closure +ORDER BY a, b, distance; +a b distance path_string +1 2 1 1.2. +1 2 3 1.3.4.2. +1 2 4 1.5.3.4.2. +1 2 4 1.6.3.4.2. +1 2 5 1.5.6.3.4.2. +1 2 5 1.6.5.3.4.2. +1 3 1 1.3. +1 3 2 1.5.3. +1 3 2 1.6.3. +1 3 3 1.2.4.3. +1 3 3 1.5.6.3. +1 3 3 1.6.5.3. +1 4 2 1.2.4. +1 4 2 1.3.4. +1 4 3 1.5.3.4. +1 4 3 1.6.3.4. +1 4 4 1.5.6.3.4. +1 4 4 1.6.5.3.4. +1 5 1 1.5. +1 5 2 1.3.5. +1 5 2 1.6.5. +1 5 3 1.3.6.5. +1 5 3 1.6.3.5. +1 5 4 1.2.4.3.5. +1 5 5 1.2.4.3.6.5. +1 6 1 1.6. +1 6 2 1.3.6. +1 6 2 1.5.6. +1 6 3 1.3.5.6. +1 6 3 1.5.3.6. +1 6 4 1.2.4.3.6. +1 6 5 1.2.4.3.5.6. +1 7 3 1.2.4.7. +1 7 3 1.3.4.7. +1 7 4 1.5.3.4.7. +1 7 4 1.6.3.4.7. +1 7 5 1.5.6.3.4.7. +1 7 5 1.6.5.3.4.7. +2 1 1 2.1. +2 1 3 2.4.3.1. +2 1 4 2.4.3.5.1. +2 1 4 2.4.3.6.1. +2 1 5 2.4.3.5.6.1. +2 1 5 2.4.3.6.5.1. +2 3 2 2.1.3. +2 3 2 2.4.3. +2 3 3 2.1.5.3. +2 3 3 2.1.6.3. +2 3 4 2.1.5.6.3. +2 3 4 2.1.6.5.3. +2 4 1 2.4. +2 4 3 2.1.3.4. +2 4 4 2.1.5.3.4. +2 4 4 2.1.6.3.4. +2 4 5 2.1.5.6.3.4. +2 4 5 2.1.6.5.3.4. +2 5 2 2.1.5. +2 5 3 2.1.3.5. +2 5 3 2.1.6.5. +2 5 3 2.4.3.5. +2 5 4 2.1.3.6.5. +2 5 4 2.1.6.3.5. +2 5 4 2.4.3.1.5. +2 5 4 2.4.3.6.5. +2 5 5 2.4.3.1.6.5. +2 5 5 2.4.3.6.1.5. +2 6 2 2.1.6. +2 6 3 2.1.3.6. +2 6 3 2.1.5.6. +2 6 3 2.4.3.6. +2 6 4 2.1.3.5.6. +2 6 4 2.1.5.3.6. +2 6 4 2.4.3.1.6. +2 6 4 2.4.3.5.6. +2 6 5 2.4.3.1.5.6. +2 6 5 2.4.3.5.1.6. +2 7 2 2.4.7. +2 7 4 2.1.3.4.7. +2 7 5 2.1.5.3.4.7. +2 7 5 2.1.6.3.4.7. +2 7 6 2.1.5.6.3.4.7. +2 7 6 2.1.6.5.3.4.7. +3 1 1 3.1. +3 1 2 3.5.1. +3 1 2 3.6.1. +3 1 3 3.4.2.1. +3 1 3 3.5.6.1. +3 1 3 3.6.5.1. +3 2 2 3.1.2. +3 2 2 3.4.2. +3 2 3 3.5.1.2. +3 2 3 3.6.1.2. +3 2 4 3.5.6.1.2. +3 2 4 3.6.5.1.2. +3 4 1 3.4. +3 4 3 3.1.2.4. +3 4 4 3.5.1.2.4. +3 4 4 3.6.1.2.4. +3 4 5 3.5.6.1.2.4. +3 4 5 3.6.5.1.2.4. +3 5 1 3.5. +3 5 2 3.1.5. +3 5 2 3.6.5. +3 5 3 3.1.6.5. +3 5 3 3.6.1.5. +3 5 4 3.4.2.1.5. +3 5 5 3.4.2.1.6.5. +3 6 1 3.6. +3 6 2 3.1.6. +3 6 2 3.5.6. +3 6 3 3.1.5.6. +3 6 3 3.5.1.6. +3 6 4 3.4.2.1.6. +3 6 5 3.4.2.1.5.6. +3 7 2 3.4.7. +3 7 4 3.1.2.4.7. +3 7 5 3.5.1.2.4.7. +3 7 5 3.6.1.2.4.7. +3 7 6 3.5.6.1.2.4.7. +3 7 6 3.6.5.1.2.4.7. +4 1 2 4.2.1. +4 1 2 4.3.1. +4 1 3 4.3.5.1. +4 1 3 4.3.6.1. +4 1 4 4.3.5.6.1. +4 1 4 4.3.6.5.1. +4 2 1 4.2. +4 2 3 4.3.1.2. +4 2 4 4.3.5.1.2. +4 2 4 4.3.6.1.2. +4 2 5 4.3.5.6.1.2. +4 2 5 4.3.6.5.1.2. +4 3 1 4.3. +4 3 3 4.2.1.3. +4 3 4 4.2.1.5.3. +4 3 4 4.2.1.6.3. +4 3 5 4.2.1.5.6.3. +4 3 5 4.2.1.6.5.3. +4 5 2 4.3.5. +4 5 3 4.2.1.5. +4 5 3 4.3.1.5. +4 5 3 4.3.6.5. +4 5 4 4.2.1.3.5. +4 5 4 4.2.1.6.5. +4 5 4 4.3.1.6.5. +4 5 4 4.3.6.1.5. +4 5 5 4.2.1.3.6.5. +4 5 5 4.2.1.6.3.5. +4 6 2 4.3.6. +4 6 3 4.2.1.6. +4 6 3 4.3.1.6. +4 6 3 4.3.5.6. +4 6 4 4.2.1.3.6. +4 6 4 4.2.1.5.6. +4 6 4 4.3.1.5.6. +4 6 4 4.3.5.1.6. +4 6 5 4.2.1.3.5.6. +4 6 5 4.2.1.5.3.6. +4 7 1 4.7. +5 1 1 5.1. +5 1 2 5.3.1. +5 1 2 5.6.1. +5 1 3 5.3.6.1. +5 1 3 5.6.3.1. +5 1 4 5.3.4.2.1. +5 1 5 5.6.3.4.2.1. +5 2 2 5.1.2. +5 2 3 5.3.1.2. +5 2 3 5.3.4.2. +5 2 3 5.6.1.2. +5 2 4 5.1.3.4.2. +5 2 4 5.3.6.1.2. +5 2 4 5.6.3.1.2. +5 2 4 5.6.3.4.2. +5 2 5 5.1.6.3.4.2. +5 2 5 5.6.1.3.4.2. +5 3 1 5.3. +5 3 2 5.1.3. +5 3 2 5.6.3. +5 3 3 5.1.6.3. +5 3 3 5.6.1.3. +5 3 4 5.1.2.4.3. +5 3 5 5.6.1.2.4.3. +5 4 2 5.3.4. +5 4 3 5.1.2.4. +5 4 3 5.1.3.4. +5 4 3 5.6.3.4. +5 4 4 5.1.6.3.4. +5 4 4 5.3.1.2.4. +5 4 4 5.6.1.2.4. +5 4 4 5.6.1.3.4. +5 4 5 5.3.6.1.2.4. +5 4 5 5.6.3.1.2.4. +5 6 1 5.6. +5 6 2 5.1.6. +5 6 2 5.3.6. +5 6 3 5.1.3.6. +5 6 3 5.3.1.6. +5 6 5 5.1.2.4.3.6. +5 6 5 5.3.4.2.1.6. +5 7 3 5.3.4.7. +5 7 4 5.1.2.4.7. +5 7 4 5.1.3.4.7. +5 7 4 5.6.3.4.7. +5 7 5 5.1.6.3.4.7. +5 7 5 5.3.1.2.4.7. +5 7 5 5.6.1.2.4.7. +5 7 5 5.6.1.3.4.7. +5 7 6 5.3.6.1.2.4.7. +5 7 6 5.6.3.1.2.4.7. +6 1 1 6.1. +6 1 2 6.3.1. +6 1 2 6.5.1. +6 1 3 6.3.5.1. +6 1 3 6.5.3.1. +6 1 4 6.3.4.2.1. +6 1 5 6.5.3.4.2.1. +6 2 2 6.1.2. +6 2 3 6.3.1.2. +6 2 3 6.3.4.2. +6 2 3 6.5.1.2. +6 2 4 6.1.3.4.2. +6 2 4 6.3.5.1.2. +6 2 4 6.5.3.1.2. +6 2 4 6.5.3.4.2. +6 2 5 6.1.5.3.4.2. +6 2 5 6.5.1.3.4.2. +6 3 1 6.3. +6 3 2 6.1.3. +6 3 2 6.5.3. +6 3 3 6.1.5.3. +6 3 3 6.5.1.3. +6 3 4 6.1.2.4.3. +6 3 5 6.5.1.2.4.3. +6 4 2 6.3.4. +6 4 3 6.1.2.4. +6 4 3 6.1.3.4. +6 4 3 6.5.3.4. +6 4 4 6.1.5.3.4. +6 4 4 6.3.1.2.4. +6 4 4 6.5.1.2.4. +6 4 4 6.5.1.3.4. +6 4 5 6.3.5.1.2.4. +6 4 5 6.5.3.1.2.4. +6 5 1 6.5. +6 5 2 6.1.5. +6 5 2 6.3.5. +6 5 3 6.1.3.5. +6 5 3 6.3.1.5. +6 5 5 6.1.2.4.3.5. +6 5 5 6.3.4.2.1.5. +6 7 3 6.3.4.7. +6 7 4 6.1.2.4.7. +6 7 4 6.1.3.4.7. +6 7 4 6.5.3.4.7. +6 7 5 6.1.5.3.4.7. +6 7 5 6.3.1.2.4.7. +6 7 5 6.5.1.2.4.7. +6 7 5 6.5.1.3.4.7. +6 7 6 6.3.5.1.2.4.7. +6 7 6 6.5.3.1.2.4.7. +7 1 3 7.4.2.1. +7 1 3 7.4.3.1. +7 1 4 7.4.3.5.1. +7 1 4 7.4.3.6.1. +7 1 5 7.4.3.5.6.1. +7 1 5 7.4.3.6.5.1. +7 2 2 7.4.2. +7 2 4 7.4.3.1.2. +7 2 5 7.4.3.5.1.2. +7 2 5 7.4.3.6.1.2. +7 2 6 7.4.3.5.6.1.2. +7 2 6 7.4.3.6.5.1.2. +7 3 2 7.4.3. +7 3 4 7.4.2.1.3. +7 3 5 7.4.2.1.5.3. +7 3 5 7.4.2.1.6.3. +7 3 6 7.4.2.1.5.6.3. +7 3 6 7.4.2.1.6.5.3. +7 4 1 7.4. +7 5 3 7.4.3.5. +7 5 4 7.4.2.1.5. +7 5 4 7.4.3.1.5. +7 5 4 7.4.3.6.5. +7 5 5 7.4.2.1.3.5. +7 5 5 7.4.2.1.6.5. +7 5 5 7.4.3.1.6.5. +7 5 5 7.4.3.6.1.5. +7 5 6 7.4.2.1.3.6.5. +7 5 6 7.4.2.1.6.3.5. +7 6 3 7.4.3.6. +7 6 4 7.4.2.1.6. +7 6 4 7.4.3.1.6. +7 6 4 7.4.3.5.6. +7 6 5 7.4.2.1.3.6. +7 6 5 7.4.2.1.5.6. +7 6 5 7.4.3.1.5.6. +7 6 5 7.4.3.5.1.6. +7 6 6 7.4.2.1.3.5.6. +7 6 6 7.4.2.1.5.3.6. +WITH RECURSIVE transitive_closure(a, b, distance, path_string) +AS +( SELECT a, b, 1 AS distance, +concat(a, '.', b, '.') AS path_string +FROM edges2 +UNION ALL +SELECT tc.a, e.b, tc.distance + 1, +concat(tc.path_string, e.b, '.') AS path_string +FROM edges2 AS e +JOIN transitive_closure AS tc ON e.a = tc.b +WHERE tc.path_string NOT LIKE concat('%', e.b, '.%') +) +SELECT a, b, min(distance) AS dist FROM transitive_closure +GROUP BY a, b +ORDER BY a, dist, b; +a b dist +1 2 1 +1 3 1 +1 4 2 +1 5 1 +1 6 1 +1 7 3 +2 1 1 +2 3 2 +2 4 1 +2 5 2 +2 6 2 +2 7 2 +3 1 1 +3 2 2 +3 4 1 +3 5 1 +3 6 1 +3 7 2 +4 1 2 +4 2 1 +4 3 1 +4 5 2 +4 6 2 +4 7 1 +5 1 1 +5 2 2 +5 3 1 +5 4 2 +5 6 1 +5 7 3 +6 1 1 +6 2 2 +6 3 1 +6 4 2 +6 5 1 +6 7 3 +7 1 3 +7 2 2 +7 3 2 +7 4 1 +7 5 3 +7 6 3 +DROP VIEW edges2; +DROP TABLE edges; diff --git a/mysql-test/t/cte_recursive.test b/mysql-test/t/cte_recursive.test index e6a259b8f5821..8cc907957e63e 100644 --- a/mysql-test/t/cte_recursive.test +++ b/mysql-test/t/cte_recursive.test @@ -1389,3 +1389,97 @@ select * from t1; drop view v1; drop table t1,t2; + +--echo # +--echo # MDEV-11259: recursive CTE with concatenation operation +--echo # + +DROP TABLE IF EXISTS edges; +CREATE TABLE edges( + a int(10) unsigned NOT NULL, + b int(10) unsigned NOT NULL, + PRIMARY KEY (a,b), + KEY b(b) +); + +INSERT INTO edges + VALUES (1,3),(2,1),(2,4),(3,4),(3,5),(3,6),(4,7),(5,1),(5,6),(6,1); + +DROP TABLE IF EXISTS edges2; +CREATE VIEW edges2 (a, b) AS + SELECT a, b FROM edges UNION ALL SELECT b, a FROM edges; + +WITH RECURSIVE transitive_closure(a, b, distance, path_string) AS +( SELECT a, b, 1 AS distance, + concat(a, '.', b, '.') AS path_string + FROM edges + + UNION ALL + + SELECT tc.a, e.b, tc.distance + 1, + concat(tc.path_string, e.b, '.') AS path_string + FROM edges AS e + JOIN transitive_closure AS tc + ON e.a = tc.b + WHERE tc.path_string NOT LIKE concat('%', e.b, '.%') +) +SELECT * FROM transitive_closure +ORDER BY a, b, distance; + +--sorted_result +WITH RECURSIVE transitive_closure(a, b, distance, path_string) AS +( SELECT a, b, 1 AS distance, + concat(a, '.', b, '.') AS path_string + FROM edges + WHERE a = 1 -- source + + UNION ALL + + SELECT tc.a, e.b, tc.distance + 1, + concat(tc.path_string, e.b, '.') AS path_string + FROM edges AS e + JOIN transitive_closure AS tc ON e.a = tc.b + WHERE tc.path_string NOT LIKE concat('%', e.b, '.%') +) + SELECT * FROM transitive_closure + WHERE b = 6 -- destination +ORDER BY a, b, distance; + +--sorted_result +WITH RECURSIVE transitive_closure(a, b, distance, path_string) AS +( SELECT a, b, 1 AS distance, + concat(a, '.', b, '.') AS path_string + FROM edges2 + + UNION ALL + + SELECT tc.a, e.b, tc.distance + 1, + concat(tc.path_string, e.b, '.') AS path_string + FROM edges2 AS e + JOIN transitive_closure AS tc ON e.a = tc.b + WHERE tc.path_string NOT LIKE concat('%', e.b, '.%') +) +SELECT * FROM transitive_closure +ORDER BY a, b, distance; + +--sorted_result +WITH RECURSIVE transitive_closure(a, b, distance, path_string) +AS +( SELECT a, b, 1 AS distance, + concat(a, '.', b, '.') AS path_string + FROM edges2 + + UNION ALL + + SELECT tc.a, e.b, tc.distance + 1, + concat(tc.path_string, e.b, '.') AS path_string + FROM edges2 AS e + JOIN transitive_closure AS tc ON e.a = tc.b + WHERE tc.path_string NOT LIKE concat('%', e.b, '.%') +) +SELECT a, b, min(distance) AS dist FROM transitive_closure +GROUP BY a, b +ORDER BY a, dist, b; + +DROP VIEW edges2; +DROP TABLE edges; From 1122c1f0c219a01cdbe5c760b2a846bba80b5949 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Tue, 15 Nov 2016 14:56:29 +0400 Subject: [PATCH 65/71] InnoDB cleanups - added missing backslash - removed duplicate definition of UT_LOW_PRIORITY_CPU/UT_RESUME_PRIORITY_CPU - removed duplicate UT_RESUME_PRIORITY_CPU call --- storage/innobase/include/ut0ut.h | 10 +--------- storage/innobase/ut/ut0ut.cc | 1 - 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h index 470d21edce297..c5355fd9d5cc8 100644 --- a/storage/innobase/include/ut0ut.h +++ b/storage/innobase/include/ut0ut.h @@ -78,19 +78,11 @@ typedef time_t ib_time_t; # else # define UT_RELAX_CPU() do { \ volatile int32 volatile_var; \ - int32 oldval= 0; + int32 oldval= 0; \ my_atomic_cas32(&volatile_var, &oldval, 1); \ } while (0) # endif -# if defined(HAVE_HMT_PRIORITY_INSTRUCTION) -# define UT_LOW_PRIORITY_CPU() __asm__ __volatile__ ("or 1,1,1") -# define UT_RESUME_PRIORITY_CPU() __asm__ __volatile__ ("or 2,2,2") -# else -# define UT_LOW_PRIORITY_CPU() ((void)0) -# define UT_RESUME_PRIORITY_CPU() ((void)0) -# endif - #if defined (__GNUC__) # define UT_COMPILER_BARRIER() __asm__ __volatile__ ("":::"memory") #elif defined (_MSC_VER) diff --git a/storage/innobase/ut/ut0ut.cc b/storage/innobase/ut/ut0ut.cc index 81e3fb1ab90f1..cc315148a903b 100644 --- a/storage/innobase/ut/ut0ut.cc +++ b/storage/innobase/ut/ut0ut.cc @@ -386,7 +386,6 @@ ut_delay( UT_COMPILER_BARRIER(); } - UT_RESUME_PRIORITY_CPU(); UT_RESUME_PRIORITY_CPU(); return(j); From ebe5ebba165863a134c145b1a3709b70925d5100 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 15 Nov 2016 17:04:31 +0400 Subject: [PATCH 66/71] MDEV-9143 JSON_xxx functions. The rest of mysql/json functions implemented. CAST AS JSON implemented. --- include/json_lib.h | 7 + mysql-test/r/dyncol.result | 32 +- mysql-test/r/func_json.result | 93 ++ mysql-test/t/dyncol.test | 16 +- mysql-test/t/func_json.test | 43 + sql/item.h | 12 + sql/item_cmpfunc.cc | 42 +- sql/item_create.cc | 302 ++++++ sql/item_func.h | 2 +- sql/item_jsonfunc.cc | 985 +++++++++++++++++- sql/item_jsonfunc.h | 129 +++ sql/lex.h | 1 + sql/sql_yacc.yy | 7 +- .../connect/mysql-test/connect/disabled.def | 1 + strings/json_lib.c | 6 +- 15 files changed, 1619 insertions(+), 59 deletions(-) diff --git a/include/json_lib.h b/include/json_lib.h index d9e3bb7c6246c..ecd108c75673d 100644 --- a/include/json_lib.h +++ b/include/json_lib.h @@ -226,6 +226,13 @@ int json_scan_next(json_engine_t *j); int json_read_keyname_chr(json_engine_t *j); +/* + Check if the name of the current JSON key matches + the step of the path. +*/ +int json_key_matches(json_engine_t *je, json_string_t *k); + + /* json_read_value() function parses the JSON value syntax, so that we can handle the value of a key or an array item. diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result index 105123e2f1e5e..5b3ab44c19fa6 100644 --- a/mysql-test/r/dyncol.result +++ b/mysql-test/r/dyncol.result @@ -1731,36 +1731,36 @@ column_json(column_create(1, "val", 2, column_create(3, "val2"))) # Time encoding # select hex(column_create("t", "800:46:06.23434" AS time)) as hex, -column_json(column_create("t", "800:46:06.23434" AS time)) as json; -hex json +column_json(column_create("t", "800:46:06.23434" AS time)) as js; +hex js 04010001000000070074649363B82003 {"t":"800:46:06.234340"} select hex(column_create(1, "800:46:06.23434" AS time)) as hex, -column_json(column_create(1, "800:46:06.23434" AS time)) as json; -hex json +column_json(column_create(1, "800:46:06.23434" AS time)) as js; +hex js 000100010007649363B82003 {"1":"800:46:06.234340"} select hex(column_create("t", "800:46:06" AS time)) as hex, -column_json(column_create("t", "800:46:06" AS time)) as json; -hex json +column_json(column_create("t", "800:46:06" AS time)) as js; +hex js 04010001000000070074860B32 {"t":"800:46:06"} select hex(column_create(1, "800:46:06" AS time)) as hex, -column_json(column_create(1, "800:46:06" AS time)) as json; -hex json +column_json(column_create(1, "800:46:06" AS time)) as js; +hex js 000100010007000060B82003 {"1":"800:46:06"} select hex(column_create("t", "2012-12-21 10:46:06.23434" AS datetime)) as hex, -column_json(column_create("t", "2012-12-21 10:46:06.23434" AS datetime)) as json; -hex json +column_json(column_create("t", "2012-12-21 10:46:06.23434" AS datetime)) as js; +hex js 0401000100000005007495B90F649363B80A00 {"t":"2012-12-21 10:46:06.234340"} select hex(column_create(1, "2012-12-21 10:46:06.23434" AS datetime)) as hex, -column_json(column_create(1, "2012-12-21 10:46:06.23434" AS datetime)) as json; -hex json +column_json(column_create(1, "2012-12-21 10:46:06.23434" AS datetime)) as js; +hex js 00010001000595B90F649363B80A00 {"1":"2012-12-21 10:46:06.234340"} select hex(column_create("t", "2012-12-21 10:46:06" AS datetime)) as hex, -column_json(column_create("t", "2012-12-21 10:46:06" AS datetime)) as json; -hex json +column_json(column_create("t", "2012-12-21 10:46:06" AS datetime)) as js; +hex js 0401000100000005007495B90F86AB00 {"t":"2012-12-21 10:46:06"} select hex(column_create(1, "2012-12-21 10:46:06" AS datetime)) as hex, -column_json(column_create(1, "2012-12-21 10:46:06" AS datetime)) as json; -hex json +column_json(column_create(1, "2012-12-21 10:46:06" AS datetime)) as js; +hex js 00010001000595B90F000060B80A00 {"1":"2012-12-21 10:46:06"} # # MDEV-4849: Out of memory error and valgrind warnings on COLUMN_ADD diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result index 1a47dd79fe844..6ee49d687878c 100644 --- a/mysql-test/r/func_json.result +++ b/mysql-test/r/func_json.result @@ -46,6 +46,18 @@ json_array_append('["a", "b"]', '$', FALSE) select json_array_append('{"k1":1, "k2":["a", "b"]}', '$.k2', 2); json_array_append('{"k1":1, "k2":["a", "b"]}', '$.k2', 2) {"k1":1, "k2":["a", "b", 2]} +SELECT JSON_ARRAY_INSERT('["a", {"b": [1, 2]}, [3, 4]]', '$[1]', 'x'); +JSON_ARRAY_INSERT('["a", {"b": [1, 2]}, [3, 4]]', '$[1]', 'x') +["a", "x", {"b": [1, 2]}, [3, 4]] +SELECT JSON_ARRAY_INSERT('["a", {"b": [1, 2]}, [3, 4]]', '$[2]', 'x'); +JSON_ARRAY_INSERT('["a", {"b": [1, 2]}, [3, 4]]', '$[2]', 'x') +["a", {"b": [1, 2]}, "x", [3, 4]] +SELECT JSON_ARRAY_INSERT('["a", {"b": [1, 2]}, [3, 4]]', '$[3]', 'x'); +JSON_ARRAY_INSERT('["a", {"b": [1, 2]}, [3, 4]]', '$[3]', 'x') +["a", {"b": [1, 2]}, [3, 4], "x"] +SELECT JSON_ARRAY_INSERT('["a", {"b": [1, 2]}, [3, 4]]', '$[4]', 'x'); +JSON_ARRAY_INSERT('["a", {"b": [1, 2]}, [3, 4]]', '$[4]', 'x') +["a", {"b": [1, 2]}, [3, 4], "x"] select json_contains('{"k1":123, "k2":345}', '123', '$.k1'); json_contains('{"k1":123, "k2":345}', '123', '$.k1') 1 @@ -91,6 +103,44 @@ json_extract('{"key1":5, "key2":[2,3]}', "$.key1", "$.key2") select json_extract('{"key0":true, "key1":"qwe"}', "$.key1"); json_extract('{"key0":true, "key1":"qwe"}', "$.key1") qwe +select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.k1', 'word'); +json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.k1', 'word') +{"a":1, "b":{"c":1, "k1":"word"}, "d":[1, 2]} +select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.d[3]', 3); +json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.d[3]', 3) +{"a":1, "b":{"c":1}, "d":[1, 2, 3]} +select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.a[2]', 2); +json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.a[2]', 2) +{"a":[1, 2], "b":{"c":1}, "d":[1, 2]} +select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.c', 'word'); +json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.c', 'word') +{"a":1, "b":{"c":1}, "d":[1, 2]} +select json_set('{ "a": 1, "b": [2, 3]}', '$.a', 10, '$.c', '[true, false]'); +json_set('{ "a": 1, "b": [2, 3]}', '$.a', 10, '$.c', '[true, false]') +{ "a": 10, "b": [2, 3], "c":"[true, false]"} +select json_replace('{ "a": 1, "b": [2, 3]}', '$.a', 10, '$.c', '[true, false]'); +json_replace('{ "a": 1, "b": [2, 3]}', '$.a', 10, '$.c', '[true, false]') +{ "a": 10, "b": [2, 3]} +select json_replace('{ "a": 1, "b": [2, 3]}', '$.a', 10, '$.b', '[true, false]'); +json_replace('{ "a": 1, "b": [2, 3]}', '$.a', 10, '$.b', '[true, false]') +{ "a": 10, "b": "[true, false]"} +set @j = '["a", ["b", "c"], "d"]'; +select json_remove(@j, '$[0]'); +json_remove(@j, '$[0]') +[ ["b", "c"], "d"] +select json_remove(@j, '$[1]'); +json_remove(@j, '$[1]') +["a" "d"] +select json_remove(@j, '$[2]'); +json_remove(@j, '$[2]') +["a", ["b", "c"]] +set @j = '{"a": 1, "b": [2, 3]}'; +select json_remove(@j, '$.b'); +json_remove(@j, '$.b') +{"a": 1} +select json_remove(@j, '$.a'); +json_remove(@j, '$.a') +{"b": [2, 3]} select json_object("ki", 1, "mi", "ya"); json_object("ki", 1, "mi", "ya") {"ki": 1, "mi": "ya"} @@ -121,3 +171,46 @@ BOOLEAN select json_type('123'); json_type('123') NUMBER +select json_keys('{"a":{"c":1, "d":2}, "b":2}'); +json_keys('{"a":{"c":1, "d":2}, "b":2}') +["a", "b"] +select json_keys('{"a":{"c":1, "d":2}, "b":2}', "$.a"); +json_keys('{"a":{"c":1, "d":2}, "b":2}', "$.a") +["c", "d"] +select json_keys('{"a":{"c":1, "d":2}, "b":2}', "$.b"); +json_keys('{"a":{"c":1, "d":2}, "b":2}', "$.b") +NULL +SET @j = '["abc", [{"k": "10"}, "def"], {"x":"abc"}, {"y":"bcd"}]'; +select json_search(@j, 'one', 'abc'); +json_search(@j, 'one', 'abc') +"$[0]" +select json_search(@j, 'all', 'abc'); +json_search(@j, 'all', 'abc') +["$[0]", "$[2].x"] +select json_search(@j, 'all', 'abc', NULL, '$[2]'); +json_search(@j, 'all', 'abc', NULL, '$[2]') +"$[2].x" +select json_search(@j, 'all', 'abc', NULL, '$'); +json_search(@j, 'all', 'abc', NULL, '$') +["$[0]", "$[2].x"] +select json_search(@j, 'all', '10', NULL, '$'); +json_search(@j, 'all', '10', NULL, '$') +"$[1][0].k" +select json_search(@j, 'all', '10', NULL, '$[*]'); +json_search(@j, 'all', '10', NULL, '$[*]') +"$[1][0].k" +select json_search(@j, 'all', '10', NULL, '$[*][0].k'); +json_search(@j, 'all', '10', NULL, '$[*][0].k') +"$[1][0].k" +select json_unquote('"abc"'); +json_unquote('"abc"') +abc +select json_object("a", json_object("b", "abcd")); +json_object("a", json_object("b", "abcd")) +{"a": {"b": "abcd"}} +select json_object("a", '{"b": "abcd"}'); +json_object("a", '{"b": "abcd"}') +{"a": "{\"b\": \"abcd\"}"} +select json_object("a", cast('{"b": "abcd"}' as json)); +json_object("a", cast('{"b": "abcd"}' as json)) +{"a": {"b": "abcd"}} diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test index 49b2c5542d349..f8f198be445c7 100644 --- a/mysql-test/t/dyncol.test +++ b/mysql-test/t/dyncol.test @@ -805,24 +805,24 @@ select column_json(column_create(1, "val", 2, column_create(3, "val2"))); --echo # Time encoding --echo # select hex(column_create("t", "800:46:06.23434" AS time)) as hex, - column_json(column_create("t", "800:46:06.23434" AS time)) as json; + column_json(column_create("t", "800:46:06.23434" AS time)) as js; select hex(column_create(1, "800:46:06.23434" AS time)) as hex, - column_json(column_create(1, "800:46:06.23434" AS time)) as json; + column_json(column_create(1, "800:46:06.23434" AS time)) as js; select hex(column_create("t", "800:46:06" AS time)) as hex, - column_json(column_create("t", "800:46:06" AS time)) as json; + column_json(column_create("t", "800:46:06" AS time)) as js; select hex(column_create(1, "800:46:06" AS time)) as hex, - column_json(column_create(1, "800:46:06" AS time)) as json; + column_json(column_create(1, "800:46:06" AS time)) as js; select hex(column_create("t", "2012-12-21 10:46:06.23434" AS datetime)) as hex, - column_json(column_create("t", "2012-12-21 10:46:06.23434" AS datetime)) as json; + column_json(column_create("t", "2012-12-21 10:46:06.23434" AS datetime)) as js; select hex(column_create(1, "2012-12-21 10:46:06.23434" AS datetime)) as hex, - column_json(column_create(1, "2012-12-21 10:46:06.23434" AS datetime)) as json; + column_json(column_create(1, "2012-12-21 10:46:06.23434" AS datetime)) as js; select hex(column_create("t", "2012-12-21 10:46:06" AS datetime)) as hex, - column_json(column_create("t", "2012-12-21 10:46:06" AS datetime)) as json; + column_json(column_create("t", "2012-12-21 10:46:06" AS datetime)) as js; select hex(column_create(1, "2012-12-21 10:46:06" AS datetime)) as hex, - column_json(column_create(1, "2012-12-21 10:46:06" AS datetime)) as json; + column_json(column_create(1, "2012-12-21 10:46:06" AS datetime)) as js; --echo # --echo # MDEV-4849: Out of memory error and valgrind warnings on COLUMN_ADD diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test index 3990ff24fc416..ffe48b0f9dbf6 100644 --- a/mysql-test/t/func_json.test +++ b/mysql-test/t/func_json.test @@ -19,6 +19,11 @@ select json_array(1, "text", false, null); select json_array_append('["a", "b"]', '$', FALSE); select json_array_append('{"k1":1, "k2":["a", "b"]}', '$.k2', 2); +SELECT JSON_ARRAY_INSERT('["a", {"b": [1, 2]}, [3, 4]]', '$[1]', 'x'); +SELECT JSON_ARRAY_INSERT('["a", {"b": [1, 2]}, [3, 4]]', '$[2]', 'x'); +SELECT JSON_ARRAY_INSERT('["a", {"b": [1, 2]}, [3, 4]]', '$[3]', 'x'); +SELECT JSON_ARRAY_INSERT('["a", {"b": [1, 2]}, [3, 4]]', '$[4]', 'x'); + select json_contains('{"k1":123, "k2":345}', '123', '$.k1'); select json_contains('"you"', '"you"'); select json_contains('"youth"', '"you"'); @@ -37,6 +42,24 @@ select json_extract('{"key1":"asd", "key2":[2,3]}', "$.key1", "$.key2"); select json_extract('{"key1":5, "key2":[2,3]}', "$.key1", "$.key2"); select json_extract('{"key0":true, "key1":"qwe"}', "$.key1"); +select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.k1', 'word'); +select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.d[3]', 3); +select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.a[2]', 2); +select json_insert('{"a":1, "b":{"c":1}, "d":[1, 2]}', '$.b.c', 'word'); + +select json_set('{ "a": 1, "b": [2, 3]}', '$.a', 10, '$.c', '[true, false]'); + +select json_replace('{ "a": 1, "b": [2, 3]}', '$.a', 10, '$.c', '[true, false]'); +select json_replace('{ "a": 1, "b": [2, 3]}', '$.a', 10, '$.b', '[true, false]'); + +set @j = '["a", ["b", "c"], "d"]'; +select json_remove(@j, '$[0]'); +select json_remove(@j, '$[1]'); +select json_remove(@j, '$[2]'); +set @j = '{"a": 1, "b": [2, 3]}'; +select json_remove(@j, '$.b'); +select json_remove(@j, '$.a'); + select json_object("ki", 1, "mi", "ya"); select json_exists('{"key1":"xxxx", "key2":[1, 2, 3]}', "$.key2"); @@ -52,3 +75,23 @@ select json_type('[123, "k2", 345]'); select json_type("true"); select json_type('123'); +select json_keys('{"a":{"c":1, "d":2}, "b":2}'); +select json_keys('{"a":{"c":1, "d":2}, "b":2}', "$.a"); +select json_keys('{"a":{"c":1, "d":2}, "b":2}', "$.b"); + +SET @j = '["abc", [{"k": "10"}, "def"], {"x":"abc"}, {"y":"bcd"}]'; +select json_search(@j, 'one', 'abc'); +select json_search(@j, 'all', 'abc'); +select json_search(@j, 'all', 'abc', NULL, '$[2]'); +select json_search(@j, 'all', 'abc', NULL, '$'); +select json_search(@j, 'all', '10', NULL, '$'); +select json_search(@j, 'all', '10', NULL, '$[*]'); +select json_search(@j, 'all', '10', NULL, '$[*][0].k'); + + +select json_unquote('"abc"'); + +select json_object("a", json_object("b", "abcd")); +select json_object("a", '{"b": "abcd"}'); +select json_object("a", cast('{"b": "abcd"}' as json)); + diff --git a/sql/item.h b/sql/item.h index d0d845711f715..20f3be17cce0d 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1457,6 +1457,7 @@ class Item: public Value_source, virtual void set_result_field(Field *field) {} virtual bool is_result_field() { return 0; } virtual bool is_bool_type() { return false; } + virtual bool is_json_type() { return false; } /* This is to handle printing of default values */ virtual bool need_parentheses_in_default() { return false; } virtual void save_in_result_field(bool no_conversions) {} @@ -5763,4 +5764,15 @@ class Item_iterator_row: public Item_iterator void close() {} }; + +/* + It's used in ::fix_fields() methods of LIKE and JSON_SEARCH + functions to handle the ESCAPE parameter. + This parameter is quite non-standard so the specific function. +*/ +bool fix_escape_item(THD *thd, Item *escape_item, String *tmp_str, + bool escape_used_in_parsing, CHARSET_INFO *cmp_cs, + int *escape); + + #endif /* SQL_ITEM_INCLUDED */ diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 193af8631bafc..e10a4ba573f7e 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -5124,13 +5124,10 @@ bool Item_func_like::with_sargable_pattern() const } -bool Item_func_like::fix_fields(THD *thd, Item **ref) +bool fix_escape_item(THD *thd, Item *escape_item, String *tmp_str, + bool escape_used_in_parsing, CHARSET_INFO *cmp_cs, + int *escape) { - DBUG_ASSERT(fixed == 0); - if (Item_bool_func2::fix_fields(thd, ref) || - escape_item->fix_fields(thd, &escape_item)) - return TRUE; - if (!escape_item->const_during_execution()) { my_error(ER_WRONG_ARGUMENTS,MYF(0),"ESCAPE"); @@ -5140,7 +5137,7 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref) if (escape_item->const_item()) { /* If we are on execution stage */ - String *escape_str= escape_item->val_str(&cmp_value1); + String *escape_str= escape_item->val_str(tmp_str); if (escape_str) { const char *escape_str_ptr= escape_str->ptr(); @@ -5153,7 +5150,7 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref) return TRUE; } - if (use_mb(cmp_collation.collation)) + if (use_mb(cmp_cs)) { CHARSET_INFO *cs= escape_str->charset(); my_wc_t wc; @@ -5161,7 +5158,7 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref) (const uchar*) escape_str_ptr, (const uchar*) escape_str_ptr + escape_str->length()); - escape= (int) (rc > 0 ? wc : '\\'); + *escape= (int) (rc > 0 ? wc : '\\'); } else { @@ -5170,25 +5167,40 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref) code instead of Unicode code as "escape" argument. Convert to "cs" if charset of escape differs. */ - CHARSET_INFO *cs= cmp_collation.collation; uint32 unused; if (escape_str->needs_conversion(escape_str->length(), - escape_str->charset(), cs, &unused)) + escape_str->charset(),cmp_cs,&unused)) { char ch; uint errors; - uint32 cnvlen= copy_and_convert(&ch, 1, cs, escape_str_ptr, + uint32 cnvlen= copy_and_convert(&ch, 1, cmp_cs, escape_str_ptr, escape_str->length(), escape_str->charset(), &errors); - escape= cnvlen ? ch : '\\'; + *escape= cnvlen ? ch : '\\'; } else - escape= escape_str_ptr ? *escape_str_ptr : '\\'; + *escape= escape_str_ptr ? *escape_str_ptr : '\\'; } } else - escape= '\\'; + *escape= '\\'; + } + + return FALSE; +} + +bool Item_func_like::fix_fields(THD *thd, Item **ref) +{ + DBUG_ASSERT(fixed == 0); + if (Item_bool_func2::fix_fields(thd, ref) || + escape_item->fix_fields(thd, &escape_item) || + fix_escape_item(thd, escape_item, &cmp_value1, escape_used_in_parsing, + cmp_collation.collation, &escape)) + return TRUE; + + if (escape_item->const_item()) + { /* We could also do boyer-more for non-const items, but as we would have to recompute the tables for each row it's not worth it. diff --git a/sql/item_create.cc b/sql/item_create.cc index cf6f24eddb7ed..9a1a5c62b5bd7 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -1786,6 +1786,19 @@ class Create_func_json_query : public Create_func_arg2 }; +class Create_func_json_keys: public Create_native_func +{ +public: + virtual Item *create_native(THD *thd, LEX_STRING name, List *item_list); + + static Create_func_json_keys s_singleton; + +protected: + Create_func_json_keys() {} + virtual ~Create_func_json_keys() {} +}; + + class Create_func_json_contains: public Create_native_func { public: @@ -1825,6 +1838,19 @@ class Create_func_json_extract : public Create_native_func }; +class Create_func_json_search : public Create_native_func +{ +public: + virtual Item *create_native(THD *thd, LEX_STRING name, List *item_list); + + static Create_func_json_search s_singleton; + +protected: + Create_func_json_search() {} + virtual ~Create_func_json_search() {} +}; + + class Create_func_json_array : public Create_native_func { public: @@ -1851,6 +1877,71 @@ class Create_func_json_array_append : public Create_native_func }; +class Create_func_json_array_insert : public Create_native_func +{ +public: + virtual Item *create_native(THD *thd, LEX_STRING name, List *item_list); + + static Create_func_json_array_insert s_singleton; + +protected: + Create_func_json_array_insert() {} + virtual ~Create_func_json_array_insert() {} +}; + + +class Create_func_json_insert : public Create_native_func +{ +public: + virtual Item *create_native(THD *thd, LEX_STRING name, List *item_list); + + static Create_func_json_insert s_singleton; + +protected: + Create_func_json_insert() {} + virtual ~Create_func_json_insert() {} +}; + + +class Create_func_json_set : public Create_native_func +{ +public: + virtual Item *create_native(THD *thd, LEX_STRING name, List *item_list); + + static Create_func_json_set s_singleton; + +protected: + Create_func_json_set() {} + virtual ~Create_func_json_set() {} +}; + + +class Create_func_json_replace : public Create_native_func +{ +public: + virtual Item *create_native(THD *thd, LEX_STRING name, List *item_list); + + static Create_func_json_replace s_singleton; + +protected: + Create_func_json_replace() {} + virtual ~Create_func_json_replace() {} +}; + + +class Create_func_json_remove : public Create_native_func +{ +public: + virtual Item *create_native(THD *thd, LEX_STRING name, List *item_list); + + static Create_func_json_remove s_singleton; + +protected: + Create_func_json_remove() {} + virtual ~Create_func_json_remove() {} +}; + + class Create_func_json_object : public Create_native_func { public: @@ -1903,6 +1994,19 @@ class Create_func_json_quote : public Create_func_arg1 }; +class Create_func_json_unquote : public Create_func_arg1 +{ +public: + virtual Item *create_1_arg(THD *thd, Item *arg1); + + static Create_func_json_unquote s_singleton; + +protected: + Create_func_json_unquote() {} + virtual ~Create_func_json_unquote() {} +}; + + class Create_func_last_day : public Create_func_arg1 { public: @@ -4830,6 +4934,15 @@ Create_func_json_quote::create_1_arg(THD *thd, Item *arg1) } +Create_func_json_unquote Create_func_json_unquote::s_singleton; + +Item* +Create_func_json_unquote::create_1_arg(THD *thd, Item *arg1) +{ + return new (thd->mem_root) Item_func_json_unquote(thd, arg1); +} + + Create_func_last_day Create_func_last_day::s_singleton; Item* @@ -4885,6 +4998,134 @@ Create_func_json_array_append::create_native(THD *thd, LEX_STRING name, } +Create_func_json_array_insert Create_func_json_array_insert::s_singleton; + +Item* +Create_func_json_array_insert::create_native(THD *thd, LEX_STRING name, + List *item_list) +{ + Item *func= NULL; + int arg_count= 0; + + if (item_list != NULL) + arg_count= item_list->elements; + + if (arg_count < 3 || (arg_count & 1) == 0 /*is even*/) + { + my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str); + } + else + { + func= new (thd->mem_root) Item_func_json_array_insert(thd, *item_list); + } + + return func; +} + + +Create_func_json_insert Create_func_json_insert::s_singleton; + +Item* +Create_func_json_insert::create_native(THD *thd, LEX_STRING name, + List *item_list) +{ + Item *func= NULL; + int arg_count= 0; + + if (item_list != NULL) + arg_count= item_list->elements; + + if (arg_count < 3 || (arg_count & 1) == 0 /*is even*/) + { + my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str); + } + else + { + func= new (thd->mem_root) Item_func_json_insert(true, false, + thd, *item_list); + } + + return func; +} + + +Create_func_json_set Create_func_json_set::s_singleton; + +Item* +Create_func_json_set::create_native(THD *thd, LEX_STRING name, + List *item_list) +{ + Item *func= NULL; + int arg_count= 0; + + if (item_list != NULL) + arg_count= item_list->elements; + + if (arg_count < 3 || (arg_count & 1) == 0 /*is even*/) + { + my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str); + } + else + { + func= new (thd->mem_root) Item_func_json_insert(true, true, + thd, *item_list); + } + + return func; +} + + +Create_func_json_replace Create_func_json_replace::s_singleton; + +Item* +Create_func_json_replace::create_native(THD *thd, LEX_STRING name, + List *item_list) +{ + Item *func= NULL; + int arg_count= 0; + + if (item_list != NULL) + arg_count= item_list->elements; + + if (arg_count < 3 || (arg_count & 1) == 0 /*is even*/) + { + my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str); + } + else + { + func= new (thd->mem_root) Item_func_json_insert(false, true, + thd, *item_list); + } + + return func; +} + + +Create_func_json_remove Create_func_json_remove::s_singleton; + +Item* +Create_func_json_remove::create_native(THD *thd, LEX_STRING name, + List *item_list) +{ + Item *func= NULL; + int arg_count= 0; + + if (item_list != NULL) + arg_count= item_list->elements; + + if (arg_count < 2 /*json_doc, path [,path]*/) + { + my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str); + } + else + { + func= new (thd->mem_root) Item_func_json_remove(thd, *item_list); + } + + return func; +} + + Create_func_json_object Create_func_json_object::s_singleton; Item* @@ -4990,6 +5231,31 @@ Create_func_json_contains::create_native(THD *thd, LEX_STRING name, } +Create_func_json_keys Create_func_json_keys::s_singleton; + +Item* +Create_func_json_keys::create_native(THD *thd, LEX_STRING name, + List *item_list) +{ + Item *func= NULL; + int arg_count= 0; + + if (item_list != NULL) + arg_count= item_list->elements; + + if (arg_count < 1 || arg_count > 2 /* json_doc, [path]...*/) + { + my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str); + } + else + { + func= new (thd->mem_root) Item_func_json_keys(thd, *item_list); + } + + return func; +} + + Create_func_json_contains_path Create_func_json_contains_path::s_singleton; Item* @@ -5040,6 +5306,31 @@ Create_func_json_extract::create_native(THD *thd, LEX_STRING name, } +Create_func_json_search Create_func_json_search::s_singleton; + +Item* +Create_func_json_search::create_native(THD *thd, LEX_STRING name, + List *item_list) +{ + Item *func= NULL; + int arg_count= 0; + + if (item_list != NULL) + arg_count= item_list->elements; + + if (arg_count < 3 /* json_doc, one_or_all, search_str, [escape_char[, path]...*/) + { + my_error(ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT, MYF(0), name.str); + } + else + { + func= new (thd->mem_root) Item_func_json_search(thd, *item_list); + } + + return func; +} + + Create_func_last_insert_id Create_func_last_insert_id::s_singleton; Item* @@ -6313,17 +6604,25 @@ static Native_func_registry func_array[] = { { C_STRING_WITH_LEN("IS_USED_LOCK") }, BUILDER(Create_func_is_used_lock)}, { { C_STRING_WITH_LEN("JSON_ARRAY") }, BUILDER(Create_func_json_array)}, { { C_STRING_WITH_LEN("JSON_ARRAY_APPEND") }, BUILDER(Create_func_json_array_append)}, + { { C_STRING_WITH_LEN("JSON_ARRAY_INSERT") }, BUILDER(Create_func_json_array_insert)}, { { C_STRING_WITH_LEN("JSON_CONTAINS") }, BUILDER(Create_func_json_contains)}, { { C_STRING_WITH_LEN("JSON_CONTAINS_PATH") }, BUILDER(Create_func_json_contains_path)}, { { C_STRING_WITH_LEN("JSON_DEPTH") }, BUILDER(Create_func_json_depth)}, { { C_STRING_WITH_LEN("JSON_EXISTS") }, BUILDER(Create_func_json_exists)}, { { C_STRING_WITH_LEN("JSON_EXTRACT") }, BUILDER(Create_func_json_extract)}, + { { C_STRING_WITH_LEN("JSON_INSERT") }, BUILDER(Create_func_json_insert)}, + { { C_STRING_WITH_LEN("JSON_KEYS") }, BUILDER(Create_func_json_keys)}, { { C_STRING_WITH_LEN("JSON_LENGTH") }, BUILDER(Create_func_json_length)}, { { C_STRING_WITH_LEN("JSON_MERGE") }, BUILDER(Create_func_json_merge)}, { { C_STRING_WITH_LEN("JSON_QUERY") }, BUILDER(Create_func_json_query)}, { { C_STRING_WITH_LEN("JSON_QUOTE") }, BUILDER(Create_func_json_quote)}, { { C_STRING_WITH_LEN("JSON_OBJECT") }, BUILDER(Create_func_json_object)}, + { { C_STRING_WITH_LEN("JSON_REMOVE") }, BUILDER(Create_func_json_remove)}, + { { C_STRING_WITH_LEN("JSON_REPLACE") }, BUILDER(Create_func_json_replace)}, + { { C_STRING_WITH_LEN("JSON_SET") }, BUILDER(Create_func_json_set)}, + { { C_STRING_WITH_LEN("JSON_SEARCH") }, BUILDER(Create_func_json_search)}, { { C_STRING_WITH_LEN("JSON_TYPE") }, BUILDER(Create_func_json_type)}, + { { C_STRING_WITH_LEN("JSON_UNQUOTE") }, BUILDER(Create_func_json_unquote)}, { { C_STRING_WITH_LEN("JSON_VALID") }, BUILDER(Create_func_json_valid)}, { { C_STRING_WITH_LEN("JSON_VALUE") }, BUILDER(Create_func_json_value)}, { { C_STRING_WITH_LEN("LAST_DAY") }, BUILDER(Create_func_last_day)}, @@ -6716,6 +7015,9 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type, res= new (thd->mem_root) Item_char_typecast(thd, a, len, real_cs); break; } + case ITEM_CAST_JSON: + res= new (thd->mem_root) Item_json_typecast(thd, a); + break; default: { DBUG_ASSERT(0); diff --git a/sql/item_func.h b/sql/item_func.h index ca7c48190126e..374c16e393276 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -2197,7 +2197,7 @@ enum Cast_target { ITEM_CAST_BINARY, ITEM_CAST_SIGNED_INT, ITEM_CAST_UNSIGNED_INT, ITEM_CAST_DATE, ITEM_CAST_TIME, ITEM_CAST_DATETIME, ITEM_CAST_CHAR, - ITEM_CAST_DECIMAL, ITEM_CAST_DOUBLE + ITEM_CAST_DECIMAL, ITEM_CAST_DOUBLE, ITEM_CAST_JSON }; diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 80713710927d4..4fa2f02bedc88 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -48,6 +48,45 @@ static bool eq_ascii_string(const CHARSET_INFO *cs, } +static bool append_simple(String *s, const char *a, uint a_len) +{ + if (!s->realloc_with_extra_if_needed(s->length() + a_len)) + { + s->q_append(a, a_len); + return FALSE; + } + + return TRUE; +} + + +static inline bool append_simple(String *s, const uchar *a, uint a_len) +{ + return append_simple(s, (const char *) a, a_len); +} + + +/* + Appends JSON string to the String object taking charsets in + consideration. +static int st_append_json(String *s, + CHARSET_INFO *json_cs, const uchar *js, uint js_len) +{ + int str_len= js_len * s->charset()->mbmaxlen; + + if (!s->reserve(str_len, 1024) && + (str_len= json_unescape(json_cs, js, js + js_len, + s->charset(), (uchar *) s->end(), (uchar *) s->end() + str_len)) > 0) + { + s->length(s->length() + str_len); + return 0; + } + + return js_len; +} +*/ + + /* Appends arbitrary String to the JSON string taking charsets in consideration. @@ -278,6 +317,50 @@ String *Item_func_json_quote::val_str(String *str) } +void Item_func_json_unquote::fix_length_and_dec() +{ + collation.set(&my_charset_utf8_general_ci); + max_length= args[0]->max_length; +} + + +String *Item_func_json_unquote::val_str(String *str) +{ + String *js= args[0]->val_str(&tmp_s); + json_engine_t je; + int c_len; + + if ((null_value= args[0]->null_value)) + return NULL; + + json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), + (const uchar *) js->ptr() + js->length()); + + if (json_read_value(&je)) + goto error; + + if (je.value_type != JSON_VALUE_STRING) + return js; + + str->length(0); + str->set_charset(&my_charset_utf8_general_ci); + + if (str->realloc_with_extra_if_needed(je.value_len) || + (c_len= json_unescape(js->charset(), + je.value, je.value + je.value_len, + &my_charset_utf8_general_ci, + (uchar *) str->ptr(), (uchar *) (str->ptr() + je.value_len))) < 0) + goto error; + + str->length(c_len); + return str; + +error: + null_value= 1; + return 0; +} + + static int alloc_tmp_paths(THD *thd, uint n_paths, json_path_with_flags **paths,String **tmp_paths) { @@ -642,6 +725,27 @@ void Item_func_json_contains_path::cleanup() } +static int parse_one_or_all(Item *ooa_arg, + bool *ooa_parsed, bool ooa_constant, bool *mode_one) +{ + if (!*ooa_parsed) + { + char buff[20]; + String *res, tmp(buff, sizeof(buff), &my_charset_bin); + res= ooa_arg->val_str(&tmp); + *mode_one=eq_ascii_string(res->charset(), "one", + res->ptr(), res->length()); + if (!*mode_one) + { + if (!eq_ascii_string(res->charset(), "all", res->ptr(), res->length())) + return TRUE; + } + *ooa_parsed= ooa_constant; + } + return FALSE; +} + + longlong Item_func_json_contains_path::val_int() { String *js= args[0]->val_str(&tmp_js); @@ -652,20 +756,8 @@ longlong Item_func_json_contains_path::val_int() if ((null_value= args[0]->null_value)) return 0; - if (!ooa_parsed) - { - char buff[20]; - String *res, tmp(buff, sizeof(buff), &my_charset_bin); - res= args[1]->val_str(&tmp); - mode_one=eq_ascii_string(res->charset(), "one", - res->ptr(), res->length()); - if (!mode_one) - { - if (!eq_ascii_string(res->charset(), "all", res->ptr(), res->length())) - goto error; - } - ooa_parsed= ooa_constant; - } + if (parse_one_or_all(args[1], &ooa_parsed, ooa_constant, &mode_one)) + goto error; result= !mode_one; for (n_arg=2; n_arg < arg_count; n_arg++) @@ -742,6 +834,9 @@ static int append_json_value(String *str, Item *item, String *tmp_val) String *sv= item->val_str(tmp_val); if (item->null_value) goto append_null; + if (item->is_json_type()) + return str->append(sv->ptr(), sv->length()); + if (item->result_type() == STRING_RESULT) { return str->append("\"", 1) || @@ -915,6 +1010,117 @@ String *Item_func_json_array_append::val_str(String *str) } +String *Item_func_json_array_insert::val_str(String *str) +{ + json_engine_t je; + String *js= args[0]->val_str(&tmp_js); + uint n_arg, n_path; + + DBUG_ASSERT(fixed == 1); + + if ((null_value= args[0]->null_value)) + return 0; + + for (n_arg=1, n_path=0; n_arg < arg_count; n_arg+=2, n_path++) + { + uint array_counters[JSON_DEPTH_LIMIT]; + json_path_with_flags *c_path= paths + n_path; + const char *item_pos; + uint n_item; + + if (!c_path->parsed) + { + String *s_p= args[n_arg]->val_str(tmp_paths+n_path); + if (s_p && + (json_path_setup(&c_path->p,s_p->charset(),(const uchar *) s_p->ptr(), + (const uchar *) s_p->ptr() + s_p->length()) || + c_path->p.last_step - 1 > c_path->p.steps || + c_path->p.last_step->type != JSON_PATH_ARRAY)) + goto error; + c_path->parsed= c_path->constant; + c_path->p.last_step--; + } + if (args[n_arg]->null_value) + goto null_return; + + json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), + (const uchar *) js->ptr() + js->length()); + + c_path->cur_step= c_path->p.steps; + + if (json_find_path(&je, &c_path->p, &c_path->cur_step, array_counters)) + { + if (je.s.error) + goto error; + + /* Can't find the array to insert. */ + goto null_return; + } + + if (json_read_value(&je)) + goto error; + + if (je.value_type != JSON_VALUE_ARRAY) + { + /* Must be an array. */ + goto null_return; + } + + item_pos= 0; + n_item= 0; + + while (json_scan_next(&je) == 0 && + je.state != JST_ARRAY_END && item_pos == 0) + { + switch (je.state) + { + case JST_VALUE: + if (n_item == c_path->p.last_step[1].n_item) + { + item_pos= (const char *) je.s.c_str; + break; + } + n_item++; + break; + case JST_OBJ_START: + case JST_ARRAY_START: + if (json_skip_level(&je)) + break; + break; + default: + break; + } + } + + str->length(0); + str->set_charset(js->charset()); + if (!item_pos) + item_pos= (const char *) (je.s.c_str - je.sav_c_len); + + if (append_simple(str, js->ptr(), item_pos - js->ptr()) || + ((je.state == JST_ARRAY_END) ? + (n_item > 0 && str->append(", ", 2)) : str->append(" ", 1)) || + append_json_value(str, args[n_arg+1], &tmp_val) || + (je.state != JST_ARRAY_END && str->append(",", 1)) || + append_simple(str, item_pos, js->end() - item_pos)) + goto error; /* Out of memory. */ + + { + String *tmp_str= str; + str= &tmp_js; + js= tmp_str; + } + } + + return js; + +null_return: +error: + null_value= 1; + return 0; +} + + String *Item_func_json_object::val_str(String *str) { DBUG_ASSERT(fixed == 1); @@ -1107,3 +1313,754 @@ String *Item_func_json_type::val_str(String *str) } +void Item_func_json_insert::fix_length_and_dec() +{ + uint n_arg; + ulonglong char_length; + + collation.set(args[0]->collation); + char_length= args[0]->max_char_length(); + + for (n_arg= 1; n_arg < arg_count; n_arg+= 2) + { + paths[n_arg-1].set_constant_flag(args[n_arg]->const_item()); + char_length+= args[n_arg+1]->max_char_length() + 4; + } + + fix_char_length_ulonglong(char_length); +} + + +String *Item_func_json_insert::val_str(String *str) +{ + json_engine_t je; + String *js= args[0]->val_str(&tmp_js); + uint n_arg, n_path; + json_string_t key_name; + + DBUG_ASSERT(fixed == 1); + + if ((null_value= args[0]->null_value)) + return 0; + + str->set_charset(js->charset()); + json_string_set_cs(&key_name, js->charset()); + + for (n_arg=1, n_path=0; n_arg < arg_count; n_arg+=2, n_path++) + { + uint array_counters[JSON_DEPTH_LIMIT]; + json_path_with_flags *c_path= paths + n_path; + const char *v_to; + const json_path_step_t *lp; + + if (!c_path->parsed) + { + String *s_p= args[n_arg]->val_str(tmp_paths+n_path); + if (s_p) + { + if (json_path_setup(&c_path->p,s_p->charset(), + (const uchar *) s_p->ptr(), + (const uchar *) s_p->ptr() + s_p->length())) + goto error; + + /* We search to the last step. */ + c_path->p.last_step--; + } + c_path->parsed= c_path->constant; + } + if (args[n_arg]->null_value) + { + null_value= 1; + return 0; + } + + json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), + (const uchar *) js->ptr() + js->length()); + + c_path->cur_step= c_path->p.steps; + + if (c_path->p.last_step >= c_path->p.steps && + json_find_path(&je, &c_path->p, &c_path->cur_step, array_counters)) + { + if (je.s.error) + goto error; + } + + if (json_read_value(&je)) + goto error; + + lp= c_path->p.last_step+1; + if (lp->type == JSON_PATH_ARRAY) + { + uint n_item= 0; + + if (je.value_type != JSON_VALUE_ARRAY) + { + const uchar *v_from= je.value_begin; + if (!mode_insert) + continue; + + str->length(0); + /* Wrap the value as an array. */ + if (append_simple(str, js->ptr(), (const char *) v_from - js->ptr()) || + str->append("[", 1)) + goto error; /* Out of memory. */ + + if (je.value_type == JSON_VALUE_OBJECT) + { + if (json_skip_level(&je)) + goto error; + } + + if (append_simple(str, v_from, je.s.c_str - v_from) || + str->append(", ", 2) || + append_json_value(str, args[n_arg+1], &tmp_val) || + str->append("]", 1) || + append_simple(str, je.s.c_str, js->end()-(const char *) je.s.c_str)) + goto error; /* Out of memory. */ + + goto continue_point; + } + + while (json_scan_next(&je) == 0 && je.state != JST_ARRAY_END) + { + switch (je.state) + { + case JST_VALUE: + if (n_item == lp->n_item) + goto v_found; + n_item++; + if (json_skip_array_item(&je)) + goto error; + break; + default: + break; + } + } + + if (je.s.error) + goto error; + + if (!mode_insert) + continue; + + v_to= (const char *) (je.s.c_str - je.sav_c_len); + str->length(0); + if (append_simple(str, js->ptr(), v_to - js->ptr()) || + str->append(", ", 2) || + append_json_value(str, args[n_arg+1], &tmp_val) || + append_simple(str, v_to, js->end() - v_to)) + goto error; /* Out of memory. */ + } + else /*JSON_PATH_KEY*/ + { + if (je.value_type != JSON_VALUE_OBJECT) + continue; + + while (json_scan_next(&je) == 0 && je.state != JST_OBJ_END) + { + switch (je.state) + { + case JST_KEY: + json_string_set_str(&key_name, lp->key, lp->key_end); + if (json_key_matches(&je, &key_name)) + goto v_found; + if (json_skip_key(&je)) + goto error; + break; + default: + break; + } + } + + if (je.s.error) + goto error; + + if (!mode_insert) + continue; + + v_to= (const char *) (je.s.c_str - je.sav_c_len); + str->length(0); + if (append_simple(str, js->ptr(), v_to - js->ptr()) || + str->append(", \"", 3) || + append_simple(str, lp->key, lp->key_end - lp->key) || + str->append("\":", 2) || + append_json_value(str, args[n_arg+1], &tmp_val) || + append_simple(str, v_to, js->end() - v_to)) + goto error; /* Out of memory. */ + } + + goto continue_point; + +v_found: + + if (!mode_replace) + continue; + + if (json_read_value(&je)) + goto error; + + v_to= (const char *) je.value_begin; + str->length(0); + if (!json_value_scalar(&je)) + { + if (json_skip_level(&je)) + goto error; + } + + if (append_simple(str, js->ptr(), v_to - js->ptr()) || + append_json_value(str, args[n_arg+1], &tmp_val) || + append_simple(str, je.s.c_str, js->end()-(const char *) je.s.c_str)) + goto error; /* Out of memory. */ +continue_point: + { + String *tmp= str; + str= &tmp_js; + js= tmp; + } + } + + return js; + +error: + null_value= 1; + return 0; +} + + +void Item_func_json_remove::fix_length_and_dec() +{ + collation.set(args[0]->collation); + max_length= args[0]->max_length; + + mark_constant_paths(paths, args+1, arg_count-1); +} + + +String *Item_func_json_remove::val_str(String *str) +{ + json_engine_t je; + String *js= args[0]->val_str(&tmp_js); + uint n_arg, n_path; + json_string_t key_name; + + DBUG_ASSERT(fixed == 1); + + if (args[0]->null_value) + goto null_return; + + str->set_charset(js->charset()); + json_string_set_cs(&key_name, js->charset()); + + for (n_arg=1, n_path=0; n_arg < arg_count; n_arg+=2, n_path++) + { + uint array_counters[JSON_DEPTH_LIMIT]; + json_path_with_flags *c_path= paths + n_path; + const char *rem_start, *rem_end; + const json_path_step_t *lp; + uint n_item= 0; + + if (!c_path->parsed) + { + String *s_p= args[n_arg]->val_str(tmp_paths+n_path); + if (s_p) + { + if (json_path_setup(&c_path->p,s_p->charset(), + (const uchar *) s_p->ptr(), + (const uchar *) s_p->ptr() + s_p->length())) + goto error; + + /* We search to the last step. */ + c_path->p.last_step--; + if (c_path->p.last_step < c_path->p.steps) + goto null_return; + } + c_path->parsed= c_path->constant; + } + if (args[n_arg]->null_value) + { + null_value= 1; + return 0; + } + + json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), + (const uchar *) js->ptr() + js->length()); + + c_path->cur_step= c_path->p.steps; + + if (json_find_path(&je, &c_path->p, &c_path->cur_step, array_counters)) + { + if (je.s.error) + goto error; + } + + if (json_read_value(&je)) + goto error; + + lp= c_path->p.last_step+1; + if (lp->type == JSON_PATH_ARRAY) + { + if (je.value_type != JSON_VALUE_ARRAY) + continue; + + while (json_scan_next(&je) == 0 && je.state != JST_ARRAY_END) + { + switch (je.state) + { + case JST_VALUE: + if (n_item == lp->n_item) + { + rem_start= (const char *) (je.s.c_str - + (n_item ? je.sav_c_len : 0)); + goto v_found; + } + n_item++; + if (json_skip_array_item(&je)) + goto error; + break; + default: + break; + } + } + + if (je.s.error) + goto error; + + continue; + } + else /*JSON_PATH_KEY*/ + { + if (je.value_type != JSON_VALUE_OBJECT) + continue; + + while (json_scan_next(&je) == 0 && je.state != JST_OBJ_END) + { + switch (je.state) + { + case JST_KEY: + if (n_item == 0) + rem_start= (const char *) (je.s.c_str - je.sav_c_len); + json_string_set_str(&key_name, lp->key, lp->key_end); + if (json_key_matches(&je, &key_name)) + { + goto v_found; + } + + if (json_skip_key(&je)) + goto error; + + rem_start= (const char *) je.s.c_str; + n_item++; + break; + default: + break; + } + } + + if (je.s.error) + goto error; + + continue; + } + +v_found: + + if (json_skip_key(&je) || json_scan_next(&je)) + goto error; + + rem_end= (je.state == JST_VALUE) ? + (const char *) je.s.c_str : (const char *) (je.s.c_str - je.sav_c_len); + + str->length(0); + + if (append_simple(str, js->ptr(), rem_start - js->ptr()) || + append_simple(str, rem_end, js->end() - rem_end)) + goto error; /* Out of memory. */ + + { + String *tmp= str; + str= &tmp_js; + js= tmp; + } + } + + return js; + +null_return: +error: + null_value= 1; + return 0; +} + + +void Item_func_json_keys::fix_length_and_dec() +{ + collation.set(args[0]->collation); + max_length= args[0]->max_length; + if (arg_count > 1) + path.set_constant_flag(args[1]->const_item()); +} + + +String *Item_func_json_keys::val_str(String *str) +{ + json_engine_t je; + String *js= args[0]->val_str(&tmp_js); + uint n_keys= 0; + uint array_counters[JSON_DEPTH_LIMIT]; + + if ((args[0]->null_value)) + goto null_return; + + json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), + (const uchar *) js->ptr() + js->length()); + + if (arg_count < 2) + goto skip_search; + + if (!path.parsed) + { + String *s_p= args[1]->val_str(&tmp_path); + if (s_p && + json_path_setup(&path.p, s_p->charset(), (const uchar *) s_p->ptr(), + (const uchar *) s_p->ptr() + s_p->length())) + goto err_return; + path.parsed= path.constant; + } + + if (args[1]->null_value) + goto null_return; + + path.cur_step= path.p.steps; + + if (json_find_path(&je, &path.p, &path.cur_step, array_counters)) + { + if (je.s.error) + goto err_return; + + goto null_return; + } + +skip_search: + if (json_read_value(&je)) + goto err_return; + + if (je.value_type != JSON_VALUE_OBJECT) + goto null_return; + + str->length(0); + if (str->append("[", 1)) + goto err_return; /* Out of memory. */ + /* Parse the OBJECT collecting the keys. */ + while (json_scan_next(&je) == 0 && je.state != JST_OBJ_END) + { + const uchar *key_start, *key_end; + + switch (je.state) + { + case JST_KEY: + key_start= je.s.c_str; + while (json_read_keyname_chr(&je) == 0) + { + key_end= je.s.c_str; + } + if (je.s.error || + (n_keys > 0 && str->append(", ", 2)) || + str->append("\"", 1) || + append_simple(str, key_start, key_end - key_start) || + str->append("\"", 1)) + goto err_return; + n_keys++; + break; + case JST_OBJ_START: + case JST_ARRAY_START: + if (json_skip_level(&je)) + break; + break; + default: + break; + } + } + + if (je.s.error || str->append("]", 1)) + goto err_return; + + null_value= 0; + return str; + +null_return: +err_return: + null_value= 1; + return 0; +} + + +bool Item_func_json_search::fix_fields(THD *thd, Item **ref) +{ + if (Item_json_str_multipath::fix_fields(thd, ref)) + return TRUE; + + if (arg_count < 4) + return FALSE; + + return fix_escape_item(thd, args[3], &tmp_js, true, + args[0]->collation.collation, &escape); +} + + +static const uint SQR_MAX_BLOB_WIDTH= sqrt(MAX_BLOB_WIDTH); + +void Item_func_json_search::fix_length_and_dec() +{ + collation.set(args[0]->collation); + + /* + It's rather difficult to estimate the length of the result. + I belive arglen^2 is the reasonable upper limit. + */ + if (args[0]->max_length > SQR_MAX_BLOB_WIDTH) + max_length= MAX_BLOB_WIDTH; + else + { + max_length= args[0]->max_length; + max_length*= max_length; + } + + ooa_constant= args[1]->const_item(); + ooa_parsed= FALSE; + + if (arg_count > 4) + mark_constant_paths(paths, args+4, arg_count-4); +} + + +int Item_func_json_search::compare_json_value_wild(json_engine_t *je, + const String *cmp_str) +{ + return my_wildcmp(collation.collation, + (const char *) je->value, (const char *) (je->value + je->value_len), + cmp_str->ptr(), cmp_str->end(), escape, wild_one, wild_many) ? 0 : 1; +} + + +static int append_json_path(String *str, const json_path_t *p) +{ + const json_path_step_t *c; + + if (str->append("\"$", 2)) + return TRUE; + + for (c= p->steps+1; c <= p->last_step; c++) + { + if (c->type == JSON_PATH_KEY) + { + if (str->append(".", 1) || + append_simple(str, c->key, c->key_end-c->key)) + return TRUE; + } + else /*JSON_PATH_ARRAY*/ + { + + if (str->append("[", 1) || + str->append_ulonglong(c->n_item) || + str->append("]", 1)) + return TRUE; + } + } + + return str->append("\"", 1); +} + + +static int json_path_compare(const json_path_t *a, const json_path_t *b) +{ + uint i, a_len= a->last_step - a->steps, b_len= b->last_step - b->steps; + + if (a_len > b_len) + return -2; + + for (i=0; i <= a_len; i++) + { + const json_path_step_t *sa= a->steps + i; + const json_path_step_t *sb= b->steps + i; + + if (sa->type != sb->type) + return -1; + + if (sa->type == JSON_PATH_ARRAY) + { + if (!sa->wild && sa->n_item != sb->n_item) + return -1; + } + else /* JSON_PATH_KEY */ + { + if (!sa->wild && + (sa->key_end - sa->key != sb->key_end - sb->key || + memcmp(sa->key, sb->key, sa->key_end - sa->key) != 0)) + return -1; + } + } + + return b_len > a_len; +} + + +static bool path_ok(const json_path_with_flags *paths_list, int n_paths, + const json_path_t *p) +{ + for (; n_paths > 0; n_paths--, paths_list++) + { + if (json_path_compare(&paths_list->p, p) >= 0) + return TRUE; + } + return FALSE; +} + + +String *Item_func_json_search::val_str(String *str) +{ + String *js= args[0]->val_str(&tmp_js); + String *s_str= args[2]->val_str(&tmp_js); + json_engine_t je; + json_path_t p, sav_path; + uint n_arg; + + if (args[0]->null_value || args[2]->null_value) + goto null_return; + + if (parse_one_or_all(args[1], &ooa_parsed, ooa_constant, &mode_one)) + goto error; + + if (args[1]->null_value) + goto null_return; + + n_path_found= 0; + str->set_charset(js->charset()); + str->length(0); + + for (n_arg=4; n_arg < arg_count; n_arg++) + { + json_path_with_flags *c_path= paths + n_arg - 4; + if (!c_path->parsed) + { + String *s_p= args[n_arg]->val_str(tmp_paths + (n_arg-1)); + if (s_p && + json_path_setup(&c_path->p,s_p->charset(),(const uchar *) s_p->ptr(), + (const uchar *) s_p->ptr() + s_p->length())) + goto error; + c_path->parsed= c_path->constant; + } + } + + json_scan_start(&je, js->charset(),(const uchar *) js->ptr(), + (const uchar *) js->ptr() + js->length()); + + p.last_step= p.steps; + p.steps[0].wild= 0; + p.steps[0].type= JSON_PATH_ARRAY; + p.steps[0].n_item= 0; + + do + { + switch (je.state) + { + case JST_KEY: + p.last_step->key= je.s.c_str; + while (json_read_keyname_chr(&je) == 0) + p.last_step->key_end= je.s.c_str; + if (je.s.error) + goto error; + /* Now we have je.state == JST_VALUE, so let's handle it. */ + + case JST_VALUE: + if (json_read_value(&je)) + goto error; + if (json_value_scalar(&je)) + { + if ((arg_count < 5 || path_ok(paths, n_arg - 4, &p)) && + compare_json_value_wild(&je, s_str) != 0) + { + ++n_path_found; + if (n_path_found == 1) + { + sav_path= p; + sav_path.last_step= sav_path.steps + (p.last_step - p.steps); + } + else + { + if (n_path_found == 2) + { + if (str->append("[", 1) || + append_json_path(str, &sav_path)) + goto error; + } + if (str->append(", ", 2) || append_json_path(str, &p)) + goto error; + } + + if (mode_one) + goto end; + } + if (p.last_step->type == JSON_PATH_ARRAY) + p.last_step->n_item++; + + } + else + { + p.last_step++; + if (je.value_type == JSON_VALUE_ARRAY) + { + p.last_step->type= JSON_PATH_ARRAY; + p.last_step->n_item= 0; + } + else /*JSON_VALUE_OBJECT*/ + p.last_step->type= JSON_PATH_KEY; + } + + break; + case JST_OBJ_END: + case JST_ARRAY_END: + p.last_step--; + if (p.last_step->type == JSON_PATH_ARRAY) + p.last_step->n_item++; + break; + default: + break; + } + } while (json_scan_next(&je) == 0); + + if (je.s.error) + goto error; + +end: + if (n_path_found == 0) + goto null_return; + if (n_path_found == 1) + { + if (append_json_path(str, &sav_path)) + goto error; + } + else + { + if (str->append("]", 1)) + goto error; + } + + return str; + + +null_return: +error: + /* TODO: launch error messages. */ + null_value= 1; + return 0; +} + + +void Item_json_typecast::fix_length_and_dec() +{ + maybe_null= args[0]->maybe_null; + max_length= args[0]->max_length; +} + + diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h index 54da67b5ab99f..d2d68b4c39125 100644 --- a/sql/item_jsonfunc.h +++ b/sql/item_jsonfunc.h @@ -123,6 +123,21 @@ class Item_func_json_quote: public Item_str_func }; +class Item_func_json_unquote: public Item_str_func +{ +protected: + String tmp_s; + +public: + Item_func_json_unquote(THD *thd, Item *s): Item_str_func(thd, s) {} + const char *func_name() const { return "json_unquote"; } + void fix_length_and_dec(); + String *val_str(String *); + Item *get_copy(THD *thd, MEM_ROOT *mem_root) + { return get_item_copy(thd, mem_root, this); } +}; + + class Item_json_str_multipath: public Item_str_func { protected: @@ -134,6 +149,7 @@ class Item_json_str_multipath: public Item_str_func bool fix_fields(THD *thd, Item **ref); void cleanup(); virtual uint get_n_paths() const = 0; + bool is_json_type() { return true; } }; @@ -207,6 +223,7 @@ class Item_func_json_array: public Item_str_func Item_func_json_array(THD *thd, List &list): Item_str_func(thd, list) {} String *val_str(String *); + bool is_json_type() { return true; } void fix_length_and_dec(); const char *func_name() const { return "json_array"; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) @@ -231,6 +248,18 @@ class Item_func_json_array_append: public Item_json_str_multipath }; +class Item_func_json_array_insert: public Item_func_json_array_append +{ +public: + Item_func_json_array_insert(THD *thd, List &list): + Item_func_json_array_append(thd, list) {} + String *val_str(String *); + const char *func_name() const { return "json_array_insert"; } + Item *get_copy(THD *thd, MEM_ROOT *mem_root) + { return get_item_copy(thd, mem_root, this); } +}; + + class Item_func_json_object: public Item_func_json_array { public: @@ -239,6 +268,7 @@ class Item_func_json_object: public Item_func_json_array Item_func_json_object(THD *thd, List &list): Item_func_json_array(thd, list) {} String *val_str(String *); + bool is_json_type() { return true; } const char *func_name() const { return "json_object"; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } @@ -253,6 +283,7 @@ class Item_func_json_merge: public Item_func_json_array Item_func_json_merge(THD *thd, List &list): Item_func_json_array(thd, list) {} String *val_str(String *); + bool is_json_type() { return true; } const char *func_name() const { return "json_merge"; } Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } @@ -301,4 +332,102 @@ class Item_func_json_type: public Item_str_func }; +class Item_func_json_insert: public Item_json_str_multipath +{ +protected: + String tmp_js; + String tmp_val; + bool mode_insert, mode_replace; +public: + Item_func_json_insert(bool i_mode, bool r_mode, THD *thd, List &list): + Item_json_str_multipath(thd, list), + mode_insert(i_mode), mode_replace(r_mode) {} + void fix_length_and_dec(); + String *val_str(String *); + uint get_n_paths() const { return arg_count/2; } + const char *func_name() const + { + return mode_insert ? + (mode_replace ? "json_set" : "json_insert") : "json_update"; + } + Item *get_copy(THD *thd, MEM_ROOT *mem_root) + { return get_item_copy(thd, mem_root, this); } +}; + + +class Item_func_json_remove: public Item_json_str_multipath +{ +protected: + String tmp_js; +public: + Item_func_json_remove(THD *thd, List &list): + Item_json_str_multipath(thd, list) {} + void fix_length_and_dec(); + String *val_str(String *); + uint get_n_paths() const { return arg_count - 1; } + const char *func_name() const { return "json_remove"; } + Item *get_copy(THD *thd, MEM_ROOT *mem_root) + { return get_item_copy(thd, mem_root, this); } +}; + + +class Item_func_json_keys: public Item_str_func +{ +protected: + json_path_with_flags path; + String tmp_js, tmp_path; + +public: + Item_func_json_keys(THD *thd, List &list): + Item_str_func(thd, list) {} + const char *func_name() const { return "json_keys"; } + void fix_length_and_dec(); + String *val_str(String *); + Item *get_copy(THD *thd, MEM_ROOT *mem_root) + { return get_item_copy(thd, mem_root, this); } +}; + + +class Item_func_json_search: public Item_json_str_multipath +{ +protected: + String tmp_js; + bool mode_one; + bool ooa_constant, ooa_parsed; + int escape; + int n_path_found; + json_path_t sav_path; + + int compare_json_value_wild(json_engine_t *je, const String *cmp_str); + +public: + Item_func_json_search(THD *thd, List &list): + Item_json_str_multipath(thd, list) {} + const char *func_name() const { return "json_search"; } + bool fix_fields(THD *thd, Item **ref); + void fix_length_and_dec(); + String *val_str(String *); + uint get_n_paths() const { return arg_count > 4 ? arg_count - 4 : 0; } + Item *get_copy(THD *thd, MEM_ROOT *mem_root) + { return get_item_copy(thd, mem_root, this); } +}; + + +class Item_json_typecast: public Item_str_func +{ +public: + Item_json_typecast(THD *thd, Item *a): Item_str_func(thd, a) {} + const char *func_name() const { return "cast_as_json"; } + bool is_json_type() { return true; } + void fix_length_and_dec(); + String *val_str(String *str) + { + return args[0]->val_str(str); + } + + Item *get_copy(THD *thd, MEM_ROOT *mem_root) + { return get_item_copy(thd, mem_root, this); } +}; + + #endif /* ITEM_JSONFUNC_INCLUDED */ diff --git a/sql/lex.h b/sql/lex.h index 527ddb81c4b19..114bafeee1829 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -309,6 +309,7 @@ static SYMBOL symbols[] = { { "ITERATE", SYM(ITERATE_SYM)}, { "INVOKER", SYM(INVOKER_SYM)}, { "JOIN", SYM(JOIN_SYM)}, + { "JSON", SYM(JSON_SYM)}, { "KEY", SYM(KEY_SYM)}, { "KEYS", SYM(KEYS)}, { "KEY_BLOCK_SIZE", SYM(KEY_BLOCK_SIZE)}, diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index e17a514a391ac..f2aea2bee6e50 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1324,6 +1324,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token ISSUER_SYM %token ITERATE_SYM %token JOIN_SYM /* SQL-2003-R */ +%token JSON_SYM %token KEYS %token KEY_BLOCK_SIZE %token KEY_SYM /* SQL-2003-N */ @@ -10709,6 +10710,7 @@ cast_type: } | cast_type_numeric { $$= $1; Lex->charset= NULL; } | cast_type_temporal { $$= $1; Lex->charset= NULL; } + | JSON_SYM { $$.set(ITEM_CAST_JSON); } ; cast_type_numeric: @@ -13226,11 +13228,10 @@ opt_extended_describe: opt_format_json: /* empty */ {} + | FORMAT_SYM '=' JSON_SYM { Lex->explain_json= true; } | FORMAT_SYM '=' ident_or_text { - if (!my_strcasecmp(system_charset_info, $3.str, "JSON")) - Lex->explain_json= true; - else if (!my_strcasecmp(system_charset_info, $3.str, "TRADITIONAL")) + if (!my_strcasecmp(system_charset_info, $3.str, "TRADITIONAL")) DBUG_ASSERT(Lex->explain_json==false); else my_yyabort_error((ER_UNKNOWN_EXPLAIN_FORMAT, MYF(0), $3.str)); diff --git a/storage/connect/mysql-test/connect/disabled.def b/storage/connect/mysql-test/connect/disabled.def index a97ba67d73ee1..64d7ece3fe144 100644 --- a/storage/connect/mysql-test/connect/disabled.def +++ b/storage/connect/mysql-test/connect/disabled.def @@ -13,5 +13,6 @@ jdbc : Variable settings depend on machine configuration jdbc_new : Variable settings depend on machine configuration jdbc_oracle : Variable settings depend on machine configuration jdbc_postgresql : Variable settings depend on machine configuration +json : TABLE_TYPE = JSON conflicts with the SQL syntax json_udf : conflicts with the server JSON functions json_udf_bin : conflicts with the server JSON functions diff --git a/strings/json_lib.c b/strings/json_lib.c index 3f55280e3fa78..662207c389962 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -1174,7 +1174,7 @@ static int handle_match(json_engine_t *je, json_path_t *p, Check if the name of the current JSON key matches the step of the path. */ -static int json_key_matches(json_engine_t *je, json_string_t *k) +int json_key_matches(json_engine_t *je, json_string_t *k) { while (json_read_keyname_chr(je) == 0) { @@ -1409,6 +1409,8 @@ int json_unescape(CHARSET_INFO *json_cs, CHARSET_INFO *res_cs, uchar *res, uchar *res_end) { json_string_t s; + const uchar *res_b= res; + json_string_setup(&s, json_cs, json_str, json_end); while (json_read_string_const_chr(&s) == 0) { @@ -1434,7 +1436,7 @@ int json_unescape(CHARSET_INFO *json_cs, return -1; } - return s.error ? 1 : 0; + return s.error==JE_EOS ? res - res_b : -1; } From 68e7d92c4c2fce7d089a82012132965aa46e3ecb Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Mon, 14 Nov 2016 23:23:36 -0800 Subject: [PATCH 67/71] Fixed bug mdev-11072. In a general case the conditions with outer fields cannot be pushed into materialized views / derived tables. However if the outer field in the condition refers to a single row table then the condition may be pushable. In this case a special care should be taken for outer fields when pushing the condition into a materialized view / derived table. --- mysql-test/r/derived_cond_pushdown.result | 84 +++++++++++++++++++++++ mysql-test/t/derived_cond_pushdown.test | 37 ++++++++++ sql/item.h | 7 +- sql/sql_derived.cc | 6 +- 4 files changed, 131 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/derived_cond_pushdown.result b/mysql-test/r/derived_cond_pushdown.result index 3922a7d0360c5..d2a51ec5536ce 100644 --- a/mysql-test/r/derived_cond_pushdown.result +++ b/mysql-test/r/derived_cond_pushdown.result @@ -7083,3 +7083,87 @@ a 3 6 drop table t1; +# +# MDEV-11072: pushdown of the condition obtained +# after constant row substitution +# +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT); +CREATE OR REPLACE VIEW v2 AS SELECT * FROM t2; +CREATE TABLE t3 (c INT); +CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v3 AS SELECT * FROM t3; +SELECT * FROM t1 WHERE a IN ( +SELECT b FROM v2 WHERE b < a OR b IN ( +SELECT c FROM v3 WHERE c = a +) +); +a +INSERT INTO t1 VALUES (2); +INSERT INTO t2 VALUES (3), (2); +INSERT INTO t3 VALUES (4), (1), (2), (7); +SELECT * FROM t1 WHERE a IN ( +SELECT b FROM v2 WHERE b < a OR b IN ( +SELECT c FROM v3 WHERE c = a +) +); +a +2 +EXPLAIN FORMAT=JSON +SELECT * FROM t1 WHERE a IN ( +SELECT b FROM v2 WHERE b < a OR b IN ( +SELECT c FROM v3 WHERE c = a +) +); +EXPLAIN +{ + "query_block": { + "select_id": 1, + "const_condition": "(0 or (2,(subquery#3)))", + "table": { + "table_name": "t1", + "access_type": "system", + "rows": 1, + "filtered": 100 + }, + "table": { + "table_name": "t2", + "access_type": "ALL", + "rows": 2, + "filtered": 100, + "attached_condition": "(t2.b = 2)", + "first_match": "t1" + }, + "subqueries": [ + { + "query_block": { + "select_id": 3, + "table": { + "table_name": "", + "access_type": "index_subquery", + "possible_keys": ["key0"], + "key": "key0", + "key_length": "5", + "used_key_parts": ["c"], + "ref": ["func"], + "rows": 2, + "filtered": 100, + "materialized": { + "query_block": { + "select_id": 5, + "table": { + "table_name": "t3", + "access_type": "ALL", + "rows": 4, + "filtered": 100, + "attached_condition": "(t3.c = 2)" + } + } + } + } + } + } + ] + } +} +DROP VIEW v2,v3; +DROP TABLE t1,t2,t3; diff --git a/mysql-test/t/derived_cond_pushdown.test b/mysql-test/t/derived_cond_pushdown.test index 9aef1d768be8b..01d8501016a27 100644 --- a/mysql-test/t/derived_cond_pushdown.test +++ b/mysql-test/t/derived_cond_pushdown.test @@ -951,3 +951,40 @@ select * from order by a limit 5) t where t.a not in (2,9); drop table t1; + +--echo # +--echo # MDEV-11072: pushdown of the condition obtained +--echo # after constant row substitution +--echo # + +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (b INT); +CREATE OR REPLACE VIEW v2 AS SELECT * FROM t2; +CREATE TABLE t3 (c INT); +CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v3 AS SELECT * FROM t3; + +SELECT * FROM t1 WHERE a IN ( + SELECT b FROM v2 WHERE b < a OR b IN ( + SELECT c FROM v3 WHERE c = a + ) +); + +INSERT INTO t1 VALUES (2); +INSERT INTO t2 VALUES (3), (2); +INSERT INTO t3 VALUES (4), (1), (2), (7); + +SELECT * FROM t1 WHERE a IN ( + SELECT b FROM v2 WHERE b < a OR b IN ( + SELECT c FROM v3 WHERE c = a + ) +); + +EXPLAIN FORMAT=JSON +SELECT * FROM t1 WHERE a IN ( + SELECT b FROM v2 WHERE b < a OR b IN ( + SELECT c FROM v3 WHERE c = a + ) +); + +DROP VIEW v2,v3; +DROP TABLE t1,t2,t3; diff --git a/sql/item.h b/sql/item.h index 20f3be17cce0d..0242cb72ff819 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1559,7 +1559,9 @@ class Item: public Value_source, virtual bool exclusive_dependence_on_table_processor(void *map) { return 0; } virtual bool exclusive_dependence_on_grouping_fields_processor(void *arg) - { return 0; } + { return 0; } + virtual bool cleanup_excluding_outer_fields_processor(void *arg) + { return cleanup_processor(arg); } virtual Item *get_copy(THD *thd, MEM_ROOT *mem_root)=0; @@ -2662,6 +2664,9 @@ class Item_field :public Item_ident virtual void print(String *str, enum_query_type query_type); bool exclusive_dependence_on_table_processor(void *map); bool exclusive_dependence_on_grouping_fields_processor(void *arg); + bool cleanup_excluding_outer_fields_processor(void *arg) + { return depended_from ? 0 :cleanup_processor(arg); } + Item *get_copy(THD *thd, MEM_ROOT *mem_root) { return get_item_copy(thd, mem_root, this); } bool is_outer_field() const diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 0b67b9520566e..9732c82646b7e 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -1195,7 +1195,8 @@ bool pushdown_cond_for_derived(THD *thd, Item *cond, TABLE_LIST *derived) (uchar*) sl); if (extracted_cond_copy) { - extracted_cond_copy->walk(&Item::cleanup_processor, 0, 0); + extracted_cond_copy->walk( + &Item::cleanup_excluding_outer_fields_processor, 0, 0); sl->cond_pushed_into_where= extracted_cond_copy; } @@ -1230,7 +1231,8 @@ bool pushdown_cond_for_derived(THD *thd, Item *cond, TABLE_LIST *derived) */ extracted_cond_copy= remove_pushed_top_conjuncts(thd, extracted_cond_copy); - cond_over_grouping_fields->walk(&Item::cleanup_processor, 0, 0); + cond_over_grouping_fields->walk( + &Item::cleanup_excluding_outer_fields_processor, 0, 0); sl->cond_pushed_into_where= cond_over_grouping_fields; if (!extracted_cond_copy) From 0b869814dc98a961e21f4e0d2a581f52b80543a6 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Tue, 15 Nov 2016 09:24:39 -0800 Subject: [PATCH 68/71] Made the result output deterministic. --- mysql-test/r/cte_recursive.result | 2 +- mysql-test/t/cte_recursive.test | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/cte_recursive.result b/mysql-test/r/cte_recursive.result index 4a3ca4d1caafe..4504de383589f 100644 --- a/mysql-test/r/cte_recursive.result +++ b/mysql-test/r/cte_recursive.result @@ -1911,8 +1911,8 @@ a b distance path_string 2 6 4 2.1.3.5.6. 2 7 2 2.4.7. 2 7 4 2.1.3.4.7. -3 1 2 3.6.1. 3 1 2 3.5.1. +3 1 2 3.6.1. 3 1 3 3.5.6.1. 3 4 1 3.4. 3 5 1 3.5. diff --git a/mysql-test/t/cte_recursive.test b/mysql-test/t/cte_recursive.test index 8cc907957e63e..63bcfbffeb94e 100644 --- a/mysql-test/t/cte_recursive.test +++ b/mysql-test/t/cte_recursive.test @@ -1409,6 +1409,7 @@ DROP TABLE IF EXISTS edges2; CREATE VIEW edges2 (a, b) AS SELECT a, b FROM edges UNION ALL SELECT b, a FROM edges; +--sorted_result WITH RECURSIVE transitive_closure(a, b, distance, path_string) AS ( SELECT a, b, 1 AS distance, concat(a, '.', b, '.') AS path_string From 0d85124da4f7084de724ae8267c66a6ffd0f2b98 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Wed, 16 Nov 2016 12:47:46 +0400 Subject: [PATCH 69/71] func_json.test failing on Windows fixed. --- sql/item_jsonfunc.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 4fa2f02bedc88..e0ff7b4507a4c 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -922,8 +922,8 @@ void Item_func_json_array_append::fix_length_and_dec() for (n_arg= 1; n_arg < arg_count; n_arg+= 2) { - paths[n_arg-1].set_constant_flag(args[n_arg]->const_item()); - char_length+= args[n_arg+1]->max_char_length() + 4; + paths[n_arg/2].set_constant_flag(args[n_arg]->const_item()); + char_length+= args[n_arg/2+1]->max_char_length() + 4; } fix_char_length_ulonglong(char_length); @@ -1323,8 +1323,8 @@ void Item_func_json_insert::fix_length_and_dec() for (n_arg= 1; n_arg < arg_count; n_arg+= 2) { - paths[n_arg-1].set_constant_flag(args[n_arg]->const_item()); - char_length+= args[n_arg+1]->max_char_length() + 4; + paths[n_arg/2].set_constant_flag(args[n_arg]->const_item()); + char_length+= args[n_arg/2+1]->max_char_length() + 4; } fix_char_length_ulonglong(char_length); From 0838fd00e7c95d54541c2126ef933d0ae65c02f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 16 Nov 2016 12:07:12 +0200 Subject: [PATCH 70/71] MDEV-11185: innodb.innodb_trx_weight fails in buildbot Problem was that test assumes locks to be granted on first-come-first-served (FCFS) policy. However, in 10.2 we use by default Variance-Aware-Transaction-Scheduling (VATS) algorithm. Test failure fixed by setting lock wait policy to FCFS. --- mysql-test/suite/innodb/disabled.def | 2 +- mysql-test/suite/innodb/t/innodb_trx_weight.opt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/innodb/t/innodb_trx_weight.opt diff --git a/mysql-test/suite/innodb/disabled.def b/mysql-test/suite/innodb/disabled.def index 09545bafefcd9..9f8de75ae14ce 100644 --- a/mysql-test/suite/innodb/disabled.def +++ b/mysql-test/suite/innodb/disabled.def @@ -11,4 +11,4 @@ ############################################################################## innodb_defragment_fill_factor : MDEV-10771 -innodb.innodb_trx_weight : MDEV-11185 + diff --git a/mysql-test/suite/innodb/t/innodb_trx_weight.opt b/mysql-test/suite/innodb/t/innodb_trx_weight.opt new file mode 100644 index 0000000000000..bac39c99a74fd --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_trx_weight.opt @@ -0,0 +1 @@ +--loose-innodb-lock-schedule-algorithm=FCFS From ded4cd12c308eccb2fbe2e24953f81131649e477 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Wed, 16 Nov 2016 20:25:55 +0400 Subject: [PATCH 71/71] Added missing INNODB_COMPRESSION_DEFAULT --- mysql-test/suite/sys_vars/r/sysvars_innodb.result | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index 8e364e6fd5004..d87d52c850a58 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -537,6 +537,20 @@ NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST none,zlib,lz4,lzo,lzma,bzip2,snappy READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL +VARIABLE_NAME INNODB_COMPRESSION_DEFAULT +SESSION_VALUE OFF +GLOBAL_VALUE OFF +GLOBAL_VALUE_ORIGIN COMPILE-TIME +DEFAULT_VALUE OFF +VARIABLE_SCOPE SESSION +VARIABLE_TYPE BOOLEAN +VARIABLE_COMMENT Is compression the default for new tables +NUMERIC_MIN_VALUE NULL +NUMERIC_MAX_VALUE NULL +NUMERIC_BLOCK_SIZE NULL +ENUM_VALUE_LIST OFF,ON +READ_ONLY NO +COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME INNODB_COMPRESSION_FAILURE_THRESHOLD_PCT SESSION_VALUE NULL GLOBAL_VALUE 5