Commit 8a1e1f61 authored by Kristian Nielsen's avatar Kristian Nielsen

MDEV-34705: Binlog in Engine: Also binlog standalone (eg. DDL) in the engine

Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
parent 6fa42d1a
......@@ -1530,8 +1530,8 @@ struct handlerton
void *optimizer_costs; /* Costs are stored here */
/* Optional implementation of binlog in the engine. */
bool (*binlog_write_direct)(IO_CACHE *cache, size_t main_size);
handler_binlog_reader * (*get_binlog_reader)();
int (*binlog_data)(uchar *data, size_t len);
/*
Optional clauses in the CREATE/ALTER TABLE
......
This diff is collapsed.
......@@ -1105,6 +1105,7 @@ class MYSQL_BIN_LOG: public TC_LOG, private Event_log
void set_status_variables(THD *thd);
bool is_xidlist_idle();
bool write_gtid_event(THD *thd, IO_CACHE *dest, bool standalone,
bool direct_write,
bool is_transactional, uint64 commit_id,
bool has_xid= false, bool ro_1pc= false);
int read_state_from_file();
......
......@@ -5409,7 +5409,8 @@ static int init_server_components()
opt_binlog_storage_engine);
unireg_abort(1);
}
if (!opt_binlog_engine_hton->get_binlog_reader)
if (!opt_binlog_engine_hton->binlog_write_direct ||
!opt_binlog_engine_hton->get_binlog_reader)
{
sql_print_error("Engine %s does not support --innodb-binlog-engine",
opt_binlog_storage_engine);
......
......@@ -4408,3 +4408,16 @@ innodb_get_binlog_reader()
{
return new ha_innodb_binlog_reader();
}
bool
innobase_binlog_write_direct(IO_CACHE *cache, size_t main_size)
{
mtr_t mtr;
mtr.start();
fsp_binlog_write_cache(cache, main_size, &mtr);
mtr.commit();
/* ToDo: Should we sync the log here? Maybe depending on an extra bool parameter? */
/* ToDo: Presumably fsp_binlog_write_cache() should be able to fail in some cases? Then return any such error to the caller. */
return false;
}
......@@ -4093,6 +4093,7 @@ static int innodb_init(void* p)
= innodb_prepare_commit_versioned;
innobase_hton->update_optimizer_costs= innobase_update_optimizer_costs;
innobase_hton->binlog_write_direct= innobase_binlog_write_direct;
innobase_hton->get_binlog_reader= innodb_get_binlog_reader;
innodb_remember_check_sysvar_funcs();
......
......@@ -582,6 +582,7 @@ void fsp_shrink_temp_space();
extern void fsp_binlog_test(const uchar *data, uint32_t len);
extern void fsp_binlog_trx(trx_t *trx, mtr_t *mtr);
class handler_binlog_reader;
extern bool innobase_binlog_write_direct(IO_CACHE *cache, size_t main_size);
extern handler_binlog_reader *innodb_get_binlog_reader();
extern void fsp_binlog_close();
......
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