Commit 6a59acba authored by Andrei Elkin's avatar Andrei Elkin

reverting the initial patch for bug#13437900 for refinement.

parent 8d154f7a
......@@ -17,7 +17,6 @@
# working when expected.
--source include/master-slave.inc
--source include/have_binlog_format_mixed.inc
connection slave;
STOP SLAVE;
......
......@@ -1129,7 +1129,7 @@ int init_dynarray_intvar_from_file(DYNAMIC_ARRAY* arr, IO_CACHE* f)
memcpy(buf_act, buf, read_size);
snd_size= my_b_gets(f, buf_act + read_size, max_size - read_size);
if (snd_size == 0 ||
((snd_size + 1 == max_size - read_size) && buf[max_size - 2] != '\n'))
((snd_size + 1 == max_size - read_size) && buf_act[max_size - 2] != '\n'))
{
/*
failure to make the 2nd read or short read again
......
......@@ -2352,7 +2352,6 @@ LEX::LEX()
INITIAL_LEX_PLUGIN_LIST_SIZE,
INITIAL_LEX_PLUGIN_LIST_SIZE);
reset_query_tables_list(TRUE);
repl_ignore_server_ids_inited= false;
}
......
......@@ -291,9 +291,7 @@ typedef struct st_lex_master_info
char *ssl_key, *ssl_cert, *ssl_ca, *ssl_capath, *ssl_cipher;
char *relay_log_name;
ulong relay_log_pos;
bool repl_ignore_server_ids_inited;
DYNAMIC_ARRAY repl_ignore_server_ids;
typeof(::server_id) repl_ignore_server_ids_static_buffer[4];
} LEX_MASTER_INFO;
typedef struct st_lex_reset_slave
......@@ -2457,11 +2455,6 @@ struct LEX: public Query_tables_list
destroy_query_tables_list();
plugin_unlock_list(NULL, (plugin_ref *)plugins.buffer, plugins.elements);
delete_dynamic(&plugins);
if (mi.repl_ignore_server_ids_inited)
{
delete_dynamic(&mi.repl_ignore_server_ids);
mi.repl_ignore_server_ids_inited= false;
}
}
inline bool is_ps_or_view_context_analysis()
......
......@@ -1689,6 +1689,7 @@ bool change_master(THD* thd, Master_info* mi)
thd_proc_info(thd, 0);
if (ret == FALSE)
my_ok(thd);
delete_dynamic(&lex_mi->repl_ignore_server_ids); //freeing of parser-time alloc
DBUG_RETURN(ret);
}
......
......@@ -1863,7 +1863,12 @@ change:
LEX *lex = Lex;
lex->sql_command = SQLCOM_CHANGE_MASTER;
bzero((char*) &lex->mi, sizeof(lex->mi));
/*
resetting flags that can left from the previous CHANGE MASTER
*/
lex->mi.repl_ignore_server_ids_opt= LEX_MASTER_INFO::LEX_MI_UNCHANGED;
my_init_dynamic_array(&Lex->mi.repl_ignore_server_ids,
sizeof(::server_id), 16, 16);
}
master_defs
{}
......@@ -1960,7 +1965,7 @@ master_def:
| IGNORE_SERVER_IDS_SYM EQ '(' ignore_server_id_list ')'
{
Lex->mi.repl_ignore_server_ids_opt= LEX_MASTER_INFO::LEX_MI_ENABLE;
}
}
|
master_file_def
;
......@@ -1974,15 +1979,6 @@ ignore_server_id_list:
ignore_server_id:
ulong_num
{
if (!Lex->mi.repl_ignore_server_ids_inited)
{
my_init_dynamic_array2(&Lex->mi.repl_ignore_server_ids,
sizeof(::server_id),
Lex->mi.repl_ignore_server_ids_static_buffer,
array_elements(Lex->mi.repl_ignore_server_ids_static_buffer),
16);
Lex->mi.repl_ignore_server_ids_inited= true;
}
insert_dynamic(&Lex->mi.repl_ignore_server_ids, (uchar*) &($1));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment