Below is the list of changes that have just been committed into a local
5.1 repository of mats. When mats does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-10-21 20:30:54+02:00, mats@romeo.(none) +11 -0
Using unsigned char to refer to byte instead of char in binary log
interface (i.e., for the binary log events).
client/mysqlbinlog.cc@stripped, 2006-10-21 20:30:47+02:00, mats@romeo.(none) +2 -2
Refer to uninterpreted sequence of bytes using unsigned char* instead
of char*. Added missing cast of return value from my_malloc().
dbug/dbug.c@stripped, 2006-10-21 20:30:47+02:00, mats@romeo.(none) +1 -1
Using void* to refer to arbitrary memory instead of char*.
include/my_dbug.h@stripped, 2006-10-21 20:30:47+02:00, mats@romeo.(none) +2 -2
Using void* to refer to arbitrary memory instead of char*.
sql/log.cc@stripped, 2006-10-21 20:30:48+02:00, mats@romeo.(none) +2 -2
Refer to uninterpreted sequence of bytes using unsigned char* instead
of char*.
sql/log.h@stripped, 2006-10-21 20:30:48+02:00, mats@romeo.(none) +1 -1
Refer to uninterpreted sequence of bytes using unsigned char* instead
of char*.
sql/log_event.cc@stripped, 2006-10-21 20:30:48+02:00, mats@romeo.(none) +39 -38
Refer to uninterpreted sequence of bytes using unsigned char* instead
of char*.
sql/log_event.h@stripped, 2006-10-21 20:30:48+02:00, mats@romeo.(none) +33 -31
Refer to uninterpreted sequence of bytes using unsigned char* instead
of char*.
sql/slave.cc@stripped, 2006-10-21 20:30:48+02:00, mats@romeo.(none) +11 -10
Refer to uninterpreted sequence of bytes using unsigned char* instead
of char*.
sql/slave.h@stripped, 2006-10-21 20:30:49+02:00, mats@romeo.(none) +1 -1
Refer to uninterpreted sequence of bytes using unsigned char* instead
of char*.
sql/sql_binlog.cc@stripped, 2006-10-21 20:30:49+02:00, mats@romeo.(none) +3 -3
Refer to uninterpreted sequence of bytes using unsigned char* instead
of char*.
strings/my_strchr.c@stripped, 2006-10-21 20:30:49+02:00, mats@romeo.(none) +1 -1
Correcting return type of my_strchr().
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: mats
# Host: romeo.(none)
# Root: /home/bk/fix-mysql-5.1-new-rpl
--- 1.32/dbug/dbug.c 2006-10-21 20:31:03 +02:00
+++ 1.33/dbug/dbug.c 2006-10-21 20:31:03 +02:00
@@ -1158,7 +1158,7 @@
* Is used to examine corrputed memory or arrays.
*/
-void _db_dump_(uint _line_, const char *keyword, const char *memory, uint length)
+void _db_dump_(uint _line_, const char *keyword, const void *memory, uint length)
{
int pos;
char dbuff[90];
--- 1.22/include/my_dbug.h 2006-10-21 20:31:03 +02:00
+++ 1.23/include/my_dbug.h 2006-10-21 20:31:03 +02:00
@@ -40,8 +40,8 @@
uint *_slevel_);
extern void _db_pargs_(uint _line_,const char *keyword);
extern void _db_doprnt_ _VARARGS((const char *format,...));
-extern void _db_dump_(uint _line_,const char *keyword,const char *memory,
- uint length);
+extern void _db_dump_(uint _line_, const char *keyword,
+ const void *memory, uint length);
extern void _db_end_(void);
extern void _db_lock_file_(void);
extern void _db_unlock_file_(void);
--- 1.238/sql/log.cc 2006-10-21 20:31:03 +02:00
+++ 1.239/sql/log.cc 2006-10-21 20:31:03 +02:00
@@ -3201,7 +3201,7 @@
}
-bool MYSQL_BIN_LOG::appendv(const char* buf, uint len,...)
+bool MYSQL_BIN_LOG::appendv(const uchar* buf, uint len,...)
{
bool error= 0;
DBUG_ENTER("MYSQL_BIN_LOG::appendv");
@@ -3219,7 +3219,7 @@
goto err;
}
bytes_written += len;
- } while ((buf=va_arg(args,const char*)) && (len=va_arg(args,uint)));
+ } while ((buf=va_arg(args,const uchar*)) && (len=va_arg(args,uint)));
DBUG_PRINT("info",("max_size: %lu",max_size));
if ((uint) my_b_append_tell(&log_file) > max_size)
new_file_without_locking();
--- 1.246/sql/log_event.cc 2006-10-21 20:31:03 +02:00
+++ 1.247/sql/log_event.cc 2006-10-21 20:31:03 +02:00
@@ -461,7 +461,7 @@
Log_event::Log_event()
*/
-Log_event::Log_event(const char* buf,
+Log_event::Log_event(const uchar* buf,
const Format_description_log_event* description_event)
:temp_buf(0), cache_stmt(0)
{
@@ -741,7 +741,7 @@
{
ulong data_len;
int result=0;
- char buf[LOG_EVENT_MINIMAL_HEADER_LEN];
+ uchar buf[LOG_EVENT_MINIMAL_HEADER_LEN];
DBUG_ENTER("read_log_event");
if (log_lock)
@@ -769,7 +769,7 @@
LOG_READ_TOO_LARGE);
goto end;
}
- packet->append(buf, sizeof(buf));
+ packet->append((char*) buf, sizeof(buf));
data_len-= LOG_EVENT_MINIMAL_HEADER_LEN;
if (data_len)
{
@@ -845,7 +845,7 @@
DBUG_RETURN(0);
}
uint data_len = uint4korr(head + EVENT_LEN_OFFSET);
- char *buf= 0;
+ uchar *buf= 0;
const char *error= 0;
Log_event *res= 0;
#ifndef max_allowed_packet
@@ -866,7 +866,7 @@
}
// some events use the extra byte to null-terminate strings
- if (!(buf = my_malloc(data_len+1, MYF(MY_WME))))
+ if (!(buf = (uchar*) my_malloc(data_len+1, MYF(MY_WME))))
{
error = "Out of memory";
goto err;
@@ -889,7 +889,7 @@
sql_print_error("Error in Log_event::read_log_event(): "
"'%s', data_len: %d, event_type: %d",
error,data_len,head[EVENT_TYPE_OFFSET]);
- my_free(buf, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((gptr) buf, MYF(MY_ALLOW_ZERO_PTR));
/*
The SQL slave thread will check if file->error<0 to know
if there was an I/O error. Even if there is no "low-level" I/O errors
@@ -910,7 +910,7 @@
constructors.
*/
-Log_event* Log_event::read_log_event(const char* buf, uint event_len,
+Log_event* Log_event::read_log_event(const uchar* buf, uint event_len,
const char **error,
const Format_description_log_event *description_event)
{
@@ -1512,7 +1512,7 @@
This is used by the SQL slave thread to prepare the event before execution.
*/
-Query_log_event::Query_log_event(const char* buf, uint event_len,
+Query_log_event::Query_log_event(const uchar* buf, uint event_len,
const Format_description_log_event *description_event,
Log_event_type event_type)
:Log_event(buf, description_event), data_buf(0), query(NullS),
@@ -2185,7 +2185,7 @@
Start_log_event_v3::Start_log_event_v3()
*/
-Start_log_event_v3::Start_log_event_v3(const char* buf,
+Start_log_event_v3::Start_log_event_v3(const uchar* buf,
const Format_description_log_event* description_event)
:Log_event(buf, description_event)
{
@@ -2426,7 +2426,7 @@
*/
Format_description_log_event::
-Format_description_log_event(const char* buf,
+Format_description_log_event(const uchar* buf,
uint event_len,
const
Format_description_log_event*
@@ -2819,7 +2819,7 @@
constructed event.
*/
-Load_log_event::Load_log_event(const char *buf, uint event_len,
+Load_log_event::Load_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *description_event)
:Log_event(buf, description_event), num_fields(0), fields(0),
field_lens(0),field_block_len(0),
@@ -2846,15 +2846,15 @@
Load_log_event::copy_log_event()
*/
-int Load_log_event::copy_log_event(const char *buf, ulong event_len,
+int Load_log_event::copy_log_event(const uchar *buf, ulong event_len,
int body_offset,
const Format_description_log_event *description_event)
{
DBUG_ENTER("Load_log_event::copy_log_event");
uint data_len;
- char* buf_end = (char*)buf + event_len;
+ const uchar* buf_end = buf + event_len;
/* this is the beginning of the post-header */
- const char* data_head = buf + description_event->common_header_len;
+ const uchar* data_head = buf + description_event->common_header_len;
slave_proxy_id= thread_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);
@@ -2868,8 +2868,8 @@
Sql_ex.init() on success returns the pointer to the first byte after
the sql_ex structure, which is the start of field lengths array.
*/
- if (!(field_lens= (uchar*)sql_ex.init((char*)buf + body_offset,
- buf_end,
+ if (!(field_lens= (uchar*)sql_ex.init((char*) buf + body_offset,
+ (char*) buf_end,
buf[EVENT_TYPE_OFFSET] != LOAD_EVENT)))
DBUG_RETURN(1);
@@ -3364,7 +3364,7 @@
#endif
-Rotate_log_event::Rotate_log_event(const char* buf, uint event_len,
+Rotate_log_event::Rotate_log_event(const uchar* buf, uint event_len,
const Format_description_log_event* description_event)
:Log_event(buf, description_event) ,new_log_ident(0), flags(DUP_NAME)
{
@@ -3381,7 +3381,8 @@
(header_size+post_header_len));
ident_offset = post_header_len;
set_if_smaller(ident_len,FN_REFLEN-1);
- new_log_ident= my_strndup(buf + ident_offset, (uint) ident_len, MYF(MY_WME));
+ new_log_ident= my_strndup((char*) buf + ident_offset,
+ (uint) ident_len, MYF(MY_WME));
DBUG_VOID_RETURN;
}
@@ -3494,7 +3495,7 @@
Intvar_log_event::Intvar_log_event()
*/
-Intvar_log_event::Intvar_log_event(const char* buf,
+Intvar_log_event::Intvar_log_event(const uchar* buf,
const Format_description_log_event* description_event)
:Log_event(buf, description_event)
{
@@ -3610,7 +3611,7 @@
#endif
-Rand_log_event::Rand_log_event(const char* buf,
+Rand_log_event::Rand_log_event(const uchar* buf,
const Format_description_log_event* description_event)
:Log_event(buf, description_event)
{
@@ -3686,7 +3687,7 @@
*/
Xid_log_event::
-Xid_log_event(const char* buf,
+Xid_log_event(const uchar* buf,
const Format_description_log_event *description_event)
:Log_event(buf, description_event)
{
@@ -3810,7 +3811,7 @@
User_var_log_event::
-User_var_log_event(const char* buf,
+User_var_log_event(const uchar* buf,
const Format_description_log_event* description_event)
:Log_event(buf, description_event)
{
@@ -4208,7 +4209,7 @@
/* This code is not used, so has not been updated to be format-tolerant */
-Slave_log_event::Slave_log_event(const char* buf, uint event_len)
+Slave_log_event::Slave_log_event(const uchar* buf, uint event_len)
:Log_event(buf,0) /*unused event*/ ,mem_pool(0),master_host(0)
{
if (event_len < LOG_EVENT_HEADER_LEN)
@@ -4366,7 +4367,7 @@
Create_file_log_event ctor
*/
-Create_file_log_event::Create_file_log_event(const char* buf, uint len,
+Create_file_log_event::Create_file_log_event(const uchar* buf, uint len,
const Format_description_log_event* description_event)
:Load_log_event(buf,0,description_event),fake_base(0),block(0),inited_from_old(0)
{
@@ -4375,7 +4376,7 @@
uint header_len= description_event->common_header_len;
uint8 load_header_len= description_event->post_header_len[LOAD_EVENT-1];
uint8 create_file_header_len= description_event->post_header_len[CREATE_FILE_EVENT-1];
- if (!(event_buf= my_memdup((byte*) buf, len, MYF(MY_WME))) ||
+ if (!(event_buf= (const uchar*) my_memdup((byte*) buf, len, MYF(MY_WME))) ||
copy_log_event(event_buf,len,
((buf[EVENT_TYPE_OFFSET] == LOAD_EVENT) ?
load_header_len + header_len :
@@ -4573,7 +4574,7 @@
Append_block_log_event ctor
*/
-Append_block_log_event::Append_block_log_event(const char* buf, uint len,
+Append_block_log_event::Append_block_log_event(const uchar* buf, uint len,
const Format_description_log_event* description_event)
:Log_event(buf, description_event),block(0)
{
@@ -4724,7 +4725,7 @@
Delete_file_log_event ctor
*/
-Delete_file_log_event::Delete_file_log_event(const char* buf, uint len,
+Delete_file_log_event::Delete_file_log_event(const uchar* buf, uint len,
const Format_description_log_event* description_event)
:Log_event(buf, description_event),file_id(0)
{
@@ -4820,7 +4821,7 @@
Execute_load_log_event ctor
*/
-Execute_load_log_event::Execute_load_log_event(const char* buf, uint len,
+Execute_load_log_event::Execute_load_log_event(const uchar* buf, uint len,
const Format_description_log_event* description_event)
:Log_event(buf, description_event), file_id(0)
{
@@ -4987,7 +4988,7 @@
Begin_load_query_log_event::
-Begin_load_query_log_event(const char* buf, uint len,
+Begin_load_query_log_event(const uchar* buf, uint len,
const Format_description_log_event* desc_event)
:Append_block_log_event(buf, len, desc_event)
{
@@ -5024,7 +5025,7 @@
Execute_load_query_log_event::
-Execute_load_query_log_event(const char* buf, uint event_len,
+Execute_load_query_log_event(const uchar* buf, uint event_len,
const Format_description_log_event* desc_event):
Query_log_event(buf, event_len, desc_event, EXECUTE_LOAD_QUERY_EVENT),
file_id(0), fn_pos_start(0), fn_pos_end(0)
@@ -5316,7 +5317,7 @@
}
#endif
-Rows_log_event::Rows_log_event(const char *buf, uint event_len,
+Rows_log_event::Rows_log_event(const uchar *buf, uint event_len,
Log_event_type event_type,
const Format_description_log_event
*description_event)
@@ -5333,7 +5334,7 @@
event_len, common_header_len,
post_header_len));
- const char *post_start= buf + common_header_len;
+ const uchar *post_start= buf + common_header_len;
post_start+= RW_MAPID_OFFSET;
if (post_header_len == 6)
{
@@ -6030,7 +6031,7 @@
Constructor used by slave to read the event from the binary log.
*/
#if defined(HAVE_REPLICATION)
-Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
+Table_map_log_event::Table_map_log_event(const uchar *buf, uint event_len,
const Format_description_log_event
*description_event)
@@ -6050,7 +6051,7 @@
DBUG_DUMP("event buffer", buf, event_len);
/* Read the post-header */
- const char *post_start= buf + common_header_len;
+ const uchar *post_start= buf + common_header_len;
post_start+= TM_MAPID_OFFSET;
if (post_header_len == 6)
@@ -6071,7 +6072,7 @@
m_flags= uint2korr(post_start);
/* Read the variable part of the event */
- const char *const vpart= buf + common_header_len + post_header_len;
+ const uchar *const vpart= buf + common_header_len + post_header_len;
/* Extract the length of the various parts from the buffer */
byte const* const ptr_dblen= (byte const*)vpart + 0;
@@ -6357,7 +6358,7 @@
Constructor used by slave to read the event from the binary log.
*/
#ifdef HAVE_REPLICATION
-Write_rows_log_event::Write_rows_log_event(const char *buf, uint event_len,
+Write_rows_log_event::Write_rows_log_event(const uchar *buf, uint event_len,
const Format_description_log_event
*description_event)
: Rows_log_event(buf, event_len, WRITE_ROWS_EVENT, description_event)
@@ -6905,7 +6906,7 @@
Constructor used by slave to read the event from the binary log.
*/
#ifdef HAVE_REPLICATION
-Delete_rows_log_event::Delete_rows_log_event(const char *buf, uint event_len,
+Delete_rows_log_event::Delete_rows_log_event(const uchar *buf, uint event_len,
const Format_description_log_event
*description_event)
#if defined(MYSQL_CLIENT)
@@ -7049,7 +7050,7 @@
Constructor used by slave to read the event from the binary log.
*/
#ifdef HAVE_REPLICATION
-Update_rows_log_event::Update_rows_log_event(const char *buf, uint event_len,
+Update_rows_log_event::Update_rows_log_event(const uchar *buf, uint event_len,
const
Format_description_log_event
*description_event)
--- 1.136/sql/log_event.h 2006-10-21 20:31:03 +02:00
+++ 1.137/sql/log_event.h 2006-10-21 20:31:03 +02:00
@@ -572,7 +572,7 @@
A temp buffer for read_log_event; it is later analysed according to the
event's type, and its content is distributed in the event-specific fields.
*/
- char *temp_buf;
+ uchar *temp_buf;
/*
Timestamp on the master(for debugging and replication of
NOW()/TIMESTAMP). It is important for queries and LOAD DATA
@@ -691,14 +691,15 @@
virtual bool is_valid() const = 0;
virtual bool is_artificial_event() { return 0; }
inline bool get_cache_stmt() const { return cache_stmt; }
- Log_event(const char* buf, const Format_description_log_event* description_event);
+ Log_event(const unsigned char* buf,
+ const Format_description_log_event* description_event);
virtual ~Log_event() { free_temp_buf();}
- void register_temp_buf(char* buf) { temp_buf = buf; }
+ void register_temp_buf(uchar* buf) { temp_buf = buf; }
void free_temp_buf()
{
if (temp_buf)
{
- my_free(temp_buf, MYF(0));
+ my_free((gptr) temp_buf, MYF(0));
temp_buf = 0;
}
}
@@ -707,7 +708,7 @@
is calculated during write()
*/
virtual int get_data_size() { return 0;}
- static Log_event* read_log_event(const char* buf, uint event_len,
+ static Log_event* read_log_event(const uchar* buf, uint event_len,
const char **error,
const Format_description_log_event
*description_event);
@@ -827,7 +828,7 @@
#endif
Query_log_event();
- Query_log_event(const char* buf, uint event_len,
+ Query_log_event(const uchar* buf, uint event_len,
const Format_description_log_event *description_event,
Log_event_type event_type);
~Query_log_event()
@@ -901,7 +902,7 @@
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- Slave_log_event(const char* buf, uint event_len);
+ Slave_log_event(const uchar* buf, uint event_len);
~Slave_log_event();
int get_data_size();
bool is_valid() const { return master_host != 0; }
@@ -926,8 +927,8 @@
void print_query(bool need_db, char *buf, char **end,
char **fn_start, char **fn_end);
protected:
- int copy_log_event(const char *buf, ulong event_len,
- int body_offset, const Format_description_log_event* description_event);
+ int copy_log_event(const uchar *buf, ulong event_len, int body_offset,
+ const Format_description_log_event* description_event);
public:
ulong thread_id;
@@ -996,7 +997,7 @@
logging of LOAD DATA is going to be changed in 4.1 or 5.0, this is only used
for the common_header_len (post_header_len will not be changed).
*/
- Load_log_event(const char* buf, uint event_len,
+ Load_log_event(const uchar* buf, uint event_len,
const Format_description_log_event* description_event);
~Load_log_event()
{}
@@ -1079,7 +1080,7 @@
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- Start_log_event_v3(const char* buf,
+ Start_log_event_v3(const uchar* buf,
const Format_description_log_event* description_event);
~Start_log_event_v3() {}
Log_event_type get_type_code() { return START_EVENT_V3;}
@@ -1123,7 +1124,7 @@
#endif /* HAVE_REPLICATION */
#endif
- Format_description_log_event(const char* buf, uint event_len,
+ Format_description_log_event(const uchar* buf, uint event_len,
const Format_description_log_event* description_event);
~Format_description_log_event() { my_free((gptr)post_header_len, MYF(0)); }
Log_event_type get_type_code() { return FORMAT_DESCRIPTION_EVENT;}
@@ -1174,7 +1175,7 @@
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- Intvar_log_event(const char* buf, const Format_description_log_event* description_event);
+ Intvar_log_event(const uchar* buf, const Format_description_log_event* description_event);
~Intvar_log_event() {}
Log_event_type get_type_code() { return INTVAR_EVENT;}
const char* get_var_type_name();
@@ -1215,7 +1216,7 @@
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- Rand_log_event(const char* buf, const Format_description_log_event* description_event);
+ Rand_log_event(const uchar* buf, const Format_description_log_event* description_event);
~Rand_log_event() {}
Log_event_type get_type_code() { return RAND_EVENT;}
int get_data_size() { return 16; /* sizeof(ulonglong) * 2*/ }
@@ -1252,7 +1253,7 @@
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- Xid_log_event(const char* buf, const Format_description_log_event* description_event);
+ Xid_log_event(const uchar* buf, const Format_description_log_event* description_event);
~Xid_log_event() {}
Log_event_type get_type_code() { return XID_EVENT;}
int get_data_size() { return sizeof(xid); }
@@ -1294,7 +1295,7 @@
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- User_var_log_event(const char* buf, const Format_description_log_event* description_event);
+ User_var_log_event(const uchar* buf, const Format_description_log_event* description_event);
~User_var_log_event() {}
Log_event_type get_type_code() { return USER_VAR_EVENT;}
#ifndef MYSQL_CLIENT
@@ -1320,7 +1321,8 @@
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- Stop_log_event(const char* buf, const Format_description_log_event* description_event):
+ Stop_log_event(const unsigned char* buf,
+ const Format_description_log_event* description_event):
Log_event(buf, description_event)
{}
~Stop_log_event() {}
@@ -1358,7 +1360,7 @@
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- Rotate_log_event(const char* buf, uint event_len,
+ Rotate_log_event(const uchar* buf, uint event_len,
const Format_description_log_event* description_event);
~Rotate_log_event()
{
@@ -1391,7 +1393,7 @@
bool fake_base;
public:
char* block;
- const char *event_buf;
+ const uchar *event_buf;
uint block_len;
uint file_id;
bool inited_from_old;
@@ -1412,7 +1414,7 @@
void print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool enable_local);
#endif
- Create_file_log_event(const char* buf, uint event_len,
+ Create_file_log_event(const uchar* buf, uint event_len,
const Format_description_log_event* description_event);
~Create_file_log_event()
{
@@ -1479,7 +1481,7 @@
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- Append_block_log_event(const char* buf, uint event_len,
+ Append_block_log_event(const uchar* buf, uint event_len,
const Format_description_log_event* description_event);
~Append_block_log_event() {}
Log_event_type get_type_code() { return APPEND_BLOCK_EVENT;}
@@ -1515,7 +1517,7 @@
void print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool enable_local);
#endif
- Delete_file_log_event(const char* buf, uint event_len,
+ Delete_file_log_event(const uchar* buf, uint event_len,
const Format_description_log_event* description_event);
~Delete_file_log_event() {}
Log_event_type get_type_code() { return DELETE_FILE_EVENT;}
@@ -1550,7 +1552,7 @@
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
- Execute_load_log_event(const char* buf, uint event_len,
+ Execute_load_log_event(const uchar* buf, uint event_len,
const Format_description_log_event* description_event);
~Execute_load_log_event() {}
Log_event_type get_type_code() { return EXEC_LOAD_EVENT;}
@@ -1584,7 +1586,7 @@
int get_create_or_append() const;
#endif /* HAVE_REPLICATION */
#endif
- Begin_load_query_log_event(const char* buf, uint event_len,
+ Begin_load_query_log_event(const uchar* buf, uint event_len,
const Format_description_log_event* description_event);
~Begin_load_query_log_event() {}
Log_event_type get_type_code() { return BEGIN_LOAD_QUERY_EVENT; }
@@ -1637,7 +1639,7 @@
void print(FILE* file, PRINT_EVENT_INFO* print_event_info,
const char *local_fname);
#endif
- Execute_load_query_log_event(const char* buf, uint event_len,
+ Execute_load_query_log_event(const uchar* buf, uint event_len,
const Format_description_log_event *description_event);
~Execute_load_query_log_event() {}
@@ -1660,7 +1662,7 @@
Log_event's ctor, this way we can extract maximum information from the
event's header (the unique ID for example).
*/
- Unknown_log_event(const char* buf, const Format_description_log_event* description_event):
+ Unknown_log_event(const uchar* buf, const Format_description_log_event* description_event):
Log_event(buf, description_event)
{}
~Unknown_log_event() {}
@@ -1728,7 +1730,7 @@
bool is_transactional, uint16 flags);
#endif
#ifdef HAVE_REPLICATION
- Table_map_log_event(const char *buf, uint event_len,
+ Table_map_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *description_event);
#endif
@@ -1878,7 +1880,7 @@
Rows_log_event(THD*, TABLE*, ulong table_id,
MY_BITMAP const *cols, bool is_transactional);
#endif
- Rows_log_event(const char *row_data, uint event_len,
+ Rows_log_event(const uchar *row_data, uint event_len,
Log_event_type event_type,
const Format_description_log_event *description_event);
@@ -1998,7 +2000,7 @@
MY_BITMAP const *cols, bool is_transactional);
#endif
#ifdef HAVE_REPLICATION
- Write_rows_log_event(const char *buf, uint event_len,
+ Write_rows_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *description_event);
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_ROW_BASED_REPLICATION)
@@ -2062,7 +2064,7 @@
#endif
#ifdef HAVE_REPLICATION
- Update_rows_log_event(const char *buf, uint event_len,
+ Update_rows_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *description_event);
#endif
@@ -2133,7 +2135,7 @@
MY_BITMAP const *cols, bool is_transactional);
#endif
#ifdef HAVE_REPLICATION
- Delete_rows_log_event(const char *buf, uint event_len,
+ Delete_rows_log_event(const uchar *buf, uint event_len,
const Format_description_log_event *description_event);
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_ROW_BASED_REPLICATION)
--- 1.134/client/mysqlbinlog.cc 2006-10-21 20:31:03 +02:00
+++ 1.135/client/mysqlbinlog.cc 2006-10-21 20:31:03 +02:00
@@ -379,7 +379,7 @@
File_name_record rec;
DBUG_ENTER("Load_log_processor::process_first_event");
- if (!(fname= my_malloc(full_len,MYF(MY_WME))))
+ if (!(fname= (char*) my_malloc(full_len,MYF(MY_WME))))
DBUG_RETURN(-1);
memcpy(fname, target_dir_name, target_dir_name_len);
@@ -1140,7 +1140,7 @@
break; // end of data
DBUG_PRINT("info",( "len= %u, net->read_pos[5] = %d\n",
len, net->read_pos[5]));
- if (!(ev= Log_event::read_log_event((const char*) net->read_pos + 1 ,
+ if (!(ev= Log_event::read_log_event((const uchar*) net->read_pos + 1 ,
len - 1, &error_msg,
description_event)))
{
--- 1.288/sql/slave.cc 2006-10-21 20:31:03 +02:00
+++ 1.289/sql/slave.cc 2006-10-21 20:31:03 +02:00
@@ -3464,7 +3464,7 @@
retry_count=0; // ok event, reset retry counter
thd->proc_info = "Queueing master event to the relay log";
- if (queue_event(mi,(const char*)mysql->net.read_pos + 1,
+ if (queue_event(mi,(const uchar*)mysql->net.read_pos + 1,
event_len))
{
sql_print_error("Slave I/O thread could not queue event from master");
@@ -3985,13 +3985,14 @@
Reads a 3.23 event and converts it to the slave's format. This code was
copied from MySQL 4.0.
*/
-static int queue_binlog_ver_1_event(MASTER_INFO *mi, const char *buf,
- ulong event_len)
+static int
+queue_binlog_ver_1_event(MASTER_INFO *mi, const uchar *buf,
+ ulong event_len)
{
const char *errmsg = 0;
ulong inc_pos;
bool ignore_event= 0;
- char *tmp_buf = 0;
+ uchar *tmp_buf = 0;
RELAY_LOG_INFO *rli= &mi->rli;
DBUG_ENTER("queue_binlog_ver_1_event");
@@ -4001,7 +4002,7 @@
*/
if (buf[EVENT_TYPE_OFFSET] == LOAD_EVENT)
{
- if (unlikely(!(tmp_buf=(char*)my_malloc(event_len+1,MYF(MY_WME)))))
+ if (unlikely(!(tmp_buf=(uchar*)my_malloc(event_len+1,MYF(MY_WME)))))
{
sql_print_error("Slave I/O: out of memory for Load event");
DBUG_RETURN(1);
@@ -4016,7 +4017,7 @@
*/
tmp_buf[event_len++]=0;
int4store(tmp_buf+EVENT_LEN_OFFSET, event_len);
- buf = (const char*)tmp_buf;
+ buf = tmp_buf;
}
/*
This will transform LOAD_EVENT into CREATE_FILE_EVENT, ask the master to
@@ -4101,12 +4102,12 @@
Reads a 4.0 event and converts it to the slave's format. This code was copied
from queue_binlog_ver_1_event(), with some affordable simplifications.
*/
-static int queue_binlog_ver_3_event(MASTER_INFO *mi, const char *buf,
+static int queue_binlog_ver_3_event(MASTER_INFO *mi, const uchar *buf,
ulong event_len)
{
const char *errmsg = 0;
ulong inc_pos;
- char *tmp_buf = 0;
+ uchar *tmp_buf = 0;
RELAY_LOG_INFO *rli= &mi->rli;
DBUG_ENTER("queue_binlog_ver_3_event");
@@ -4165,7 +4166,7 @@
setup with 3.23 master or 4.0 master
*/
-static int queue_old_event(MASTER_INFO *mi, const char *buf,
+static int queue_old_event(MASTER_INFO *mi, const uchar *buf,
ulong event_len)
{
DBUG_ENTER("queue_old_event");
@@ -4193,7 +4194,7 @@
any >=5.0.0 format.
*/
-int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
+int queue_event(MASTER_INFO* mi, const uchar* buf, ulong event_len)
{
int error= 0;
ulong inc_pos;
--- 1.16/sql/log.h 2006-10-21 20:31:03 +02:00
+++ 1.17/sql/log.h 2006-10-21 20:31:03 +02:00
@@ -346,7 +346,7 @@
v stands for vector
invoked as appendv(buf1,len1,buf2,len2,...,bufn,lenn,0)
*/
- bool appendv(const char* buf,uint len,...);
+ bool appendv(const uchar* buf, uint len, ...);
bool append(Log_event* ev);
void make_log_name(char* buf, const char* log_ident);
--- 1.3/sql/sql_binlog.cc 2006-10-21 20:31:04 +02:00
+++ 1.4/sql/sql_binlog.cc 2006-10-21 20:31:04 +02:00
@@ -58,7 +58,7 @@
new Format_description_log_event(4);
const char *error= 0;
- char *buf= (char *) my_malloc(decoded_len, MYF(MY_WME));
+ uchar *buf= (uchar *) my_malloc(decoded_len, MYF(MY_WME));
Log_event *ev = 0;
/*
@@ -114,7 +114,7 @@
Now we start to read events of the buffer, until there are no
more.
*/
- for (char *bufptr= buf ; bytes_decoded > 0 ; )
+ for (uchar *bufptr= buf ; bytes_decoded > 0 ; )
{
/*
Checking that the first event in the buffer is not truncated.
@@ -181,6 +181,6 @@
thd->net.no_send_ok= nsok;
delete desc;
- my_free(buf, MYF(MY_ALLOW_ZERO_PTR));
+ my_free((gptr) buf, MYF(MY_ALLOW_ZERO_PTR));
DBUG_VOID_RETURN;
}
--- 1.1/strings/my_strchr.c 2006-10-21 20:31:04 +02:00
+++ 1.2/strings/my_strchr.c 2006-10-21 20:31:04 +02:00
@@ -27,7 +27,7 @@
#include "m_ctype.h"
-byte *my_strchr(CHARSET_INFO *cs, const char *str, const char *end,
+char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end,
char c)
{
uint mbl;
--- 1.101/sql/slave.h 2006-10-21 20:31:04 +02:00
+++ 1.102/sql/slave.h 2006-10-21 20:31:04 +02:00
@@ -216,7 +216,7 @@
} MASTER_INFO;
-int queue_event(MASTER_INFO* mi,const char* buf,ulong event_len);
+int queue_event(MASTER_INFO* mi, const uchar* buf, ulong event_len);
#define RPL_LOG_NAME (rli->group_master_log_name[0] ? rli->group_master_log_name :\
"FIRST")
| Thread |
|---|
| • bk commit into 5.1 tree (mats:1.2309) | Mats Kindahl | 21 Oct |