summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorunknown <lars@black.(none)>2006-12-08 23:41:29 +0100
committerunknown <lars@black.(none)>2006-12-08 23:41:29 +0100
commit26b6dc42910fb80ae13e88482ccc022257e65f25 (patch)
treea08468cc6f92f0ceab4eed8473537c51b45be1ff /sql/log.cc
parente54bbaa3fb8793905d37af808b9bee6a49df358a (diff)
parentb8ff601ebf2890bfe6bd2fe127aa33ae2b1bc90c (diff)
downloadmariadb-git-26b6dc42910fb80ae13e88482ccc022257e65f25.tar.gz
Merge mysql.com:/home/bkroot/mysql-5.1-new-rpl
into mysql.com:/home/bk/MERGE/mysql-5.1-merge client/mysqlbinlog.cc: Auto merged client/mysqldump.c: Auto merged config/ac-macros/ha_ndbcluster.m4: Auto merged configure.in: Auto merged include/my_global.h: Auto merged mysql-test/r/mysqldump.result: Auto merged mysql-test/r/rpl_timezone.result: Auto merged mysql-test/t/disabled.def: Auto merged sql/handler.cc: Auto merged sql/item_create.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/log.cc: Auto merged sql/log.h: Auto merged sql/log_event.h: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/rpl_injector.h: Auto merged sql/set_var.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_view.cc: Auto merged sql/table.cc: Auto merged mysql-test/t/mysqldump.test: Manual merge sql/log_event.cc: manual merge
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc30
1 files changed, 2 insertions, 28 deletions
diff --git a/sql/log.cc b/sql/log.cc
index 5a6130057ff..41e413e9ff7 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -87,18 +87,14 @@ char *make_default_log_name(char *buff,const char* log_ext)
class binlog_trx_data {
public:
binlog_trx_data()
-#ifdef HAVE_ROW_BASED_REPLICATION
: m_pending(0), before_stmt_pos(MY_OFF_T_UNDEF)
-#endif
{
trans_log.end_of_file= max_binlog_cache_size;
}
~binlog_trx_data()
{
-#ifdef HAVE_ROW_BASED_REPLICATION
DBUG_ASSERT(pending() == NULL);
-#endif
close_cached_file(&trans_log);
}
@@ -108,11 +104,7 @@ public:
bool empty() const
{
-#ifdef HAVE_ROW_BASED_REPLICATION
return pending() == NULL && my_b_tell(&trans_log) == 0;
-#else
- return my_b_tell(&trans_log) == 0;
-#endif
}
/*
@@ -121,10 +113,8 @@ public:
*/
void truncate(my_off_t pos)
{
-#ifdef HAVE_ROW_BASED_REPLICATION
delete pending();
set_pending(0);
-#endif
reinit_io_cache(&trans_log, WRITE_CACHE, pos, 0, 0);
}
@@ -135,13 +125,10 @@ public:
void reset() {
if (!empty())
truncate(0);
-#ifdef HAVE_ROW_BASED_REPLICATION
before_stmt_pos= MY_OFF_T_UNDEF;
-#endif
trans_log.end_of_file= max_binlog_cache_size;
}
-#ifdef HAVE_ROW_BASED_REPLICATION
Rows_log_event *pending() const
{
return m_pending;
@@ -151,12 +138,10 @@ public:
{
m_pending= pending;
}
-#endif
IO_CACHE trans_log; // The transaction cache
private:
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
Pending binrows event. This event is the event where the rows are
currently written.
@@ -168,7 +153,6 @@ public:
Binlog position before the start of the current statement.
*/
my_off_t before_stmt_pos;
-#endif
};
handlerton *binlog_hton;
@@ -1468,9 +1452,7 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data,
were, we would have to ensure that we're not ending a statement
inside a stored function.
*/
-#ifdef HAVE_ROW_BASED_REPLICATION
thd->binlog_flush_pending_rows_event(TRUE);
-#endif
/*
We write the transaction cache to the binary log if either we're
committing the entire transaction, or if we are doing an
@@ -1480,13 +1462,11 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data,
{
error= mysql_bin_log.write(thd, &trx_data->trans_log, end_ev);
trx_data->reset();
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
We need to step the table map version after writing the
transaction cache to disk.
*/
mysql_bin_log.update_table_map_version();
-#endif
statistic_increment(binlog_cache_use, &LOCK_status);
if (trans_log->disk_writes != 0)
{
@@ -1495,7 +1475,6 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data,
}
}
}
-#ifdef HAVE_ROW_BASED_REPLICATION
else
{
/*
@@ -1518,7 +1497,6 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data,
*/
mysql_bin_log.update_table_map_version();
}
-#endif
DBUG_RETURN(error);
}
@@ -3396,7 +3374,6 @@ int THD::binlog_setup_trx_data()
DBUG_RETURN(0);
}
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
Function to start a statement and optionally a transaction for the
binary log.
@@ -3605,7 +3582,6 @@ MYSQL_BIN_LOG::flush_and_set_pending_rows_event(THD *thd,
DBUG_RETURN(error);
}
-#endif /*HAVE_ROW_BASED_REPLICATION*/
/*
Write an event to the binary log
@@ -3638,11 +3614,9 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info)
we are inside a stored function, we do not end the statement since
this will close all tables on the slave.
*/
-#ifdef HAVE_ROW_BASED_REPLICATION
bool const end_stmt=
thd->prelocked_mode && thd->lex->requires_prelocking();
thd->binlog_flush_pending_rows_event(end_stmt);
-#endif /*HAVE_ROW_BASED_REPLICATION*/
pthread_mutex_lock(&LOCK_log);
@@ -3672,7 +3646,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info)
}
#endif /* HAVE_REPLICATION */
-#if defined(USING_TRANSACTIONS) && defined(HAVE_ROW_BASED_REPLICATION)
+#if defined(USING_TRANSACTIONS)
/*
Should we write to the binlog cache or to the binlog on disk?
Write to the binlog cache if:
@@ -3707,7 +3681,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info)
LOCK_log.
*/
}
-#endif /* USING_TRANSACTIONS && HAVE_ROW_BASED_REPLICATION */
+#endif /* USING_TRANSACTIONS */
DBUG_PRINT("info",("event type: %d",event_info->get_type_code()));
/*