mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
8ac1b41cf3
Changed names of multi-source log files so that original suffixes are kept. include/my_sys.h: Added fn_ext2(), which returns pointer to last '.' in file name mysql-test/extra/rpl_tests/rpl_max_relay_size.test: Updated test mysql-test/suite/multi_source/info_logs-master.opt: Test with strange file names mysql-test/suite/multi_source/info_logs.result: Updated results mysql-test/suite/multi_source/info_logs.test: Changed to test with complex names to be able to verify the filename generator code mysql-test/suite/multi_source/relaylog_events.result: Updated results mysql-test/suite/multi_source/reset_slave.result: Updated results mysql-test/suite/multi_source/skip_counter.result: Updated results mysql-test/suite/multi_source/skip_counter.test: Added testing of max_relay_log_size mysql-test/suite/rpl/r/rpl_row_max_relay_size.result: Updated results mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result: Updated results mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result: Updated results mysql-test/suite/sys_vars/t/max_relay_log_size_basic.test: Updated results mysys/mf_fn_ext.c: Added fn_ext2(), which returns pointer to last '.' in file name sql/log.cc: Removed some wrong casts sql/log.h: Updated comment to reflect new code sql/log_event.cc: Updated DBUG_PRINT sql/mysqld.cc: Added that max_relay_log_size copies it's values from max_binlog_size sql/mysqld.h: Removed max_relay_log_size sql/rpl_mi.cc: Changed names of multi-source log files so that original suffixes are kept. sql/rpl_mi.h: Updated prototype sql/rpl_rli.cc: Updated comment to reflect new code Made max_relay_log_size depending on master connection. sql/rpl_rli.h: Made max_relay_log_size depending on master connection. sql/set_var.h: Made option global so that one can check and change min & max values (sorry Sergei) sql/sql_class.h: Made max_relay_log_size depending on master connection. sql/sql_repl.cc: Updated calls to create_signed_file_name() sql/sys_vars.cc: Made max_relay_log_size depending on master connection. Made old code more reusable sql/sys_vars.h: Changed Sys_var_multi_source_uint to ulong to be able to handle max_relay_log_size Made old code more reusable
91 lines
2.5 KiB
C
91 lines
2.5 KiB
C
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; version 2 of the License.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
|
|
|
|
|
|
#include "mysys_priv.h"
|
|
#include <m_string.h>
|
|
|
|
/*
|
|
Return a pointer to the extension of the filename.
|
|
|
|
SYNOPSIS
|
|
fn_ext()
|
|
name Name of file
|
|
|
|
DESCRIPTION
|
|
The extension is defined as everything after the first extension character
|
|
(normally '.') after the directory name.
|
|
|
|
RETURN VALUES
|
|
Pointer to to the extension character. If there isn't any extension,
|
|
points at the end ASCII(0) of the filename.
|
|
*/
|
|
|
|
char *fn_ext(const char *name)
|
|
{
|
|
register const char *pos, *gpos;
|
|
DBUG_ENTER("fn_ext");
|
|
DBUG_PRINT("mfunkt",("name: '%s'",name));
|
|
|
|
#if defined(FN_DEVCHAR) || defined(BASKSLASH_MBTAIL)
|
|
{
|
|
char buff[FN_REFLEN];
|
|
size_t res_length;
|
|
gpos= name+ dirname_part(buff,(char*) name, &res_length);
|
|
}
|
|
#else
|
|
if (!(gpos= strrchr(name, FN_LIBCHAR)))
|
|
gpos= name;
|
|
#endif
|
|
pos=strchr(gpos,FN_EXTCHAR);
|
|
DBUG_RETURN((char*) (pos ? pos : strend(gpos)));
|
|
} /* fn_ext */
|
|
|
|
|
|
/*
|
|
Return a pointer to the extension of the filename.
|
|
|
|
SYNOPSIS
|
|
fn_ext()
|
|
name Name of file
|
|
|
|
DESCRIPTION
|
|
The extension is defined as everything after the last extension character
|
|
(normally '.') after the directory name.
|
|
|
|
RETURN VALUES
|
|
Pointer to to the extension character. If there isn't any extension,
|
|
points at the end ASCII(0) of the filename.
|
|
*/
|
|
|
|
char *fn_ext2(const char *name)
|
|
{
|
|
register const char *pos, *gpos;
|
|
DBUG_ENTER("fn_ext");
|
|
DBUG_PRINT("mfunkt",("name: '%s'",name));
|
|
|
|
#if defined(FN_DEVCHAR) || defined(BASKSLASH_MBTAIL)
|
|
{
|
|
char buff[FN_REFLEN];
|
|
size_t res_length;
|
|
gpos= name+ dirname_part(buff,(char*) name, &res_length);
|
|
}
|
|
#else
|
|
if (!(gpos= strrchr(name, FN_LIBCHAR)))
|
|
gpos= name;
|
|
#endif
|
|
pos=strrchr(gpos,FN_EXTCHAR);
|
|
DBUG_RETURN((char*) (pos ? pos : strend(gpos)));
|
|
} /* fn_ext */
|