mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug #17038, distribution of schema operation to multiple binlogs missing/multiple entries, partial fix
- log alter table directly in server instead of in handler - acknowledge alter table _after_ all binlog events have been processed
This commit is contained in:
@ -2529,12 +2529,11 @@ struct binlog_log_query_st
|
||||
const char *table_name;
|
||||
};
|
||||
|
||||
static my_bool binlog_log_query_handlerton(THD *thd,
|
||||
st_plugin_int *plugin,
|
||||
void *args)
|
||||
static my_bool binlog_log_query_handlerton2(THD *thd,
|
||||
const handlerton *hton,
|
||||
void *args)
|
||||
{
|
||||
struct binlog_log_query_st *b= (struct binlog_log_query_st*)args;
|
||||
handlerton *hton= (handlerton *) plugin->plugin->info;
|
||||
if (hton->state == SHOW_OPTION_YES && hton->binlog_log_query)
|
||||
hton->binlog_log_query(thd,
|
||||
b->binlog_command,
|
||||
@ -2545,7 +2544,15 @@ static my_bool binlog_log_query_handlerton(THD *thd,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void ha_binlog_log_query(THD *thd, enum_binlog_command binlog_command,
|
||||
static my_bool binlog_log_query_handlerton(THD *thd,
|
||||
st_plugin_int *plugin,
|
||||
void *args)
|
||||
{
|
||||
return binlog_log_query_handlerton2(thd, (const handlerton *) plugin->plugin->info, args);
|
||||
}
|
||||
|
||||
void ha_binlog_log_query(THD *thd, const handlerton *hton,
|
||||
enum_binlog_command binlog_command,
|
||||
const char *query, uint query_length,
|
||||
const char *db, const char *table_name)
|
||||
{
|
||||
@ -2555,8 +2562,11 @@ void ha_binlog_log_query(THD *thd, enum_binlog_command binlog_command,
|
||||
b.query_length= query_length;
|
||||
b.db= db;
|
||||
b.table_name= table_name;
|
||||
plugin_foreach(thd, binlog_log_query_handlerton,
|
||||
MYSQL_STORAGE_ENGINE_PLUGIN, &b);
|
||||
if (hton == 0)
|
||||
plugin_foreach(thd, binlog_log_query_handlerton,
|
||||
MYSQL_STORAGE_ENGINE_PLUGIN, &b);
|
||||
else
|
||||
binlog_log_query_handlerton2(thd, hton, &b);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user