mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge with base MySQL 5.1
Contains fixes for test cases Changed release tag to beta configure.in: change release tag to beta
This commit is contained in:
125
sql/sql_repl.cc
125
sql/sql_repl.cc
@ -63,7 +63,7 @@ static int fake_rotate_event(NET* net, String* packet, char* log_file_name,
|
||||
ulong event_len = ident_len + LOG_EVENT_HEADER_LEN + ROTATE_HEADER_LEN;
|
||||
int4store(header + SERVER_ID_OFFSET, server_id);
|
||||
int4store(header + EVENT_LEN_OFFSET, event_len);
|
||||
int2store(header + FLAGS_OFFSET, 0);
|
||||
int2store(header + FLAGS_OFFSET, LOG_EVENT_ARTIFICIAL_F);
|
||||
|
||||
// TODO: check what problems this may cause and fix them
|
||||
int4store(header + LOG_POS_OFFSET, 0);
|
||||
@ -257,6 +257,17 @@ bool purge_error_message(THD* thd, int res)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Execute a PURGE BINARY LOGS TO <log> command.
|
||||
|
||||
@param thd Pointer to THD object for the client thread executing the
|
||||
statement.
|
||||
|
||||
@param to_log Name of the last log to purge.
|
||||
|
||||
@retval FALSE success
|
||||
@retval TRUE failure
|
||||
*/
|
||||
bool purge_master_logs(THD* thd, const char* to_log)
|
||||
{
|
||||
char search_file_name[FN_REFLEN];
|
||||
@ -273,6 +284,17 @@ bool purge_master_logs(THD* thd, const char* to_log)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Execute a PURGE BINARY LOGS BEFORE <date> command.
|
||||
|
||||
@param thd Pointer to THD object for the client thread executing the
|
||||
statement.
|
||||
|
||||
@param purge_time Date before which logs should be purged.
|
||||
|
||||
@retval FALSE success
|
||||
@retval TRUE failure
|
||||
*/
|
||||
bool purge_master_logs_before_date(THD* thd, time_t purge_time)
|
||||
{
|
||||
if (!mysql_bin_log.is_open())
|
||||
@ -765,6 +787,20 @@ err:
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Execute a START SLAVE statement.
|
||||
|
||||
@param thd Pointer to THD object for the client thread executing the
|
||||
statement.
|
||||
|
||||
@param mi Pointer to Master_info object for the slave's IO thread.
|
||||
|
||||
@param net_report If true, saves the exit status into thd->main_da.
|
||||
|
||||
@retval 0 success
|
||||
@retval 1 error
|
||||
*/
|
||||
int start_slave(THD* thd , Master_info* mi, bool net_report)
|
||||
{
|
||||
int slave_errno= 0;
|
||||
@ -890,6 +926,19 @@ int start_slave(THD* thd , Master_info* mi, bool net_report)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Execute a STOP SLAVE statement.
|
||||
|
||||
@param thd Pointer to THD object for the client thread executing the
|
||||
statement.
|
||||
|
||||
@param mi Pointer to Master_info object for the slave's IO thread.
|
||||
|
||||
@param net_report If true, saves the exit status into thd->main_da.
|
||||
|
||||
@retval 0 success
|
||||
@retval 1 error
|
||||
*/
|
||||
int stop_slave(THD* thd, Master_info* mi, bool net_report )
|
||||
{
|
||||
DBUG_ENTER("stop_slave");
|
||||
@ -942,20 +991,17 @@ int stop_slave(THD* thd, Master_info* mi, bool net_report )
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Remove all relay logs and start replication from the start
|
||||
/**
|
||||
Execute a RESET SLAVE statement.
|
||||
|
||||
SYNOPSIS
|
||||
reset_slave()
|
||||
thd Thread handler
|
||||
mi Master info for the slave
|
||||
@param thd Pointer to THD object of the client thread executing the
|
||||
statement.
|
||||
|
||||
RETURN
|
||||
0 ok
|
||||
1 error
|
||||
@param mi Pointer to Master_info object for the slave.
|
||||
|
||||
@retval 0 success
|
||||
@retval 1 error
|
||||
*/
|
||||
|
||||
|
||||
int reset_slave(THD *thd, Master_info* mi)
|
||||
{
|
||||
MY_STAT stat_area;
|
||||
@ -1070,6 +1116,18 @@ void kill_zombie_dump_threads(uint32 slave_server_id)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Execute a CHANGE MASTER statement.
|
||||
|
||||
@param thd Pointer to THD object for the client thread executing the
|
||||
statement.
|
||||
|
||||
@param mi Pointer to Master_info object belonging to the slave's IO
|
||||
thread.
|
||||
|
||||
@retval FALSE success
|
||||
@retval TRUE error
|
||||
*/
|
||||
bool change_master(THD* thd, Master_info* mi)
|
||||
{
|
||||
int thread_mask;
|
||||
@ -1283,6 +1341,16 @@ bool change_master(THD* thd, Master_info* mi)
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Execute a RESET MASTER statement.
|
||||
|
||||
@param thd Pointer to THD object of the client thread executing the
|
||||
statement.
|
||||
|
||||
@retval 0 success
|
||||
@retval 1 error
|
||||
*/
|
||||
int reset_master(THD* thd)
|
||||
{
|
||||
if (!mysql_bin_log.is_open())
|
||||
@ -1312,6 +1380,15 @@ int cmp_master_pos(const char* log_file_name1, ulonglong log_pos1,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Execute a SHOW BINLOG EVENTS statement.
|
||||
|
||||
@param thd Pointer to THD object for the client thread executing the
|
||||
statement.
|
||||
|
||||
@retval FALSE success
|
||||
@retval TRUE failure
|
||||
*/
|
||||
bool mysql_show_binlog_events(THD* thd)
|
||||
{
|
||||
Protocol *protocol= thd->protocol;
|
||||
@ -1462,6 +1539,15 @@ err:
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Execute a SHOW MASTER STATUS statement.
|
||||
|
||||
@param thd Pointer to THD object for the client thread executing the
|
||||
statement.
|
||||
|
||||
@retval FALSE success
|
||||
@retval TRUE failure
|
||||
*/
|
||||
bool show_binlog_info(THD* thd)
|
||||
{
|
||||
Protocol *protocol= thd->protocol;
|
||||
@ -1495,18 +1581,15 @@ bool show_binlog_info(THD* thd)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Send a list of all binary logs to client
|
||||
/**
|
||||
Execute a SHOW BINARY LOGS statement.
|
||||
|
||||
SYNOPSIS
|
||||
show_binlogs()
|
||||
thd Thread specific variable
|
||||
@param thd Pointer to THD object for the client thread executing the
|
||||
statement.
|
||||
|
||||
RETURN VALUES
|
||||
FALSE OK
|
||||
TRUE error
|
||||
@retval FALSE success
|
||||
@retval TRUE failure
|
||||
*/
|
||||
|
||||
bool show_binlogs(THD* thd)
|
||||
{
|
||||
IO_CACHE *index_file;
|
||||
|
Reference in New Issue
Block a user