#!!! notice !!!
# Any small change to this file in the main branch
# should be done or reviewed by the maintainer!
-diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
---- a/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:37:45.516105468 +0900
-+++ b/storage/innobase/handler/ha_innodb.cc 2010-12-03 15:38:20.318952987 +0900
+--- a/storage/innobase/handler/ha_innodb.cc
++++ b/storage/innobase/handler/ha_innodb.cc
@@ -42,6 +42,8 @@
#pragma implementation // gcc: Class implementation
#endif
#include <sql_table.h> // explain_filename, nz2, EXPLAIN_PARTITIONS_AS_COMMENT,
// EXPLAIN_FILENAME_MAX_EXTRA_LENGTH
-@@ -52,6 +54,15 @@
- #include <mysql/innodb_priv.h>
+@@ -53,6 +55,15 @@
#include <mysql/psi/psi.h>
+ #include <my_sys.h>
+#ifdef MYSQL_SERVER
+#include <rpl_mi.h>
static my_bool innobase_rollback_on_timeout = FALSE;
static my_bool innobase_create_status_file = FALSE;
static my_bool innobase_stats_on_metadata = TRUE;
-@@ -2221,6 +2241,89 @@
+@@ -2282,6 +2302,89 @@
}
#endif /* DBUG_OFF */
/* Check that values don't overflow on 32-bit systems. */
if (sizeof(ulint) == 4) {
if (innobase_buffer_pool_size > UINT_MAX32) {
-@@ -2519,6 +2622,76 @@
+@@ -2580,6 +2683,76 @@
goto mem_free_and_error;
}
innobase_old_blocks_pct = buf_LRU_old_ratio_update(
innobase_old_blocks_pct, TRUE);
-@@ -2631,6 +2804,25 @@
+@@ -2693,6 +2866,25 @@
trx_t* trx) /*!< in: transaction handle */
{
if (trx_is_started(trx)) {
trx_commit_for_mysql(trx);
}
-@@ -10990,6 +11182,12 @@
+@@ -11130,6 +11322,12 @@
"The common part for InnoDB table spaces.",
NULL, NULL, NULL);
static MYSQL_SYSVAR_BOOL(doublewrite, innobase_use_doublewrite,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
"Enable InnoDB doublewrite buffer (enabled by default). "
-@@ -11450,6 +11648,7 @@
+@@ -11647,6 +11845,7 @@
MYSQL_SYSVAR(old_blocks_pct),
MYSQL_SYSVAR(old_blocks_time),
MYSQL_SYSVAR(open_files),
MYSQL_SYSVAR(rollback_on_timeout),
MYSQL_SYSVAR(stats_on_metadata),
MYSQL_SYSVAR(stats_sample_pages),
-diff -ruN a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h
---- a/storage/innobase/include/trx0sys.h 2010-11-03 07:01:13.000000000 +0900
-+++ b/storage/innobase/include/trx0sys.h 2010-12-03 15:38:20.321953297 +0900
+--- a/storage/innobase/include/trx0sys.h
++++ b/storage/innobase/include/trx0sys.h
@@ -53,6 +53,9 @@
extern ib_int64_t trx_sys_mysql_master_log_pos;
/* @} */
/** If this MySQL server uses binary logging, after InnoDB has been inited
and if it has done a crash recovery, we store the binlog file name and position
here. */
-@@ -287,7 +290,8 @@
+@@ -298,7 +301,8 @@
void
trx_sys_update_mysql_binlog_offset(
/*===============================*/
ib_int64_t offset, /*!< in: position in that log file */
ulint field, /*!< in: offset of the MySQL log info field in
the trx sys header */
-@@ -482,6 +486,7 @@
+@@ -493,6 +497,7 @@
@see trx_sys_mysql_master_log_name
@see trx_sys_mysql_bin_log_name */
#define TRX_SYS_MYSQL_LOG_NAME_LEN 512
/** Contents of TRX_SYS_MYSQL_LOG_MAGIC_N_FLD */
#define TRX_SYS_MYSQL_LOG_MAGIC_N 873422344
-@@ -491,6 +496,7 @@
+@@ -502,6 +507,7 @@
/** The offset of the MySQL replication info in the trx system header;
this contains the same fields as TRX_SYS_MYSQL_LOG_INFO below */
#define TRX_SYS_MYSQL_MASTER_LOG_INFO (UNIV_PAGE_SIZE - 2000)
/** The offset of the MySQL binlog offset info in the trx system header */
#define TRX_SYS_MYSQL_LOG_INFO (UNIV_PAGE_SIZE - 1000)
-diff -ruN a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
---- a/storage/innobase/include/trx0trx.h 2010-12-03 15:18:48.894955550 +0900
-+++ b/storage/innobase/include/trx0trx.h 2010-12-03 15:38:20.323953416 +0900
-@@ -569,6 +569,21 @@
+--- a/storage/innobase/include/trx0trx.h
++++ b/storage/innobase/include/trx0trx.h
+@@ -580,6 +580,20 @@
ib_int64_t mysql_log_offset;/* if MySQL binlog is used, this field
contains the end offset of the binlog
entry */
+ replication has processed */
+ const char* mysql_relay_log_file_name;
+ ib_int64_t mysql_relay_log_pos;
-+
- os_thread_id_t mysql_thread_id;/* id of the MySQL thread associated
- with this transaction object */
- ulint mysql_process_no;/* since in Linux, 'top' reports
-diff -ruN a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c
---- a/storage/innobase/trx/trx0sys.c 2010-11-03 07:01:13.000000000 +0900
-+++ b/storage/innobase/trx/trx0sys.c 2010-12-03 15:38:20.325956917 +0900
-@@ -75,13 +75,16 @@
+ /*------------------------------*/
+ ulint n_mysql_tables_in_use; /* number of Innobase tables
+ used in the processing of the current
+--- a/storage/innobase/trx/trx0sys.c
++++ b/storage/innobase/trx/trx0sys.c
+@@ -76,13 +76,16 @@
file name and position here. */
/* @{ */
/** Master binlog file name */
/** If this MySQL server uses binary logging, after InnoDB has been inited
and if it has done a crash recovery, we store the binlog file name and position
here. */
-@@ -683,23 +686,25 @@
+@@ -684,23 +687,25 @@
void
trx_sys_update_mysql_binlog_offset(
/*===============================*/
if (mach_read_from_4(sys_header + field
+ TRX_SYS_MYSQL_LOG_MAGIC_N_FLD)
!= TRX_SYS_MYSQL_LOG_MAGIC_N) {
-@@ -821,13 +826,26 @@
+@@ -822,13 +827,26 @@
+ TRX_SYS_MYSQL_LOG_OFFSET_LOW),
sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
+ TRX_SYS_MYSQL_LOG_NAME);
trx_sys_mysql_master_log_pos
= (((ib_int64_t) mach_read_from_4(
-@@ -836,6 +854,19 @@
+@@ -837,6 +855,19 @@
+ ((ib_int64_t) mach_read_from_4(
sys_header + TRX_SYS_MYSQL_MASTER_LOG_INFO
+ TRX_SYS_MYSQL_LOG_OFFSET_LOW));
mtr_commit(&mtr);
}
-diff -ruN a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c
---- a/storage/innobase/trx/trx0trx.c 2010-12-03 15:37:45.549028990 +0900
-+++ b/storage/innobase/trx/trx0trx.c 2010-12-03 15:38:20.328957217 +0900
-@@ -136,6 +136,10 @@
+--- a/storage/innobase/trx/trx0trx.c
++++ b/storage/innobase/trx/trx0trx.c
+@@ -138,6 +138,10 @@
trx->mysql_log_file_name = NULL;
trx->mysql_log_offset = 0;
mutex_create(trx_undo_mutex_key, &trx->undo_mutex, SYNC_TRX_UNDO);
-@@ -766,6 +770,7 @@
+@@ -820,6 +824,7 @@
{
mtr_t mtr;
trx_rseg_t* rseg;
ut_ad(!mutex_own(&kernel_mutex));
-@@ -819,8 +824,12 @@
+@@ -873,8 +878,12 @@
if (trx->mysql_log_file_name
&& trx->mysql_log_file_name[0] != '\0') {
trx->mysql_log_file_name,
trx->mysql_log_offset,
TRX_SYS_MYSQL_LOG_INFO, &mtr);
-@@ -828,6 +837,27 @@
+@@ -882,6 +891,27 @@
trx->mysql_log_file_name = NULL;
}