mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge suse.vabb.com:/home/Chuck/development/mysql-5.1-new-rpl
into suse.vabb.com:/home/Chuck/development/mysql-5.1_WL_3618
This commit is contained in:
@ -229,10 +229,7 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
|
||||
if test X"$ndb_binlog" = Xdefault ||
|
||||
test X"$ndb_binlog" = Xyes
|
||||
then
|
||||
if test X"$have_row_based" = Xyes
|
||||
then
|
||||
have_ndb_binlog="yes"
|
||||
fi
|
||||
have_ndb_binlog="yes"
|
||||
fi
|
||||
|
||||
if test X"$have_ndb_binlog" = Xyes
|
||||
|
@ -1,30 +0,0 @@
|
||||
dnl This file contains configuration parameters for replication.
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Macro: MYSQL_CHECK_REPLICATION
|
||||
dnl Sets HAVE_ROW_BASED_REPLICATION if --with-row-based-replication is used
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
AC_DEFUN([MYSQL_CHECK_REPLICATION], [
|
||||
AC_ARG_WITH([row-based-replication],
|
||||
AC_HELP_STRING([--without-row-based-replication],
|
||||
[Don't include row-based replication]),
|
||||
[row_based="$withval"],
|
||||
[row_based=yes])
|
||||
AC_MSG_CHECKING([for row-based replication])
|
||||
|
||||
case "$row_based" in
|
||||
yes )
|
||||
AC_DEFINE([WITH_ROW_BASED_REPLICATION], [1], [Define to have row-based replication])
|
||||
AC_MSG_RESULT([-- including row-based replication])
|
||||
[have_row_based=yes]
|
||||
;;
|
||||
* )
|
||||
AC_MSG_RESULT([-- not including row-based replication])
|
||||
[have_row_based=no]
|
||||
;;
|
||||
esac
|
||||
])
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl END OF MYSQL_CHECK_REPLICATION
|
||||
dnl ---------------------------------------------------------------------------
|
@ -2154,7 +2154,6 @@ AC_MSG_RESULT("$netinet_inc")
|
||||
|
||||
MYSQL_CHECK_BIG_TABLES
|
||||
MYSQL_CHECK_MAX_INDEXES
|
||||
MYSQL_CHECK_REPLICATION
|
||||
MYSQL_CHECK_VIO
|
||||
MYSQL_CHECK_SSL
|
||||
|
||||
|
@ -436,7 +436,6 @@ inline double ulonglong2double(ulonglong value)
|
||||
|
||||
#define HAVE_SPATIAL 1
|
||||
#define HAVE_RTREE_KEYS 1
|
||||
#define HAVE_ROW_BASED_REPLICATION 1
|
||||
|
||||
#define HAVE_OPENSSL 1
|
||||
#define HAVE_YASSL 1
|
||||
|
@ -79,9 +79,6 @@
|
||||
#endif /* _WIN32... */
|
||||
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
#ifdef WITH_ROW_BASED_REPLICATION
|
||||
#define HAVE_ROW_BASED_REPLICATION 1
|
||||
#endif
|
||||
#ifdef WITH_NDB_BINLOG
|
||||
#define HAVE_NDB_BINLOG 1
|
||||
#endif
|
||||
|
@ -3,8 +3,7 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
|
||||
# Need to set USE_TLS, since __declspec(thread) approach to thread local
|
||||
# storage does not work properly in DLLs.
|
||||
ADD_DEFINITIONS(-DUSE_TLS -DHAVE_ROW_BASED_REPLICATION -DMYSQL_SERVER
|
||||
-DEMBEDDED_LIBRARY)
|
||||
ADD_DEFINITIONS(-DUSE_TLS -DMYSQL_SERVER -DEMBEDDED_LIBRARY)
|
||||
|
||||
# The old Windows build method used renamed (.cc -> .cpp) source files, fails
|
||||
# in #include in lib_sql.cc. So disable that using the USING_CMAKE define.
|
||||
|
@ -1,4 +1,3 @@
|
||||
--source include/have_row_based.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#
|
||||
# Author(s): Mats Kindahl
|
||||
|
||||
--source include/have_row_based.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
let $format = STATEMENT;
|
||||
|
@ -1,4 +0,0 @@
|
||||
-- require r/have_row_based.require
|
||||
disable_query_log;
|
||||
show variables like "have_row_based_replication";
|
||||
enable_query_log;
|
@ -1,4 +0,0 @@
|
||||
-- require r/not_row_based.require
|
||||
disable_query_log;
|
||||
show variables like "have_row_based_replication";
|
||||
enable_query_log;
|
@ -1,2 +0,0 @@
|
||||
Variable_name Value
|
||||
have_row_based_replication YES
|
@ -1,2 +0,0 @@
|
||||
Variable_name Value
|
||||
have_row_based_replication NO
|
@ -1,4 +1,3 @@
|
||||
-- source include/have_row_based.inc
|
||||
-- source include/have_binlog_format_mixed_or_statement.inc
|
||||
-- source include/not_ndb_default.inc
|
||||
-- source include/master-slave.inc
|
||||
|
@ -1,4 +1,3 @@
|
||||
--source include/have_row_based.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
# partition tables with same engine (MyISAM) in both ends. #
|
||||
############################################################
|
||||
|
||||
--source include/have_row_based.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
--source include/have_partition.inc
|
||||
--source include/not_ndb_default.inc
|
||||
|
@ -5,7 +5,6 @@
|
||||
|
||||
# Requires statement logging
|
||||
-- source include/not_ndb_default.inc
|
||||
-- source include/have_row_based.inc
|
||||
SET SESSION BINLOG_FORMAT=ROW;
|
||||
SET GLOBAL BINLOG_FORMAT=ROW;
|
||||
-- source extra/rpl_tests/rpl_max_relay_size.test
|
||||
|
@ -1,4 +1,3 @@
|
||||
-- source include/have_row_based.inc
|
||||
-- source include/not_ndb_default.inc
|
||||
-- source include/master-slave.inc
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
30
sql/log.cc
30
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()));
|
||||
|
||||
/*
|
||||
|
@ -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
|
||||
|
@ -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) */
|
||||
|
@ -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 */
|
||||
|
@ -1561,9 +1561,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;
|
||||
@ -1668,7 +1666,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;
|
||||
|
@ -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 "
|
||||
@ -4912,18 +4896,9 @@ struct my_option my_long_options[] =
|
||||
"those, row-based binary logging is automatically used. "
|
||||
#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;
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
|
@ -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*/
|
||||
}
|
||||
|
||||
|
||||
|
@ -944,9 +944,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
|
||||
{
|
||||
@ -954,9 +952,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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
@ -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),
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user