summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2006-02-06 11:47:12 +0100
committerunknown <tomas@poseidon.ndb.mysql.com>2006-02-06 11:47:12 +0100
commitb545f6850031c6dc218f0569033cb65a9d6d156c (patch)
tree47e921136193b8b865a42ac9870f998a239a51c4 /sql/handler.cc
parent6c34cbcab8f0ef1571277b0aea907e8bd46cbf9e (diff)
downloadmariadb-git-b545f6850031c6dc218f0569033cb65a9d6d156c.tar.gz
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
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc24
1 files changed, 17 insertions, 7 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index b40a40684fe..24e9f6aa1e2 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -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