summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <cbell/Chuck@suse.vabb.com>2006-12-07 09:18:35 -0500
committerunknown <cbell/Chuck@suse.vabb.com>2006-12-07 09:18:35 -0500
commit85a8f7c7a9bf8e067500a78899874f1298e2bdf4 (patch)
treec08b6d74a80b3c187b4d906a036d251117a9fc60 /sql
parentd3f711fafc4928f941b8fc2fbceed5109b5d8bde (diff)
downloadmariadb-git-85a8f7c7a9bf8e067500a78899874f1298e2bdf4.tar.gz
WL#3618 - Remove HAVE_ROW_BASED_REPLICATION from source code.
Please see worklog for details on files changed. BitKeeper/deleted/.del-have_row_based.require: Delete: mysql-test/r/have_row_based.require BitKeeper/deleted/.del-not_row_based.require: Delete: mysql-test/r/not_row_based.require BitKeeper/deleted/.del-have_row_based.inc: Delete: mysql-test/include/have_row_based.inc BitKeeper/deleted/.del-not_row_based.inc: Delete: mysql-test/include/not_row_based.inc BitKeeper/deleted/.del-replication.m4: Delete: config/ac-macros/replication.m4
Diffstat (limited to 'sql')
-rw-r--r--sql/CMakeLists.txt3
-rw-r--r--sql/handler.cc8
-rw-r--r--sql/item_create.cc4
-rw-r--r--sql/log.cc30
-rw-r--r--sql/log.h2
-rw-r--r--sql/log_event.cc17
-rw-r--r--sql/log_event.h10
-rw-r--r--sql/mysql_priv.h3
-rw-r--r--sql/mysqld.cc40
-rw-r--r--sql/rpl_injector.cc3
-rw-r--r--sql/rpl_injector.h2
-rw-r--r--sql/set_var.cc9
-rw-r--r--sql/set_var.h4
-rw-r--r--sql/sp_head.cc2
-rw-r--r--sql/sp_head.h2
-rw-r--r--sql/sql_base.cc6
-rw-r--r--sql/sql_class.cc17
-rw-r--r--sql/sql_class.h15
-rw-r--r--sql/sql_insert.cc9
-rw-r--r--sql/sql_lex.cc2
-rw-r--r--sql/sql_lex.h2
-rw-r--r--sql/sql_load.cc2
-rw-r--r--sql/sql_view.cc2
-rw-r--r--sql/table.cc5
24 files changed, 13 insertions, 186 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 4cdc4c01c4e..69754924b4d 100644
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -22,8 +22,7 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc
${PROJECT_SOURCE_DIR}/include/sql_state.h
PROPERTIES GENERATED 1)
-ADD_DEFINITIONS(-DHAVE_ROW_BASED_REPLICATION -DMYSQL_SERVER
- -D_CONSOLE -DHAVE_DLOPEN)
+ADD_DEFINITIONS(-DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN)
ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
diff --git a/sql/handler.cc b/sql/handler.cc
index f16876f2ffd..8d4f4aec428 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -3455,7 +3455,6 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat)
- table is not mysql.event
*/
-#ifdef HAVE_ROW_BASED_REPLICATION
/* The Sun compiler cannot instantiate the template below if this is
declared static, but it works by putting it into an anonymous
namespace. */
@@ -3608,7 +3607,6 @@ namespace
binlog_log_row<Update_rows_log_event>(TABLE *, const byte *, const byte *);
}
-#endif /* HAVE_ROW_BASED_REPLICATION */
int handler::ha_external_lock(THD *thd, int lock_type)
{
@@ -3649,10 +3647,8 @@ int handler::ha_write_row(byte *buf)
int error;
if (unlikely(error= write_row(buf)))
return error;
-#ifdef HAVE_ROW_BASED_REPLICATION
if (unlikely(error= binlog_log_row<Write_rows_log_event>(table, 0, buf)))
return error;
-#endif
return 0;
}
@@ -3668,10 +3664,8 @@ int handler::ha_update_row(const byte *old_data, byte *new_data)
if (unlikely(error= update_row(old_data, new_data)))
return error;
-#ifdef HAVE_ROW_BASED_REPLICATION
if (unlikely(error= binlog_log_row<Update_rows_log_event>(table, old_data, new_data)))
return error;
-#endif
return 0;
}
@@ -3680,10 +3674,8 @@ int handler::ha_delete_row(const byte *buf)
int error;
if (unlikely(error= delete_row(buf)))
return error;
-#ifdef HAVE_ROW_BASED_REPLICATION
if (unlikely(error= binlog_log_row<Delete_rows_log_event>(table, buf, 0)))
return error;
-#endif
return 0;
}
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 7722ce28d4a..05802a22b9c 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -2288,9 +2288,7 @@ Create_udf_func::create(THD *thd, udf_func *udf, List<Item> *item_list)
if (item_list != NULL)
arg_count= item_list->elements;
-#ifdef HAVE_ROW_BASED_REPLICATION
thd->lex->binlog_row_based_if_mixed= TRUE;
-#endif
DBUG_ASSERT( (udf->type == UDFTYPE_FUNCTION)
|| (udf->type == UDFTYPE_AGGREGATE));
@@ -4446,9 +4444,7 @@ Create_func_uuid Create_func_uuid::s_singleton;
Item*
Create_func_uuid::create(THD *thd)
{
-#ifdef HAVE_ROW_BASED_REPLICATION
thd->lex->binlog_row_based_if_mixed= TRUE;
-#endif
return new (thd->mem_root) Item_func_uuid();
}
diff --git a/sql/log.cc b/sql/log.cc
index 620445aecfa..cfca0a94ff0 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);
}
@@ -3385,7 +3363,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.
@@ -3593,7 +3570,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
@@ -3626,11 +3602,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);
@@ -3660,7 +3634,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:
@@ -3695,7 +3669,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()));
/*
diff --git a/sql/log.h b/sql/log.h
index f39b52f5db2..66a388d7017 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -601,14 +601,12 @@ public:
enum enum_binlog_format {
BINLOG_FORMAT_STMT= 0, // statement-based
-#ifdef HAVE_ROW_BASED_REPLICATION
BINLOG_FORMAT_ROW= 1, // row_based
/*
statement-based except for cases where only row-based can work (UUID()
etc):
*/
BINLOG_FORMAT_MIXED= 2,
-#endif
/*
This value is last, after the end of binlog_format_typelib: it has no
corresponding cell in this typelib. We use this value to be able to know if
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 7bb4a72edfa..4822daf5fe8 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -994,7 +994,7 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
case FORMAT_DESCRIPTION_EVENT:
ev = new Format_description_log_event(buf, event_len, description_event);
break;
-#if defined(HAVE_REPLICATION) && defined(HAVE_ROW_BASED_REPLICATION)
+#if defined(HAVE_REPLICATION)
case WRITE_ROWS_EVENT:
ev = new Write_rows_log_event(buf, event_len, description_event);
break;
@@ -5287,8 +5287,6 @@ char* sql_ex_info::init(char* buf,char* buf_end,bool use_new_format)
}
-#ifdef HAVE_ROW_BASED_REPLICATION
-
/**************************************************************************
Rows_log_event member functions
**************************************************************************/
@@ -5553,8 +5551,8 @@ unpack_row(RELAY_LOG_INFO *rli,
if (bitmap_is_set(cols, field_ptr - begin_ptr))
{
- DBUG_ASSERT(table->record[0] <= f->ptr);
- DBUG_ASSERT(f->ptr < table->record[0] + table->s->reclength + (f->pack_length_in_rec() == 0));
+ DBUG_ASSERT((char *)table->record[0] <= f->ptr);
+ DBUG_ASSERT(f->ptr < (char *)table->record[0] + table->s->reclength + (f->pack_length_in_rec() == 0));
f->move_field_offset(offset);
DBUG_PRINT("info", ("unpacking column '%s' to 0x%lx", f->field_name, f->ptr));
@@ -6838,8 +6836,8 @@ static int find_and_fetch_row(TABLE *table, byte *key)
trigger false warnings.
*/
#ifndef HAVE_purify
- DBUG_DUMP("table->record[0]", table->record[0], table->s->reclength);
- DBUG_DUMP("table->record[1]", table->record[1], table->s->reclength);
+ DBUG_DUMP("table->record[0]", (char *)table->record[0], table->s->reclength);
+ DBUG_DUMP("table->record[1]", (char *)table->record[1], table->s->reclength);
#endif
/*
@@ -6865,8 +6863,8 @@ static int find_and_fetch_row(TABLE *table, byte *key)
trigger false warnings.
*/
#ifndef HAVE_purify
- DBUG_DUMP("table->record[0]", table->record[0], table->s->reclength);
- DBUG_DUMP("table->record[1]", table->record[1], table->s->reclength);
+ DBUG_DUMP("table->record[0]", (char *)table->record[0], table->s->reclength);
+ DBUG_DUMP("table->record[1]", (char *)table->record[1], table->s->reclength);
#endif
/*
Below is a minor "optimization". If the key (i.e., key number
@@ -7279,4 +7277,3 @@ void Update_rows_log_event::print(FILE *file,
}
#endif
-#endif /* defined(HAVE_ROW_BASED_REPLICATION) */
diff --git a/sql/log_event.h b/sql/log_event.h
index c3f015e723c..8ffbfa7743c 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -1689,8 +1689,6 @@ public:
#endif
char *str_to_hex(char *to, const char *from, uint len);
-#ifdef HAVE_ROW_BASED_REPLICATION
-
/*****************************************************************************
Table map log event class
@@ -2019,7 +2017,7 @@ public:
Write_rows_log_event(const char *buf, uint event_len,
const Format_description_log_event *description_event);
#endif
-#if !defined(MYSQL_CLIENT) && defined(HAVE_ROW_BASED_REPLICATION)
+#if !defined(MYSQL_CLIENT)
static bool binlog_row_logging_function(THD *thd, TABLE *table,
bool is_transactional,
MY_BITMAP *cols,
@@ -2084,7 +2082,7 @@ public:
const Format_description_log_event *description_event);
#endif
-#if !defined(MYSQL_CLIENT) && defined(HAVE_ROW_BASED_REPLICATION)
+#if !defined(MYSQL_CLIENT)
static bool binlog_row_logging_function(THD *thd, TABLE *table,
bool is_transactional,
MY_BITMAP *cols,
@@ -2154,7 +2152,7 @@ public:
Delete_rows_log_event(const char *buf, uint event_len,
const Format_description_log_event *description_event);
#endif
-#if !defined(MYSQL_CLIENT) && defined(HAVE_ROW_BASED_REPLICATION)
+#if !defined(MYSQL_CLIENT)
static bool binlog_row_logging_function(THD *thd, TABLE *table,
bool is_transactional,
MY_BITMAP *cols,
@@ -2188,6 +2186,4 @@ private:
#endif
};
-#endif /* HAVE_ROW_BASED_REPLICATION */
-
#endif /* _log_event_h */
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index e30da1f2f0b..63303b3e04d 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -1557,9 +1557,7 @@ extern ulong query_buff_size, thread_stack;
extern ulong max_prepared_stmt_count, prepared_stmt_count;
extern ulong binlog_cache_size, max_binlog_cache_size, open_files_limit;
extern ulong max_binlog_size, max_relay_log_size;
-#ifdef HAVE_ROW_BASED_REPLICATION
extern ulong opt_binlog_rows_event_max_size;
-#endif
extern ulong rpl_recovery_rank, thread_cache_size;
extern ulong back_log;
extern ulong specialflag, current_pid;
@@ -1664,7 +1662,6 @@ extern handlerton *partition_hton;
extern handlerton *myisam_hton;
extern handlerton *heap_hton;
-extern SHOW_COMP_OPTION have_row_based_replication;
extern SHOW_COMP_OPTION have_openssl, have_symlink, have_dlopen;
extern SHOW_COMP_OPTION have_query_cache;
extern SHOW_COMP_OPTION have_geometry, have_rtree_keys;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index d5d155d0072..84ed32f72f4 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -28,9 +28,7 @@
#include "../storage/myisam/ha_myisam.h"
-#ifdef HAVE_ROW_BASED_REPLICATION
#include "rpl_injector.h"
-#endif
#ifdef WITH_INNOBASE_STORAGE_ENGINE
#define OPT_INNODB_DEFAULT 1
@@ -437,12 +435,8 @@ volatile bool mqh_used = 0;
my_bool opt_noacl;
my_bool sp_automatic_privileges= 1;
-#ifdef HAVE_ROW_BASED_REPLICATION
ulong opt_binlog_rows_event_max_size;
const char *binlog_format_names[]= {"STATEMENT", "ROW", "MIXED", NullS};
-#else
-const char *binlog_format_names[]= {"STATEMENT", NullS};
-#endif
TYPELIB binlog_format_typelib=
{ array_elements(binlog_format_names)-1,"",
binlog_format_names, NULL };
@@ -554,7 +548,6 @@ CHARSET_INFO *system_charset_info, *files_charset_info ;
CHARSET_INFO *national_charset_info, *table_alias_charset;
CHARSET_INFO *character_set_filesystem;
-SHOW_COMP_OPTION have_row_based_replication;
SHOW_COMP_OPTION have_openssl, have_symlink, have_dlopen, have_query_cache;
SHOW_COMP_OPTION have_geometry, have_rtree_keys;
SHOW_COMP_OPTION have_crypt, have_compress;
@@ -1162,9 +1155,7 @@ void clean_up(bool print_message)
what they have that is dependent on the binlog
*/
ha_binlog_end(current_thd);
-#ifdef HAVE_ROW_BASED_REPLICATION
injector::free_instance();
-#endif
mysql_bin_log.cleanup();
#ifdef HAVE_REPLICATION
@@ -3149,11 +3140,7 @@ with --log-bin instead.");
}
if (global_system_variables.binlog_format == BINLOG_FORMAT_UNSPEC)
{
-#if defined(HAVE_ROW_BASED_REPLICATION)
global_system_variables.binlog_format= BINLOG_FORMAT_MIXED;
-#else
- global_system_variables.binlog_format= BINLOG_FORMAT_STMT;
-#endif
}
/* Check that we have not let the format to unspecified at this point */
@@ -4691,9 +4678,7 @@ enum options_mysqld
#ifndef DBUG_OFF
OPT_BINLOG_SHOW_XID,
#endif
-#ifdef HAVE_ROW_BASED_REPLICATION
OPT_BINLOG_ROWS_EVENT_MAX_SIZE,
-#endif
OPT_WANT_CORE, OPT_CONCURRENT_INSERT,
OPT_MEMLOCK, OPT_MYISAM_RECOVER,
OPT_REPLICATE_REWRITE_DB, OPT_SERVER_ID,
@@ -4903,7 +4888,6 @@ struct my_option my_long_options[] =
(gptr*) &my_bind_addr_str, (gptr*) &my_bind_addr_str, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"binlog_format", OPT_BINLOG_FORMAT,
-#ifdef HAVE_ROW_BASED_REPLICATION
"Tell the master the form of binary logging to use: either 'row' for "
"row-based binary logging, or 'statement' for statement-based binary "
"logging, or 'mixed'. 'mixed' is statement-based binary logging except "
@@ -4913,17 +4897,8 @@ struct my_option my_long_options[] =
#ifdef HAVE_NDB_BINLOG
"If ndbcluster is enabled, the default is 'row'."
#endif
-#else
- "Tell the master the form of binary logging to use: this build "
- "supports only statement-based binary logging, so only 'statement' is "
- "a legal value."
-#endif
, 0, 0, 0, GET_STR, REQUIRED_ARG,
-#ifdef HAVE_ROW_BASED_REPLICATION
BINLOG_FORMAT_MIXED
-#else
- BINLOG_FORMAT_STMT
-#endif
, 0, 0, 0, 0, 0 },
{"binlog-do-db", OPT_BINLOG_DO_DB,
"Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned.",
@@ -4931,7 +4906,6 @@ struct my_option my_long_options[] =
{"binlog-ignore-db", OPT_BINLOG_IGNORE_DB,
"Tells the master that updates to the given database should not be logged tothe binary log.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#ifdef HAVE_ROW_BASED_REPLICATION
{"binlog-row-event-max-size", OPT_BINLOG_ROWS_EVENT_MAX_SIZE,
"The maximum size of a row-based binary log event in bytes. Rows will be "
"grouped into events smaller than this size if possible. "
@@ -4943,7 +4917,6 @@ struct my_option my_long_options[] =
/* sub_size */ 0, /* block_size */ 256,
/* app_type */ 0
},
-#endif
{"bootstrap", OPT_BOOTSTRAP, "Used by mysql installation scripts.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-set-client-handshake", OPT_CHARACTER_SET_CLIENT_HANDSHAKE,
@@ -5204,11 +5177,9 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
"If equal to 0 (the default), then when --log-bin is used, creation of "
"a stored function (or trigger) is allowed only to users having the SUPER privilege "
"and only if this stored function (trigger) may not break binary logging."
-#ifdef HAVE_ROW_BASED_REPLICATION
"Note that if ALL connections to this server ALWAYS use row-based binary "
"logging, the security issues do not exist and the binary logging cannot "
"break, so you can safely set this to 1."
-#endif
,(gptr*) &trust_function_creators, (gptr*) &trust_function_creators, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"log-error", OPT_ERROR_LOG_FILE, "Error log file.",
@@ -7056,11 +7027,6 @@ static void mysql_init_variables(void)
#else
have_partition_db= SHOW_OPTION_NO;
#endif
-#ifdef HAVE_ROW_BASED_REPLICATION
- have_row_based_replication= SHOW_OPTION_YES;
-#else
- have_row_based_replication= SHOW_OPTION_NO;
-#endif
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
have_ndbcluster=SHOW_OPTION_DISABLED;
global_system_variables.ndb_index_stat_enable=FALSE;
@@ -7291,7 +7257,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
int id;
if ((id= find_type(argument, &binlog_format_typelib, 2)) <= 0)
{
-#ifdef HAVE_ROW_BASED_REPLICATION
fprintf(stderr,
"Unknown binary log format: '%s' "
"(should be one of '%s', '%s', '%s')\n",
@@ -7299,11 +7264,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
binlog_format_names[BINLOG_FORMAT_STMT],
binlog_format_names[BINLOG_FORMAT_ROW],
binlog_format_names[BINLOG_FORMAT_MIXED]);
-#else
- fprintf(stderr,
- "Unknown binary log format: '%s' (only legal value is '%s')\n",
- argument, binlog_format_names[BINLOG_FORMAT_STMT]);
-#endif
exit(1);
}
global_system_variables.binlog_format= id-1;
diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc
index 3a0fca4dfa5..eba6d24d557 100644
--- a/sql/rpl_injector.cc
+++ b/sql/rpl_injector.cc
@@ -17,7 +17,6 @@
#include "mysql_priv.h"
#include "rpl_injector.h"
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
injector::transaction - member definitions
@@ -191,5 +190,3 @@ void injector::new_trans(THD *thd, injector::transaction *ptr)
DBUG_VOID_RETURN;
}
-
-#endif
diff --git a/sql/rpl_injector.h b/sql/rpl_injector.h
index 48df30e8ac8..95f93f0681b 100644
--- a/sql/rpl_injector.h
+++ b/sql/rpl_injector.h
@@ -21,7 +21,6 @@
/* Pull in 'byte', 'my_off_t', and 'uint32' */
#include <my_global.h>
-#ifdef HAVE_ROW_BASED_REPLICATION
#include <my_bitmap.h>
/* Forward declarations */
@@ -331,5 +330,4 @@ private:
*/
};
-#endif /* HAVE_ROW_BASED_REPLICATION */
#endif /* INJECTOR_H */
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 5590e71c810..f2a0313dd93 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -682,7 +682,6 @@ sys_var_have_variable sys_have_query_cache("have_query_cache",
&have_query_cache);
sys_var_have_variable sys_have_rtree_keys("have_rtree_keys", &have_rtree_keys);
sys_var_have_variable sys_have_symlink("have_symlink", &have_symlink);
-sys_var_have_variable sys_have_row_based_replication("have_row_based_replication",&have_row_based_replication);
/* Global read-only variable describing server license */
sys_var_const_str sys_license("license", STRINGIFY_ARG(LICENSE));
@@ -809,7 +808,6 @@ SHOW_VAR init_vars[]= {
{sys_have_openssl.name, (char*) &have_openssl, SHOW_HAVE},
{sys_have_partition_db.name,(char*) &have_partition_db, SHOW_HAVE},
{sys_have_query_cache.name, (char*) &have_query_cache, SHOW_HAVE},
- {sys_have_row_based_replication.name, (char*) &have_row_based_replication, SHOW_HAVE},
{sys_have_rtree_keys.name, (char*) &have_rtree_keys, SHOW_HAVE},
{sys_have_symlink.name, (char*) &have_symlink, SHOW_HAVE},
{"init_connect", (char*) &sys_init_connect, SHOW_SYS},
@@ -1324,10 +1322,6 @@ bool sys_var_thd_binlog_format::is_readonly() const
If we don't have row-based replication compiled in, the variable
is always read-only.
*/
-#ifndef HAVE_ROW_BASED_REPLICATION
- my_error(ER_RBR_NOT_AVAILABLE, MYF(0));
- return 1;
-#else
if ((thd->variables.binlog_format == BINLOG_FORMAT_ROW) &&
thd->temporary_tables)
{
@@ -1352,16 +1346,13 @@ bool sys_var_thd_binlog_format::is_readonly() const
return 1;
}
#endif /* HAVE_NDB_BINLOG */
-#endif /* HAVE_ROW_BASED_REPLICATION */
return sys_var_thd_enum::is_readonly();
}
void fix_binlog_format_after_update(THD *thd, enum_var_type type)
{
-#ifdef HAVE_ROW_BASED_REPLICATION
thd->reset_current_stmt_binlog_row_based();
-#endif /*HAVE_ROW_BASED_REPLICATION*/
}
diff --git a/sql/set_var.h b/sql/set_var.h
index 01669b378e1..6135fdee159 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -940,9 +940,7 @@ public:
}
};
-#ifdef HAVE_ROW_BASED_REPLICATION
extern void fix_binlog_format_after_update(THD *thd, enum_var_type type);
-#endif
class sys_var_thd_binlog_format :public sys_var_thd_enum
{
@@ -950,9 +948,7 @@ public:
sys_var_thd_binlog_format(const char *name_arg, ulong SV::*offset_arg)
:sys_var_thd_enum(name_arg, offset_arg,
&binlog_format_typelib
-#ifdef HAVE_ROW_BASED_REPLICATION
, fix_binlog_format_after_update
-#endif
)
{};
bool is_readonly() const;
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 48c24248bc5..dfce2879ea7 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1850,7 +1850,6 @@ sp_head::restore_lex(THD *thd)
oldlex->next_state= sublex->next_state;
oldlex->trg_table_fields.push_back(&sublex->trg_table_fields);
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
If this substatement needs row-based, the entire routine does too (we
cannot switch from statement-based to row-based only for this
@@ -1858,7 +1857,6 @@ sp_head::restore_lex(THD *thd)
*/
if (sublex->binlog_row_based_if_mixed)
m_flags|= BINLOG_ROW_BASED_IF_MIXED;
-#endif
/*
Add routines which are used by statement to respective set for
diff --git a/sql/sp_head.h b/sql/sp_head.h
index 41ed5256840..f1efb1d195e 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -362,7 +362,6 @@ public:
*/
void propagate_attributes(LEX *lex)
{
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
If this routine needs row-based binary logging, the entire top statement
too (we cannot switch from statement-based to row-based only for this
@@ -371,7 +370,6 @@ public:
*/
if (m_flags & BINLOG_ROW_BASED_IF_MIXED)
lex->binlog_row_based_if_mixed= TRUE;
-#endif
}
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 28bc1e9dcbf..76280471a99 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1064,9 +1064,7 @@ void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived)
handled either before writing a query log event (inside
binlog_query()) or when preparing a pending event.
*/
-#ifdef HAVE_ROW_BASED_REPLICATION
thd->binlog_flush_pending_rows_event(TRUE);
-#endif /*HAVE_ROW_BASED_REPLICATION*/
mysql_unlock_tables(thd, thd->lock);
thd->lock=0;
}
@@ -3312,13 +3310,11 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
*need_reopen= FALSE;
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
CREATE ... SELECT UUID() locks no tables, we have to test here.
*/
if (thd->lex->binlog_row_based_if_mixed)
thd->set_current_stmt_binlog_row_based_if_mixed();
-#endif /*HAVE_ROW_BASED_REPLICATION*/
if (!tables && !thd->lex->requires_prelocking())
DBUG_RETURN(0);
@@ -3350,7 +3346,6 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
{
thd->in_lock_tables=1;
thd->options|= OPTION_TABLE_LOCK;
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
If we have >= 2 different tables to update with auto_inc columns,
statement-based binlogging won't work. We can solve this problem in
@@ -3362,7 +3357,6 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen)
thd->lex->binlog_row_based_if_mixed= TRUE;
thd->set_current_stmt_binlog_row_based_if_mixed();
}
-#endif
}
if (! (thd->lock= mysql_lock_tables(thd, start, (uint) (ptr - start),
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 20acb28bc77..5f4a00be710 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -204,9 +204,7 @@ THD::THD()
Open_tables_state(refresh_version), rli_fake(0),
lock_id(&main_lock_id),
user_time(0), in_sub_stmt(0),
-#ifdef HAVE_ROW_BASED_REPLICATION
binlog_table_maps(0),
-#endif /*HAVE_ROW_BASED_REPLICATION*/
global_read_lock(0), is_fatal_error(0),
rand_used(0), time_zone_used(0),
arg_of_last_insert_id_function(FALSE),
@@ -267,9 +265,7 @@ THD::THD()
system_thread= NON_SYSTEM_THREAD;
cleanup_done= abort_on_warning= no_warnings_for_error= 0;
peer_port= 0; // For SHOW PROCESSLIST
-#ifdef HAVE_ROW_BASED_REPLICATION
transaction.m_pending_rows_event= 0;
-#endif
#ifdef __WIN__
real_id = 0;
#endif
@@ -349,9 +345,7 @@ void THD::init(void)
bzero((char*) warn_count, sizeof(warn_count));
total_warn_count= 0;
update_charset();
-#ifdef HAVE_ROW_BASED_REPLICATION
reset_current_stmt_binlog_row_based();
-#endif /*HAVE_ROW_BASED_REPLICATION*/
bzero((char *) &status_var, sizeof(status_var));
variables.lc_time_names = &my_locale_en_US;
}
@@ -2334,7 +2328,6 @@ void xid_cache_delete(XID_STATE *xid_state)
*/
#ifndef MYSQL_CLIENT
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
Template member function for ensuring that there is an rows log
@@ -2825,8 +2818,6 @@ void THD::binlog_delete_pending_rows_event()
}
}
-#endif /* HAVE_ROW_BASED_REPLICATION */
-
/*
Member function that will log query, either row-based or
statement-based depending on the value of the 'current_stmt_binlog_row_based'
@@ -2867,18 +2858,14 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype,
If we are in prelocked mode, the flushing will be done inside the
top-most close_thread_tables().
*/
-#ifdef HAVE_ROW_BASED_REPLICATION
if (this->prelocked_mode == NON_PRELOCKED)
if (int error= binlog_flush_pending_rows_event(TRUE))
DBUG_RETURN(error);
-#endif /*HAVE_ROW_BASED_REPLICATION*/
switch (qtype) {
case THD::ROW_QUERY_TYPE:
-#ifdef HAVE_ROW_BASED_REPLICATION
if (current_stmt_binlog_row_based)
DBUG_RETURN(0);
-#endif
/* Otherwise, we fall through */
case THD::MYSQL_QUERY_TYPE:
/*
@@ -2896,9 +2883,7 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype,
*/
{
Query_log_event qinfo(this, query, query_len, is_trans, suppress_use);
-#ifdef HAVE_ROW_BASED_REPLICATION
qinfo.flags|= LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F;
-#endif
/*
Binlog table maps will be irrelevant after a Query_log_event
(they are just removed on the slave side) so after the query
@@ -2906,9 +2891,7 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype,
table maps were written.
*/
int error= mysql_bin_log.write(&qinfo);
-#ifdef HAVE_ROW_BASED_REPLICATION
binlog_table_maps= 0;
-#endif /*HAVE_ROW_BASED_REPLICATION*/
DBUG_RETURN(error);
}
break;
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 2cf7de5ee9e..fb64086c957 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -930,8 +930,6 @@ public:
#ifndef MYSQL_CLIENT
int binlog_setup_trx_data();
-#ifdef HAVE_ROW_BASED_REPLICATION
-
/*
Public interface to write RBR events to the binlog
*/
@@ -985,7 +983,6 @@ public:
uint get_binlog_table_maps() const {
return binlog_table_maps;
}
-#endif /* HAVE_ROW_BASED_REPLICATION */
#endif /* MYSQL_CLIENT */
#ifndef MYSQL_CLIENT
@@ -1024,9 +1021,7 @@ public:
XID xid; // transaction identifier
enum xa_states xa_state; // used by external XA only
XID_STATE xid_state;
-#ifdef HAVE_ROW_BASED_REPLICATION
Rows_log_event *m_pending_rows_event;
-#endif
/*
Tables changed in transaction (that must be invalidated in query cache).
@@ -1533,7 +1528,6 @@ public:
void restore_active_arena(Query_arena *set, Query_arena *backup);
inline void set_current_stmt_binlog_row_based_if_mixed()
{
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
If in a stored/function trigger, the caller should already have done the
change. We test in_sub_stmt to prevent introducing bugs where people
@@ -1546,23 +1540,17 @@ public:
if ((variables.binlog_format == BINLOG_FORMAT_MIXED) &&
(in_sub_stmt == 0))
current_stmt_binlog_row_based= TRUE;
-#endif
}
inline void set_current_stmt_binlog_row_based()
{
-#ifdef HAVE_ROW_BASED_REPLICATION
current_stmt_binlog_row_based= TRUE;
-#endif
}
inline void clear_current_stmt_binlog_row_based()
{
-#ifdef HAVE_ROW_BASED_REPLICATION
current_stmt_binlog_row_based= FALSE;
-#endif
}
inline void reset_current_stmt_binlog_row_based()
{
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
If there are temporary tables, don't reset back to
statement-based. Indeed it could be that:
@@ -1586,9 +1574,6 @@ public:
current_stmt_binlog_row_based=
test(variables.binlog_format == BINLOG_FORMAT_ROW);
}
-#else
- current_stmt_binlog_row_based= FALSE;
-#endif
}
/*
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index dcb4152f64f..39740f30d47 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -2279,7 +2279,6 @@ bool delayed_insert::handle_inserts(void)
thd.proc_info=0;
pthread_mutex_unlock(&mutex);
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
We need to flush the pending event when using row-based
replication since the flushing normally done in binlog_query() is
@@ -2294,7 +2293,6 @@ bool delayed_insert::handle_inserts(void)
*/
if (thd.current_stmt_binlog_row_based)
thd.binlog_flush_pending_rows_event(TRUE);
-#endif /* HAVE_ROW_BASED_REPLICATION */
if ((error=table->file->extra(HA_EXTRA_NO_CACHE)))
{ // This shouldn't happen
@@ -2948,7 +2946,6 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
DBUG_ENTER("select_create::prepare");
TABLEOP_HOOKS *hook_ptr= NULL;
-#ifdef HAVE_ROW_BASED_REPLICATION
class MY_HOOKS : public TABLEOP_HOOKS {
public:
MY_HOOKS(select_create *x) : ptr(x) { }
@@ -2970,11 +2967,9 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
MY_HOOKS hooks(this);
hook_ptr= &hooks;
-#endif
unit= u;
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
Start a statement transaction before the create if we are creating
a non-temporary table and are using row-based replication for the
@@ -2985,7 +2980,6 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
{
thd->binlog_start_trans_and_stmt();
}
-#endif
if (!(table= create_table_from_items(thd, create_info, create_table,
extra_fields, keys, &values,
@@ -3029,8 +3023,6 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
DBUG_RETURN(0);
}
-
-#ifdef HAVE_ROW_BASED_REPLICATION
void
select_create::binlog_show_create_table(TABLE **tables, uint count)
{
@@ -3071,7 +3063,6 @@ select_create::binlog_show_create_table(TABLE **tables, uint count)
/* is_trans */ TRUE,
/* suppress_use */ FALSE);
}
-#endif // HAVE_ROW_BASED_REPLICATION
void select_create::store_values(List<Item> &values)
{
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index c35ef4079d3..ce2059fec45 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1658,9 +1658,7 @@ void Query_tables_list::reset_query_tables_list(bool init)
sroutines_list.empty();
sroutines_list_own_last= sroutines_list.next;
sroutines_list_own_elements= 0;
-#ifdef HAVE_ROW_BASED_REPLICATION
binlog_row_based_if_mixed= FALSE;
-#endif
}
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 7e09675cb0a..4572ccb6365 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -811,7 +811,6 @@ public:
byte **sroutines_list_own_last;
uint sroutines_list_own_elements;
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
Tells if the parsing stage detected that some items require row-based
binlogging to give a reliable binlog/replication, or if we will use
@@ -819,7 +818,6 @@ public:
binlogging.
*/
bool binlog_row_based_if_mixed;
-#endif
/*
These constructor and destructor serve for creation/destruction
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index b85610eaa6f..9f75b52daef 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -465,7 +465,6 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
#ifndef EMBEDDED_LIBRARY
if (mysql_bin_log.is_open())
{
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
We need to do the job that is normally done inside
binlog_query() here, which is to ensure that the pending event
@@ -477,7 +476,6 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
if (thd->current_stmt_binlog_row_based)
thd->binlog_flush_pending_rows_event(true);
else
-#endif
{
/*
As already explained above, we need to call end_io_cache() or the last
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 98226c1651b..01ea87ee8c4 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1090,14 +1090,12 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
table->next_global= view_tables;
}
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
If the view's body needs row-based binlogging (e.g. the VIEW is created
from SELECT UUID()), the top statement also needs it.
*/
if (lex->binlog_row_based_if_mixed)
old_lex->binlog_row_based_if_mixed= TRUE;
-#endif
bool view_is_mergeable= (table->algorithm != VIEW_ALGORITHM_TMPTABLE &&
lex->can_be_merged());
TABLE_LIST *view_main_select_tables;
diff --git a/sql/table.cc b/sql/table.cc
index 7f80b95c954..4d4bc836cc3 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -123,7 +123,6 @@ TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key,
share->version= refresh_version;
share->flush_version= flush_version;
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
This constant is used to mark that no table map version has been
assigned. No arithmetic is done on the value: it will be
@@ -141,8 +140,6 @@ TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key,
share->table_map_id= ~0UL;
share->cached_row_logging_check= -1;
-#endif
-
memcpy((char*) &share->mem_root, (char*) &mem_root, sizeof(mem_root));
pthread_mutex_init(&share->mutex, MY_MUTEX_INIT_FAST);
pthread_cond_init(&share->cond, NULL);
@@ -194,7 +191,6 @@ void init_tmp_table_share(TABLE_SHARE *share, const char *key,
share->path.length= share->normalized_path.length= strlen(path);
share->frm_version= FRM_VER_TRUE_VARCHAR;
-#ifdef HAVE_ROW_BASED_REPLICATION
/*
Temporary tables are not replicated, but we set up these fields
anyway to be able to catch errors.
@@ -202,7 +198,6 @@ void init_tmp_table_share(TABLE_SHARE *share, const char *key,
share->table_map_version= ~(ulonglong)0;
share->table_map_id= ~0UL;
share->cached_row_logging_check= -1;
-#endif
DBUG_VOID_RETURN;
}