diff options
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 19bb3a51671..9299932ac4b 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -838,19 +838,19 @@ query_event_uncompress(const Format_description_log_event *description_event, if (end <= tmp) return 1; - int32 comp_len = len - (tmp - src) - - (contain_checksum ? BINLOG_CHECKSUM_LEN : 0); + int32 comp_len = (int32)(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; + *newlen = (ulong)(tmp - src) + un_len; if(contain_checksum) *newlen += BINLOG_CHECKSUM_LEN; - uint32 alloc_size = ALIGN_SIZE(*newlen); + uint32 alloc_size = (uint32)ALIGN_SIZE(*newlen); char *new_dst = NULL; @@ -963,17 +963,17 @@ row_log_event_uncompress(const Format_description_log_event *description_event, if (un_len == 0) return 1; - long comp_len = len - (tmp - src) - - (contain_checksum ? BINLOG_CHECKSUM_LEN : 0); + int32 comp_len = (int32)(len - (tmp - src) - + (contain_checksum ? BINLOG_CHECKSUM_LEN : 0)); //bad event if (comp_len <=0) return 1; - *newlen = (tmp - src) + un_len; + *newlen = ulong(tmp - src) + un_len; if(contain_checksum) *newlen += BINLOG_CHECKSUM_LEN; - uint32 alloc_size = ALIGN_SIZE(*newlen); + size_t alloc_size = ALIGN_SIZE(*newlen); *is_malloc = false; if (alloc_size <= buf_size) @@ -1626,7 +1626,7 @@ int Log_event_writer::write_header(uchar *pos, size_t len) if (ctx) { uchar iv[BINLOG_IV_LENGTH]; - crypto->set_iv(iv, my_b_safe_tell(file)); + crypto->set_iv(iv, (uint32)my_b_safe_tell(file)); if (encryption_ctx_init(ctx, crypto->key, crypto->key_length, iv, sizeof(iv), ENCRYPTION_FLAG_ENCRYPT | ENCRYPTION_FLAG_NOPAD, ENCRYPTION_KEY_SYSTEM_DATA, crypto->key_version)) @@ -3968,7 +3968,7 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, db(thd_arg->db), q_len((uint32) query_length), thread_id(thd_arg->thread_id), /* save the original thread id; we already know the server id */ - slave_proxy_id(thd_arg->variables.pseudo_thread_id), + slave_proxy_id((ulong)thd_arg->variables.pseudo_thread_id), flags2_inited(1), sql_mode_inited(1), charset_inited(1), sql_mode(thd_arg->variables.sql_mode), auto_increment_increment(thd_arg->variables.auto_increment_increment), @@ -4170,7 +4170,7 @@ get_str_len_and_pointer(const Log_event::Byte **src, if (length > 0) { if (*src + length >= end) - return *src + length - end + 1; // Number of bytes missing + return (int)(*src + length - end + 1); // Number of bytes missing *dst= (char *)*src + 1; // Will be copied later } *len= length; @@ -4271,7 +4271,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len, data_len = event_len - (common_header_len + post_header_len); buf+= common_header_len; - slave_proxy_id= thread_id = uint4korr(buf + Q_THREAD_ID_OFFSET); + thread_id = slave_proxy_id = uint4korr(buf + Q_THREAD_ID_OFFSET); exec_time = uint4korr(buf + Q_EXEC_TIME_OFFSET); db_len = (uchar)buf[Q_DB_LEN_OFFSET]; // TODO: add a check of all *_len vars error_code = uint2korr(buf + Q_ERR_CODE_OFFSET); @@ -6487,7 +6487,7 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex, thd_arg->thread_specific_used ? LOG_EVENT_THREAD_SPECIFIC_F : 0, using_trans), thread_id(thd_arg->thread_id), - slave_proxy_id(thd_arg->variables.pseudo_thread_id), + slave_proxy_id((ulong)thd_arg->variables.pseudo_thread_id), num_fields(0),fields(0), field_lens(0),field_block_len(0), table_name(table_name_arg ? table_name_arg : ""), @@ -6611,7 +6611,7 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len, char* buf_end = (char*)buf + event_len; /* this is the beginning of the post-header */ const char* data_head = buf + description_event->common_header_len; - slave_proxy_id= thread_id= uint4korr(data_head + L_THREAD_ID_OFFSET); + thread_id= slave_proxy_id= uint4korr(data_head + L_THREAD_ID_OFFSET); exec_time = uint4korr(data_head + L_EXEC_TIME_OFFSET); skip_lines = uint4korr(data_head + L_SKIP_LINES_OFFSET); table_name_len = (uint)data_head[L_TBL_LEN_OFFSET]; @@ -8673,7 +8673,7 @@ User_var_log_event(const char* buf, uint event_len, Old events will not have this extra byte, thence, we keep the flags set to UNDEF_F. */ - uint bytes_read= ((val + val_len) - buf_start); + size_t bytes_read= ((val + val_len) - buf_start); #ifndef DBUG_OFF bool old_pre_checksum_fd= description_event->is_version_before_checksum( &description_event->server_version_split); @@ -10382,7 +10382,7 @@ void Rows_log_event::uncompress_buf() if (new_buf) { if(!binlog_buf_uncompress((char *)m_rows_buf, (char *)new_buf, - m_rows_cur - m_rows_buf, &un_len)) + (uint32)(m_rows_cur - m_rows_buf), &un_len)) { my_free(m_rows_buf); m_rows_buf = new_buf; @@ -10418,9 +10418,9 @@ int Rows_log_event::get_data_size() uchar *end= net_store_length(buf, m_width); DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master", - return 6 + no_bytes_in_map(&m_cols) + (end - buf) + + return (int)(6 + no_bytes_in_map(&m_cols) + (end - buf) + (general_type_code == UPDATE_ROWS_EVENT ? no_bytes_in_map(&m_cols_ai) : 0) + - (m_rows_cur - m_rows_buf);); + m_rows_cur - m_rows_buf);); int data_size= 0; Log_event_type type = get_type_code(); |