# ==== Purpose ====
#
# Relocates the relay logs and index file from
# a directory into another. The logs relocated
# are the one listed in the index file.
#
# ==== Usage ====
#
# [--let $relocate_disable_query_log= 1]
# [--let $rpl_debug= 1]
# [--let $relocate_is_windows= 0]
# [--let $relocate_recreate_index= 0]
# [--let $relocate_fix_relay_log_info= 0]
# --let $relocate_from= DIR
# --let $relocate_to= DIR
# --let $relocate_index_file= FNAME
# --source include/relocate_binlogs.inc
if ($relocate_disable_query_log)
{
--disable_query_log
}
--let $_path_separator=/ if ($relocate_is_windows)
{
--let $_path_separator=\
}
if ($relocate_index_file)
{ SET SQL_LOG_BIN=0;
CREATE TEMPORARY TABLE tmp(id INT AUTO_INCREMENT PRIMARY KEY, filename VARCHAR(1024));
if ($relocate_fix_relay_log_info)
{
CREATE TEMPORARY TABLE tmp(id INT AUTO_INCREMENT PRIMARY KEY, entry VARCHAR(1024));
--let $write_var=
# chmod to allow the following LOAD DATA
--chmod 0666$relocate_fix_relay_log_info
--eval LOAD DATA INFILE '$relocate_fix_relay_log_info' INTO TABLE tmp (entry)
--let $count= `SELECT count(*) FROM tmp`
--let $_curr_entry= `SELECT entry FROM tmp WHERE id=2`
--let $_curr_entry_basename= `SELECT RIGHT(RTRIM("$_curr_entry"), LOCATE("$_path_separator",REVERSE(RTRIM("$_curr_entry"))) -1)`
if ($relocate_is_windows)
{
--eval UPDATE tmp SET entry='$_to\$_curr_entry_basename' WHERE id=2
} if (!$relocate_is_windows)
{
--eval UPDATE tmp SET entry='$_to/$_curr_entry_basename' WHERE id=2
}
--remove_file $relocate_fix_relay_log_info
while($count)
{
--let $_write_var= `SELECT entry FROM tmp WHERE id= $count`
--let $write_var=$_write_var\n$write_var
--dec $count
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.