1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Initial merge result with mariaDB 10: lp:maria

This commit is contained in:
Seppo Jaakola
2013-07-13 13:01:13 +03:00
parent 58926b5e19
commit 0a9216835f
160 changed files with 9800 additions and 939 deletions

View File

@ -57,6 +57,15 @@ void set_thd_stage_info(void *thd,
#include "my_apc.h"
#ifdef WITH_WSREP
#include "wsrep_mysqld.h"
struct wsrep_thd_shadow {
ulonglong options;
enum wsrep_exec_mode wsrep_exec_mode;
Vio *vio;
ulong tx_isolation;
};
#endif
class Reprepare_observer;
class Relay_log_info;
class Rpl_filter;
@ -613,6 +622,11 @@ typedef struct system_variables
ulong wt_timeout_short, wt_deadlock_search_depth_short;
ulong wt_timeout_long, wt_deadlock_search_depth_long;
#ifdef WITH_WSREP
my_bool wsrep_on;
my_bool wsrep_causal_reads;
ulong wsrep_retry_autocommit;
#endif
double long_query_time_double;
my_bool pseudo_slave_mode;
@ -1015,6 +1029,9 @@ struct st_savepoint {
/** State of metadata locks before this savepoint was set. */
MDL_savepoint mdl_savepoint;
};
#ifdef WITH_WSREP
void wsrep_cleanup_transaction(THD *thd); // THD.transactions.cleanup calls it
#endif
enum xa_states {XA_NOTR=0, XA_ACTIVE, XA_IDLE, XA_PREPARED, XA_ROLLBACK_ONLY};
extern const char *xa_state_names[];
@ -1860,7 +1877,7 @@ public:
int is_current_stmt_binlog_format_row() const {
DBUG_ASSERT(current_stmt_binlog_format == BINLOG_FORMAT_STMT ||
current_stmt_binlog_format == BINLOG_FORMAT_ROW);
return current_stmt_binlog_format == BINLOG_FORMAT_ROW;
return (WSREP_FORMAT((ulong)current_stmt_binlog_format) == BINLOG_FORMAT_ROW);
}
private:
@ -1918,7 +1935,11 @@ public:
*/
CHANGED_TABLE_LIST* changed_tables;
MEM_ROOT mem_root; // Transaction-life memory allocation pool
#ifdef WITH_WSREP
void cleanup(THD *thd)
#else
void cleanup()
#endif
{
DBUG_ENTER("thd::cleanup");
changed_tables= 0;
@ -1932,6 +1953,11 @@ public:
if (!xid_state.rm_error)
xid_state.xid.null();
free_root(&mem_root,MYF(MY_KEEP_PREALLOC));
#ifdef WITH_WSREP
// Todo: convert into a plugin method
// wsrep's post-commit. LOCAL_COMMIT designates wsrep's commit was ok
if (WSREP(thd)) wsrep_cleanup_transaction(thd);
#endif /* WITH_WSREP */
DBUG_VOID_RETURN;
}
my_bool is_active()
@ -2464,6 +2490,36 @@ public:
query_id_t first_query_id;
} binlog_evt_union;
#ifdef WITH_WSREP
const bool wsrep_applier; /* dedicated slave applier thread */
bool wsrep_applier_closing; /* applier marked to close */
bool wsrep_client_thread; /* to identify client threads*/
enum wsrep_exec_mode wsrep_exec_mode;
query_id_t wsrep_last_query_id;
enum wsrep_query_state wsrep_query_state;
enum wsrep_conflict_state wsrep_conflict_state;
mysql_mutex_t LOCK_wsrep_thd;
mysql_cond_t COND_wsrep_thd;
wsrep_seqno_t wsrep_trx_seqno;
uint32 wsrep_rand;
Relay_log_info* wsrep_rli;
bool wsrep_converted_lock_session;
wsrep_trx_handle_t wsrep_trx_handle;
bool wsrep_seqno_changed;
#ifdef WSREP_PROC_INFO
char wsrep_info[128]; /* string for dynamic proc info */
#endif /* WSREP_PROC_INFO */
ulong wsrep_retry_counter; // of autocommit
bool wsrep_PA_safe;
char* wsrep_retry_query;
size_t wsrep_retry_query_len;
enum enum_server_command wsrep_retry_command;
enum wsrep_consistency_check_mode
wsrep_consistency_check;
wsrep_stats_var* wsrep_status_vars;
int wsrep_mysql_replicated;
THD* wsrep_bf_thd;
#endif /* WITH_WSREP */
/**
Internal parser state.
Note that since the parser is not re-entrant, we keep only one parser
@ -2495,7 +2551,11 @@ public:
/* Debug Sync facility. See debug_sync.cc. */
struct st_debug_sync_control *debug_sync_control;
#endif /* defined(ENABLED_DEBUG_SYNC) */
#ifdef WITH_WSREP
THD(bool is_applier = false);
#else
THD();
#endif
~THD();
void init(void);
@ -2967,7 +3027,7 @@ public:
tests fail and so force them to propagate the
lex->binlog_row_based_if_mixed upwards to the caller.
*/
if ((variables.binlog_format == BINLOG_FORMAT_MIXED) &&
if ((WSREP_FORMAT(variables.binlog_format) == BINLOG_FORMAT_MIXED) &&
(in_sub_stmt == 0))
set_current_stmt_binlog_format_row();
@ -3019,7 +3079,7 @@ public:
show_system_thread(system_thread)));
if (in_sub_stmt == 0)
{
if (variables.binlog_format == BINLOG_FORMAT_ROW)
if (WSREP_FORMAT(variables.binlog_format) == BINLOG_FORMAT_ROW)
set_current_stmt_binlog_format_row();
else if (temporary_tables == NULL)
set_current_stmt_binlog_format_stmt();