Commit e20693c1 authored by Monty's avatar Monty

Fixed some wrong printf() usage after changing m_table_id to ulonglong

This caused some crashes on 32 bit platforms.
parent daca0c05
...@@ -1502,8 +1502,9 @@ bool Rows_log_event::print_verbose(IO_CACHE *file, ...@@ -1502,8 +1502,9 @@ bool Rows_log_event::print_verbose(IO_CACHE *file,
if (!(map= print_event_info->m_table_map.get_table(m_table_id)) || if (!(map= print_event_info->m_table_map.get_table(m_table_id)) ||
!(td= map->create_table_def())) !(td= map->create_table_def()))
{ {
return (my_b_printf(file, "### Row event for unknown table #%llu", char llbuff[22];
(ulonglong) m_table_id)); return (my_b_printf(file, "### Row event for unknown table #%s",
ullstr(m_table_id, llbuff)));
} }
/* If the write rows event contained no values for the AI */ /* If the write rows event contained no values for the AI */
......
...@@ -1251,7 +1251,7 @@ Old_rows_log_event::Old_rows_log_event(const uchar *buf, uint event_len, ...@@ -1251,7 +1251,7 @@ Old_rows_log_event::Old_rows_log_event(const uchar *buf, uint event_len,
const uchar* const ptr_rows_data= (const uchar*) ptr_after_width; const uchar* const ptr_rows_data= (const uchar*) ptr_after_width;
size_t const data_size= event_len - (ptr_rows_data - (const uchar *) buf); size_t const data_size= event_len - (ptr_rows_data - (const uchar *) buf);
DBUG_PRINT("info",("m_table_id: %lu m_flags: %d m_width: %lu data_size: %zu", DBUG_PRINT("info",("m_table_id: %llu m_flags: %d m_width: %lu data_size: %zu",
m_table_id, m_flags, m_width, data_size)); m_table_id, m_flags, m_width, data_size));
DBUG_DUMP("rows_data", (uchar*) ptr_rows_data, data_size); DBUG_DUMP("rows_data", (uchar*) ptr_rows_data, data_size);
...@@ -1790,7 +1790,7 @@ bool Old_rows_log_event::write_data_header() ...@@ -1790,7 +1790,7 @@ bool Old_rows_log_event::write_data_header()
DBUG_ASSERT(m_table_id != UINT32_MAX); DBUG_ASSERT(m_table_id != UINT32_MAX);
DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master", DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master",
{ {
int4store(buf + 0, m_table_id); int4store(buf + 0, (ulong) m_table_id);
int2store(buf + 4, m_flags); int2store(buf + 4, m_flags);
return write_data(buf, 6); return write_data(buf, 6);
}); });
...@@ -1837,7 +1837,7 @@ void Old_rows_log_event::pack_info(Protocol *protocol) ...@@ -1837,7 +1837,7 @@ void Old_rows_log_event::pack_info(Protocol *protocol)
char const *const flagstr= char const *const flagstr=
get_flags(STMT_END_F) ? " flags: STMT_END_F" : ""; get_flags(STMT_END_F) ? " flags: STMT_END_F" : "";
size_t bytes= my_snprintf(buf, sizeof(buf), size_t bytes= my_snprintf(buf, sizeof(buf),
"table_id: %lu%s", m_table_id, flagstr); "table_id: %llu%s", m_table_id, flagstr);
protocol->store(buf, bytes, &my_charset_bin); protocol->store(buf, bytes, &my_charset_bin);
} }
#endif #endif
...@@ -1859,9 +1859,10 @@ bool Old_rows_log_event::print_helper(FILE *file, ...@@ -1859,9 +1859,10 @@ bool Old_rows_log_event::print_helper(FILE *file,
if (!print_event_info->short_form) if (!print_event_info->short_form)
{ {
char llbuff[22];
if (print_header(head, print_event_info, !do_print_encoded) || if (print_header(head, print_event_info, !do_print_encoded) ||
my_b_printf(head, "\t%s: table id %lu%s\n", my_b_printf(head, "\t%s: table id %s%s\n",
name, m_table_id, name, ullstr(m_table_id, llbuff),
do_print_encoded ? " flags: STMT_END_F" : "") || do_print_encoded ? " flags: STMT_END_F" : "") ||
print_base64(body, print_event_info, do_print_encoded)) print_base64(body, print_event_info, do_print_encoded))
goto err; goto err;
......
...@@ -6074,7 +6074,7 @@ bool Rows_log_event::write_data_header() ...@@ -6074,7 +6074,7 @@ bool Rows_log_event::write_data_header()
DBUG_ASSERT(m_table_id != UINT32_MAX); DBUG_ASSERT(m_table_id != UINT32_MAX);
DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master", DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master",
{ {
int4store(buf + 0, m_table_id); int4store(buf + 0, (ulong) m_table_id);
int2store(buf + 4, m_flags); int2store(buf + 4, m_flags);
return (write_data(buf, 6)); return (write_data(buf, 6));
}); });
...@@ -6588,7 +6588,7 @@ int Table_map_log_event::do_apply_event(rpl_group_info *rgi) ...@@ -6588,7 +6588,7 @@ int Table_map_log_event::do_apply_event(rpl_group_info *rgi)
char buf[256]; char buf[256];
my_snprintf(buf, sizeof(buf), my_snprintf(buf, sizeof(buf),
"Found table map event mapping table id %u which " "Found table map event mapping table id %llu which "
"was already mapped but with different settings.", "was already mapped but with different settings.",
table_list->table_id); table_list->table_id);
...@@ -6633,7 +6633,7 @@ bool Table_map_log_event::write_data_header() ...@@ -6633,7 +6633,7 @@ bool Table_map_log_event::write_data_header()
uchar buf[TABLE_MAP_HEADER_LEN]; uchar buf[TABLE_MAP_HEADER_LEN];
DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master", DBUG_EXECUTE_IF("old_row_based_repl_4_byte_map_id_master",
{ {
int4store(buf + 0, m_table_id); int4store(buf + 0, (ulong) m_table_id);
int2store(buf + 4, m_flags); int2store(buf + 4, m_flags);
return (write_data(buf, 6)); return (write_data(buf, 6));
}); });
...@@ -7069,7 +7069,7 @@ void Table_map_log_event::pack_info(Protocol *protocol) ...@@ -7069,7 +7069,7 @@ void Table_map_log_event::pack_info(Protocol *protocol)
{ {
char buf[256]; char buf[256];
size_t bytes= my_snprintf(buf, sizeof(buf), size_t bytes= my_snprintf(buf, sizeof(buf),
"table_id: %llu (%s.%s)", "table_id: %llu (%s.%s)",
m_table_id, m_dbnam, m_tblnam); m_table_id, m_dbnam, m_tblnam);
protocol->store(buf, bytes, &my_charset_bin); protocol->store(buf, bytes, &my_charset_bin);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment