summaryrefslogtreecommitdiff
path: root/sql/ha_innodb.cc
diff options
context:
space:
mode:
authorunknown <jplindst@t41.(none)>2004-06-08 15:38:22 +0300
committerunknown <jplindst@t41.(none)>2004-06-08 15:38:22 +0300
commit9ce36bdf29ef5dcebf9a67627132c01904e9256b (patch)
treee7e2686f09e9741422121d2e56836162c139427a /sql/ha_innodb.cc
parent1c7ab079a789db99a86d6c63d883a501c0f5aa16 (diff)
downloadmariadb-git-9ce36bdf29ef5dcebf9a67627132c01904e9256b.tar.gz
Added function innobase_store_binlog_offset_and_flush_log requested by Guilhem
to ha_innodb.cc and ha_innodb.h sql/ha_innodb.cc: /*********************************************************************** This function stores binlog offset and flushes logs */ void innobase_store_binlog_offset_and_flush_log( /*=============================*/ char *binlog_name, /* in: binlog name */ longlong offset /* in: binlog offset */ ); BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r--sql/ha_innodb.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 36202efcc02..619c05711c4 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -66,6 +66,7 @@ extern "C" {
#include "../innobase/include/trx0roll.h"
#include "../innobase/include/trx0trx.h"
#include "../innobase/include/trx0sys.h"
+#include "../innobase/include/mtr0mtr.h"
#include "../innobase/include/row0ins.h"
#include "../innobase/include/row0mysql.h"
#include "../innobase/include/row0sel.h"
@@ -5182,4 +5183,36 @@ ha_innobase::get_auto_increment()
return(nr);
}
+/***********************************************************************
+This function stores binlog offset and flushes logs */
+
+void
+innobase_store_binlog_offset_and_flush_log(
+/*=============================*/
+ char *binlog_name, /* in: binlog name */
+ longlong offset /* in: binlog offset */
+)
+{
+ mtr_t mtr;
+
+ assert(binlog_name != NULL);
+
+ /* Start a mini-transaction */
+ mtr_start_noninline(&mtr);
+
+ /* Update the latest MySQL binlog name and offset info
+ in trx sys header */
+
+ trx_sys_update_mysql_binlog_offset(
+ binlog_name,
+ offset,
+ TRX_SYS_MYSQL_LOG_INFO, &mtr);
+
+ /* Commits the mini-transaction */
+ mtr_commit(&mtr);
+
+ /* Syncronous flush of the log buffer to disk */
+ log_buffer_flush_to_disk();
+}
+
#endif /* HAVE_INNOBASE_DB */