mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Merge 10.1 into 10.2
This commit is contained in:
commit
2a93e632b1
11 changed files with 66 additions and 25 deletions
|
@ -7,6 +7,8 @@ SET @@GLOBAL.replicate_ignore_table="test.t4,test.t5,test.t6";
|
|||
ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET @@GLOBAL.replicate_do_table="";
|
||||
SET @@GLOBAL.replicate_ignore_table="";
|
||||
SET @@GLOBAL.replicate_do_table="test.t1,test.t2,test.t3";
|
||||
SET @@GLOBAL.replicate_ignore_table="test.t4,test.t5,test.t6";
|
||||
include/start_slave.inc
|
||||
|
|
|
@ -7,6 +7,8 @@ SET @@GLOBAL.replicate_wild_ignore_table="test.b%";
|
|||
ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
|
||||
connection slave;
|
||||
include/stop_slave.inc
|
||||
SET @@GLOBAL.replicate_wild_do_table="";
|
||||
SET @@GLOBAL.replicate_wild_ignore_table="";
|
||||
SET @@GLOBAL.replicate_wild_do_table="test.a%";
|
||||
SET @@GLOBAL.replicate_wild_ignore_table="test.b%";
|
||||
include/start_slave.inc
|
||||
|
|
|
@ -51,6 +51,8 @@ SET @@GLOBAL.replicate_ignore_table="test.t4,test.t5,test.t6";
|
|||
|
||||
connection slave;
|
||||
source include/stop_slave.inc;
|
||||
SET @@GLOBAL.replicate_do_table="";
|
||||
SET @@GLOBAL.replicate_ignore_table="";
|
||||
SET @@GLOBAL.replicate_do_table="test.t1,test.t2,test.t3";
|
||||
SET @@GLOBAL.replicate_ignore_table="test.t4,test.t5,test.t6";
|
||||
source include/start_slave.inc;
|
||||
|
|
|
@ -13,6 +13,8 @@ SET @@GLOBAL.replicate_wild_ignore_table="test.b%";
|
|||
|
||||
connection slave;
|
||||
source include/stop_slave.inc;
|
||||
SET @@GLOBAL.replicate_wild_do_table="";
|
||||
SET @@GLOBAL.replicate_wild_ignore_table="";
|
||||
SET @@GLOBAL.replicate_wild_do_table="test.a%";
|
||||
SET @@GLOBAL.replicate_wild_ignore_table="test.b%";
|
||||
source include/start_slave.inc;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Copyright (c) 2000, 2011, Oracle and/or its affiliates
|
||||
Copyright (c) 2010, 2015, MariaDB
|
||||
Copyright (c) 2010, 2020, MariaDB
|
||||
|
||||
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
|
||||
|
@ -804,7 +804,8 @@ int _my_b_cache_read(IO_CACHE *info, uchar *Buffer, size_t Count)
|
|||
info->read_pos=info->buffer+Count;
|
||||
info->read_end=info->buffer+length;
|
||||
info->pos_in_file=pos_in_file;
|
||||
memcpy(Buffer, info->buffer, Count);
|
||||
if (Count)
|
||||
memcpy(Buffer, info->buffer, Count);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
@ -1305,7 +1306,8 @@ static int _my_b_cache_read_r(IO_CACHE *cache, uchar *Buffer, size_t Count)
|
|||
DBUG_RETURN(1);
|
||||
}
|
||||
cnt= (len > Count) ? Count : len;
|
||||
memcpy(Buffer, cache->read_pos, cnt);
|
||||
if (cnt)
|
||||
memcpy(Buffer, cache->read_pos, cnt);
|
||||
Count -= cnt;
|
||||
Buffer+= cnt;
|
||||
left_length+= cnt;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
Copyright (c) 2000, 2010, Oracle and/or its affiliates
|
||||
Copyright (c) 2010, 2020, MariaDB
|
||||
|
||||
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
|
||||
|
@ -449,7 +450,8 @@ char *strmake_root(MEM_ROOT *root, const char *str, size_t len)
|
|||
char *pos;
|
||||
if ((pos=alloc_root(root,len+1)))
|
||||
{
|
||||
memcpy(pos,str,len);
|
||||
if (len)
|
||||
memcpy(pos,str,len);
|
||||
pos[len]=0;
|
||||
}
|
||||
return pos;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2009, 2013, Oracle and/or its affiliates.
|
||||
Copyright (c) 2013, 2020, MariaDB
|
||||
|
||||
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
|
||||
|
@ -319,7 +320,8 @@ static char *debug_sync_bmove_len(char *to, char *to_end,
|
|||
DBUG_ASSERT(to_end);
|
||||
DBUG_ASSERT(!length || from);
|
||||
set_if_smaller(length, (size_t) (to_end - to));
|
||||
memcpy(to, from, length);
|
||||
if (length)
|
||||
memcpy(to, from, length);
|
||||
return (to + length);
|
||||
}
|
||||
|
||||
|
|
|
@ -4080,7 +4080,8 @@ rpl_make_log_name(const char *opt,
|
|||
const char *ext)
|
||||
{
|
||||
DBUG_ENTER("rpl_make_log_name");
|
||||
DBUG_PRINT("enter", ("opt: %s, def: %s, ext: %s", opt, def, ext));
|
||||
DBUG_PRINT("enter", ("opt: %s, def: %s, ext: %s", opt ? opt : "(null)",
|
||||
def, ext));
|
||||
char buff[FN_REFLEN];
|
||||
const char *base= opt ? opt : def;
|
||||
unsigned int options=
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2012, 2018, MariaDB Corporation.
|
||||
Copyright (c) 2012, 2020, MariaDB Corporation.
|
||||
|
||||
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
|
||||
|
@ -604,7 +604,8 @@ net_write_buff(NET *net, const uchar *packet, ulong len)
|
|||
return net_real_write(net, packet, len) ? 1 : 0;
|
||||
/* Send out rest of the blocks as full sized blocks */
|
||||
}
|
||||
memcpy((char*) net->write_pos,packet,len);
|
||||
if (len)
|
||||
memcpy((char*) net->write_pos,packet,len);
|
||||
net->write_pos+= len;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -349,16 +349,22 @@ Rpl_filter::set_do_table(const char* table_spec)
|
|||
int status;
|
||||
|
||||
if (do_table_inited)
|
||||
my_hash_reset(&do_table);
|
||||
|
||||
status= parse_filter_rule(table_spec, &Rpl_filter::add_do_table);
|
||||
|
||||
if (!do_table.records)
|
||||
{
|
||||
my_hash_free(&do_table);
|
||||
do_table_inited= 0;
|
||||
}
|
||||
|
||||
status= parse_filter_rule(table_spec, &Rpl_filter::add_do_table);
|
||||
|
||||
if (do_table_inited && status)
|
||||
{
|
||||
if (!do_table.records)
|
||||
{
|
||||
my_hash_free(&do_table);
|
||||
do_table_inited= 0;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -369,16 +375,22 @@ Rpl_filter::set_ignore_table(const char* table_spec)
|
|||
int status;
|
||||
|
||||
if (ignore_table_inited)
|
||||
my_hash_reset(&ignore_table);
|
||||
|
||||
status= parse_filter_rule(table_spec, &Rpl_filter::add_ignore_table);
|
||||
|
||||
if (!ignore_table.records)
|
||||
{
|
||||
my_hash_free(&ignore_table);
|
||||
ignore_table_inited= 0;
|
||||
}
|
||||
|
||||
status= parse_filter_rule(table_spec, &Rpl_filter::add_ignore_table);
|
||||
|
||||
if (ignore_table_inited && status)
|
||||
{
|
||||
if (!ignore_table.records)
|
||||
{
|
||||
my_hash_free(&ignore_table);
|
||||
ignore_table_inited= 0;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -411,14 +423,20 @@ Rpl_filter::set_wild_do_table(const char* table_spec)
|
|||
int status;
|
||||
|
||||
if (wild_do_table_inited)
|
||||
{
|
||||
free_string_array(&wild_do_table);
|
||||
wild_do_table_inited= 0;
|
||||
}
|
||||
|
||||
status= parse_filter_rule(table_spec, &Rpl_filter::add_wild_do_table);
|
||||
|
||||
if (!wild_do_table.elements)
|
||||
if (wild_do_table_inited && status)
|
||||
{
|
||||
delete_dynamic(&wild_do_table);
|
||||
wild_do_table_inited= 0;
|
||||
if (!wild_do_table.elements)
|
||||
{
|
||||
delete_dynamic(&wild_do_table);
|
||||
wild_do_table_inited= 0;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
|
@ -431,14 +449,20 @@ Rpl_filter::set_wild_ignore_table(const char* table_spec)
|
|||
int status;
|
||||
|
||||
if (wild_ignore_table_inited)
|
||||
{
|
||||
free_string_array(&wild_ignore_table);
|
||||
wild_ignore_table_inited= 0;
|
||||
}
|
||||
|
||||
status= parse_filter_rule(table_spec, &Rpl_filter::add_wild_ignore_table);
|
||||
|
||||
if (!wild_ignore_table.elements)
|
||||
if (wild_ignore_table_inited && status)
|
||||
{
|
||||
delete_dynamic(&wild_ignore_table);
|
||||
wild_ignore_table_inited= 0;
|
||||
if (!wild_ignore_table.elements)
|
||||
{
|
||||
delete_dynamic(&wild_ignore_table);
|
||||
wild_ignore_table_inited= 0;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
|
|
|
@ -555,7 +555,8 @@ public:
|
|||
}
|
||||
void q_append(const char *data, size_t data_len)
|
||||
{
|
||||
memcpy(Ptr + str_length, data, data_len);
|
||||
if (data_len)
|
||||
memcpy(Ptr + str_length, data, data_len);
|
||||
DBUG_ASSERT(str_length <= UINT_MAX32 - data_len);
|
||||
str_length += (uint)data_len;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue