Commit 3296a121 authored by unknown's avatar unknown
Browse files

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
Loading
Loading
Loading
Loading
+10 −12
Original line number Diff line number Diff line
@@ -1611,6 +1611,7 @@ innobase_report_binlog_offset_and_commit(
	trx->mysql_log_file_name = log_file_name;
	trx->mysql_log_offset = (ib_longlong)end_offset;

#ifdef HAVE_REPLICATION
        if (thd->variables.sync_replication) {
                /* 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
@@ -1628,7 +1629,7 @@ innobase_report_binlog_offset_and_commit(

                trx->repl_wait_binlog_pos = (ib_longlong)end_offset;
        }

#endif /* HAVE_REPLICATION */
	trx->flush_log_later = TRUE;

	innobase_commit(thd, trx_handle);
@@ -1681,10 +1682,7 @@ innobase_commit_complete(
                                /* out: 0 */
        THD*    thd)            /* in: user thread */
{
	struct timespec abstime;
	trx_t*	trx;
	int	cmp;
	int	ret;

        trx = (trx_t*) thd->ha_data[innobase_hton.slot];

@@ -1700,21 +1698,19 @@ innobase_commit_complete(
                trx_commit_complete_for_mysql(trx);
        }

        printf("Wait binlog name %s, repl state %lu\n",
                        trx->repl_wait_binlog_name,
                        (uint)innobase_repl_state);

#ifdef HAVE_REPLICATION
        if (thd->variables.sync_replication
            && trx->repl_wait_binlog_name
            && innobase_repl_state != 0) {

		struct timespec abstime;
		int	cmp;
		int	ret;

                /* In synchronous replication, let us wait until the MySQL
                replication has sent the relevant binlog segment to the
                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);
try_again:
                if (innobase_repl_state == 0) {
@@ -1809,10 +1805,11 @@ has been received in the slave! */

                goto try_again;
        }

#endif HAVE_REPLICATION
	return(0);
}

#ifdef HAVE_REPLICATION
/*********************************************************************
In synchronous replication, reports to InnoDB up to which binlog position
we have sent the binlog to the slave. Note that replication is synchronous
@@ -1908,6 +1905,7 @@ innobase_repl_report_sent_binlog(
                pthread_cond_broadcast(&innobase_repl_cond);
        }
}
#endif /* HAVE_REPLICATION */

/*********************************************************************
Rolls back a transaction or the latest SQL statement. */
+2 −0
Original line number Diff line number Diff line
@@ -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.",
   (gptr*) &opt_sync_frm, (gptr*) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0,
   0, 0, 0, 0},
#ifdef HAVE_REPLICATION
  {"sync-replication", OPT_SYNC_REPLICATION,
   "Enable synchronous replication.",
   (gptr*) &global_system_variables.sync_replication,
@@ -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,
   0, GET_ULONG, REQUIRED_ARG, 10, 0, ~0L, 0, 1, 0},
#endif /* HAVE_REPLICATION */
  {"table_cache", OPT_TABLE_CACHE,
   "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,