Commit 3296a121 authored by unknown's avatar unknown

ha_innodb.cc, mysqld.cc:

  Fix compilation error if HAVE_REPLICATION is not defined


sql/mysqld.cc:
  Fix compilation error if HAVE_REPLICATION is not defined
sql/ha_innodb.cc:
  Fix compilation error if HAVE_REPLICATION is not defined
parent 2ea24da8
...@@ -1611,6 +1611,7 @@ innobase_report_binlog_offset_and_commit( ...@@ -1611,6 +1611,7 @@ innobase_report_binlog_offset_and_commit(
trx->mysql_log_file_name = log_file_name; trx->mysql_log_file_name = log_file_name;
trx->mysql_log_offset = (ib_longlong)end_offset; trx->mysql_log_offset = (ib_longlong)end_offset;
#ifdef HAVE_REPLICATION
if (thd->variables.sync_replication) { if (thd->variables.sync_replication) {
/* Let us store the binlog file name and the position, so that /* Let us store the binlog file name and the position, so that
we know how long to wait for the binlog to the replicated to we know how long to wait for the binlog to the replicated to
...@@ -1628,7 +1629,7 @@ innobase_report_binlog_offset_and_commit( ...@@ -1628,7 +1629,7 @@ innobase_report_binlog_offset_and_commit(
trx->repl_wait_binlog_pos = (ib_longlong)end_offset; trx->repl_wait_binlog_pos = (ib_longlong)end_offset;
} }
#endif /* HAVE_REPLICATION */
trx->flush_log_later = TRUE; trx->flush_log_later = TRUE;
innobase_commit(thd, trx_handle); innobase_commit(thd, trx_handle);
...@@ -1681,10 +1682,7 @@ innobase_commit_complete( ...@@ -1681,10 +1682,7 @@ innobase_commit_complete(
/* out: 0 */ /* out: 0 */
THD* thd) /* in: user thread */ THD* thd) /* in: user thread */
{ {
struct timespec abstime;
trx_t* trx; trx_t* trx;
int cmp;
int ret;
trx = (trx_t*) thd->ha_data[innobase_hton.slot]; trx = (trx_t*) thd->ha_data[innobase_hton.slot];
...@@ -1700,21 +1698,19 @@ innobase_commit_complete( ...@@ -1700,21 +1698,19 @@ innobase_commit_complete(
trx_commit_complete_for_mysql(trx); trx_commit_complete_for_mysql(trx);
} }
printf("Wait binlog name %s, repl state %lu\n", #ifdef HAVE_REPLICATION
trx->repl_wait_binlog_name,
(uint)innobase_repl_state);
if (thd->variables.sync_replication if (thd->variables.sync_replication
&& trx->repl_wait_binlog_name && trx->repl_wait_binlog_name
&& innobase_repl_state != 0) { && innobase_repl_state != 0) {
struct timespec abstime;
int cmp;
int ret;
/* In synchronous replication, let us wait until the MySQL /* In synchronous replication, let us wait until the MySQL
replication has sent the relevant binlog segment to the replication has sent the relevant binlog segment to the
replication slave. */ replication slave. */
/* TODO: Make sure MySQL uses some way (TCP_NODELAY?) to ensure that the data
has been received in the slave! */
pthread_mutex_lock(&innobase_repl_cond_mutex); pthread_mutex_lock(&innobase_repl_cond_mutex);
try_again: try_again:
if (innobase_repl_state == 0) { if (innobase_repl_state == 0) {
...@@ -1809,10 +1805,11 @@ has been received in the slave! */ ...@@ -1809,10 +1805,11 @@ has been received in the slave! */
goto try_again; goto try_again;
} }
#endif HAVE_REPLICATION
return(0); return(0);
} }
#ifdef HAVE_REPLICATION
/********************************************************************* /*********************************************************************
In synchronous replication, reports to InnoDB up to which binlog position In synchronous replication, reports to InnoDB up to which binlog position
we have sent the binlog to the slave. Note that replication is synchronous we have sent the binlog to the slave. Note that replication is synchronous
...@@ -1908,6 +1905,7 @@ innobase_repl_report_sent_binlog( ...@@ -1908,6 +1905,7 @@ innobase_repl_report_sent_binlog(
pthread_cond_broadcast(&innobase_repl_cond); pthread_cond_broadcast(&innobase_repl_cond);
} }
} }
#endif /* HAVE_REPLICATION */
/********************************************************************* /*********************************************************************
Rolls back a transaction or the latest SQL statement. */ Rolls back a transaction or the latest SQL statement. */
......
...@@ -5495,6 +5495,7 @@ The minimum value for this variable is 4096.", ...@@ -5495,6 +5495,7 @@ The minimum value for this variable is 4096.",
{"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default.", {"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default.",
(gptr*) &opt_sync_frm, (gptr*) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0, (gptr*) &opt_sync_frm, (gptr*) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0,
0, 0, 0, 0}, 0, 0, 0, 0},
#ifdef HAVE_REPLICATION
{"sync-replication", OPT_SYNC_REPLICATION, {"sync-replication", OPT_SYNC_REPLICATION,
"Enable synchronous replication.", "Enable synchronous replication.",
(gptr*) &global_system_variables.sync_replication, (gptr*) &global_system_variables.sync_replication,
...@@ -5510,6 +5511,7 @@ The minimum value for this variable is 4096.", ...@@ -5510,6 +5511,7 @@ The minimum value for this variable is 4096.",
(gptr*) &global_system_variables.sync_replication_timeout, (gptr*) &global_system_variables.sync_replication_timeout,
(gptr*) &global_system_variables.sync_replication_timeout, (gptr*) &global_system_variables.sync_replication_timeout,
0, GET_ULONG, REQUIRED_ARG, 10, 0, ~0L, 0, 1, 0}, 0, GET_ULONG, REQUIRED_ARG, 10, 0, ~0L, 0, 1, 0},
#endif /* HAVE_REPLICATION */
{"table_cache", OPT_TABLE_CACHE, {"table_cache", OPT_TABLE_CACHE,
"The number of open tables for all threads.", (gptr*) &table_cache_size, "The number of open tables for all threads.", (gptr*) &table_cache_size,
(gptr*) &table_cache_size, 0, GET_ULONG, REQUIRED_ARG, 64, 1, 512*1024L, (gptr*) &table_cache_size, 0, GET_ULONG, REQUIRED_ARG, 64, 1, 512*1024L,
......
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