mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
sql/log.cc
Added magic number to binlog sql/log_event.cc distinquish bogus data from truncated logs sql/log_event.h added magic number added LOG_READ_TRUNC error sql/mysqlbinlog.cc fixed to handle magic number added O_BINARY to my_fopen sql/mysqld.cc added code for replicate-rewrite-db sql/slave.cc replicate-rewrite-db O_BINARY handle magic sql/sql_class.h added i_string_pair class sql/sql_repl.cc added magic better error messages support-files/magic added magic for binlog Added test case for replication of queries with error
This commit is contained in:
@ -177,6 +177,7 @@ static VioSSLAcceptorFd* ssl_acceptor_fd = 0;
|
||||
|
||||
extern bool slave_running;
|
||||
|
||||
I_List <i_string_pair> replicate_rewrite_db;
|
||||
I_List<i_string> replicate_do_db, replicate_ignore_db;
|
||||
// allow the user to tell us which db to replicate and which to ignore
|
||||
I_List<i_string> binlog_do_db, binlog_ignore_db;
|
||||
@ -2854,6 +2855,38 @@ static void get_options(int argc,char **argv)
|
||||
replicate_do_db.push_back(db);
|
||||
break;
|
||||
}
|
||||
case (int)OPT_REPLICATE_REWRITE_DB:
|
||||
{
|
||||
char* key = optarg,*p, *val;
|
||||
p = strstr(optarg, "->");
|
||||
if(!p)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"bad syntax in replicate-rewrite-db - missing ->\n");
|
||||
exit(1);
|
||||
}
|
||||
val = p--;
|
||||
while(isspace(*p) && p > optarg) *p-- = 0;
|
||||
if(p == optarg)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"bad syntax in replicate-rewrite-db - empty FROM db\n");
|
||||
exit(1);
|
||||
}
|
||||
*val = 0;
|
||||
val += 2;
|
||||
while(*val && isspace(*val)) *val++;
|
||||
if(!*val)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"bad syntax in replicate-rewrite-db - empty TO db\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
i_string_pair* db_pair = new i_string_pair(key, val);
|
||||
replicate_rewrite_db.push_back(db_pair);
|
||||
break;
|
||||
}
|
||||
|
||||
case (int)OPT_BINLOG_IGNORE_DB:
|
||||
{
|
||||
|
Reference in New Issue
Block a user