Commit 889f346e authored by unknown's avatar unknown

Changes to avoid compilation errors in MS Visual Studio 7.1

 (reviewed by Mats)


sql/log_event.cc:
  Changes to avoid compilation errors in MS Visual Studio 7.1
sql/sql_class.cc:
  Changes to avoid compilation errors in MS Visual Studio 7.1
parent 010cff1f
......@@ -5109,7 +5109,7 @@ Rows_log_event::Rows_log_event(const char *buf, uint event_len,
const uint byte_count= (m_width + 7) / 8;
const byte* const ptr_rows_data= var_start + byte_count + 1;
my_size_t const data_size= event_len - (ptr_rows_data - buf);
my_size_t const data_size= event_len - (ptr_rows_data - (const byte *) buf);
DBUG_PRINT("info",("m_table_id=%lu, m_flags=%d, m_width=%u, data_size=%lu",
m_table_id, m_flags, m_width, data_size));
......@@ -6017,7 +6017,7 @@ bool Table_map_log_event::write_data_body(IO_CACHE *file)
DBUG_ASSERT(static_cast<my_size_t>(cbuf_end - cbuf) <= sizeof(cbuf));
return (my_b_safe_write(file, dbuf, sizeof(dbuf)) ||
my_b_safe_write(file, m_dbnam, m_dblen+1) ||
my_b_safe_write(file, (const byte*)m_dbnam, m_dblen+1) ||
my_b_safe_write(file, tbuf, sizeof(tbuf)) ||
my_b_safe_write(file, (const byte*)m_tblnam, m_tbllen+1) ||
my_b_safe_write(file, cbuf, cbuf_end - cbuf) ||
......@@ -6035,7 +6035,7 @@ bool Table_map_log_event::write_data_body(IO_CACHE *file)
void Table_map_log_event::pack_info(Protocol *protocol)
{
char buf[256];
my_size_t bytes= snprintf(buf, sizeof(buf), "%s.%s", m_dbnam, m_tblnam);
my_size_t bytes= my_snprintf(buf, sizeof(buf), "%s.%s", m_dbnam, m_tblnam);
protocol->store(buf, bytes, &my_charset_bin);
}
......@@ -6149,7 +6149,7 @@ char const *Write_rows_log_event::do_prepare_row(THD *thd, TABLE *table,
*/
DBUG_ASSERT(table->s->fields >= m_width);
DBUG_ASSERT(ptr);
ptr= unpack_row(table, (char*)table->record[0], ptr, &m_cols);
ptr= unpack_row(table, table->record[0], ptr, &m_cols);
return ptr;
}
......
......@@ -2325,7 +2325,7 @@ my_size_t THD::max_row_length_blob(TABLE *table, const byte *data) const
for (uint *ptr= beg ; ptr != end ; ++ptr)
{
Field_blob* const blob= (Field_blob*) table->field[*ptr];
length+= blob->get_length(data + blob->offset()) + 2;
length+= blob->get_length((const char *) (data + blob->offset())) + 2;
}
return length;
......@@ -2344,7 +2344,7 @@ my_size_t THD::pack_row(TABLE *table, MY_BITMAP const* cols, byte *row_data,
for (int i= 0 ; field ; i++, p_field++, field= *p_field)
{
if (bitmap_is_set(cols,i))
ptr= (byte*)field->pack(ptr, field->ptr + offset);
ptr= (byte*)field->pack((char *) ptr, field->ptr + offset);
}
/*
......@@ -2377,12 +2377,12 @@ int THD::binlog_write_row(TABLE* table, bool is_trans,
if (!table->s->blob_fields)
{
/* multiply max_len by 2 so it can be used for update_row as well */
table->write_row_record= alloc_root(&table->mem_root, 2*max_len);
table->write_row_record= (byte *) alloc_root(&table->mem_root, 2*max_len);
if (!table->write_row_record)
return HA_ERR_OUT_OF_MEM;
row_data= table->write_row_record;
}
else if (unlikely(!(row_data= my_malloc(max_len, MYF(MY_WME)))))
else if (unlikely(!(row_data= (byte *) my_malloc(max_len, MYF(MY_WME)))))
return HA_ERR_OUT_OF_MEM;
}
my_size_t const len= pack_row(table, cols, row_data, record);
......@@ -2396,7 +2396,7 @@ int THD::binlog_write_row(TABLE* table, bool is_trans,
error= likely(ev != 0) ? ev->add_row_data(row_data,len) : HA_ERR_OUT_OF_MEM ;
if (table->write_row_record == 0)
my_free(row_data, MYF(MY_WME));
my_free((gptr) row_data, MYF(MY_WME));
return error;
}
......
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