Skip to content

Commit

Permalink
MDEV-8240 : Unknown option 'table_type' when using Connect Engine on MGC
Browse files Browse the repository at this point in the history
MariaDB Galera server's (MGC) handlerton & THD structures have
some extra wsrep members as compared to MariaDB server. As a
result, when plugins from packages, built along with MariaDB
server like Connect & OQGraph are loaded and accessed by MGC,
the objects may get initialized improperly.

Fixed by moving the wsrep-additions to the end of the structure.
  • Loading branch information
Nirbhay Choubey committed Jul 29, 2015
1 parent 6771b81 commit 0abde01
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 47 deletions.
16 changes: 9 additions & 7 deletions sql/handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -1233,13 +1233,7 @@ struct handlerton
enum handler_create_iterator_result
(*create_iterator)(handlerton *hton, enum handler_iterator_type type,
struct handler_iterator *fill_this_in);
#ifdef WITH_WSREP
int (*wsrep_abort_transaction)(handlerton *hton, THD *bf_thd,
THD *victim_thd, my_bool signal);
int (*wsrep_set_checkpoint)(handlerton *hton, const XID* xid);
int (*wsrep_get_checkpoint)(handlerton *hton, XID* xid);
void (*wsrep_fake_trx_id)(handlerton *hton, THD *thd);
#endif /* WITH_WSREP */

/*
Optional clauses in the CREATE/ALTER TABLE
*/
Expand Down Expand Up @@ -1352,6 +1346,14 @@ struct handlerton
*/
int (*discover_table_structure)(handlerton *hton, THD* thd,
TABLE_SHARE *share, HA_CREATE_INFO *info);

#ifdef WITH_WSREP
int (*wsrep_abort_transaction)(handlerton *hton, THD *bf_thd,
THD *victim_thd, my_bool signal);
int (*wsrep_set_checkpoint)(handlerton *hton, const XID* xid);
int (*wsrep_get_checkpoint)(handlerton *hton, XID* xid);
void (*wsrep_fake_trx_id)(handlerton *hton, THD *thd);
#endif /* WITH_WSREP */
};


Expand Down
82 changes: 42 additions & 40 deletions sql/sql_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -2783,46 +2783,7 @@ class THD :public Statement,
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;
// changed from wsrep_seqno_t to wsrep_trx_meta_t in wsrep API rev 75
// wsrep_seqno_t wsrep_trx_seqno;
wsrep_trx_meta_t wsrep_trx_meta;
uint32 wsrep_rand;
rpl_group_info* wsrep_rgi;
bool wsrep_converted_lock_session;
wsrep_ws_handle_t wsrep_ws_handle;
#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;
const char* wsrep_TOI_pre_query; /* a query to apply before
the actual TOI query */
size_t wsrep_TOI_pre_query_len;
wsrep_po_handle_t wsrep_po_handle;
size_t wsrep_po_cnt;
my_bool wsrep_po_in_trans;
#ifdef GTID_SUPPORT
rpl_sid wsrep_po_sid;
#endif /* GTID_SUPPORT */
void* wsrep_apply_format;
bool wsrep_apply_toi; /* applier processing in TOI */
#endif /* WITH_WSREP */

/**
Internal parser state.
Note that since the parser is not re-entrant, we keep only one parser
Expand Down Expand Up @@ -3857,6 +3818,47 @@ class THD :public Statement,
return (temporary_tables ||
(rgi_slave && rgi_have_temporary_tables()));
}

#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;
// changed from wsrep_seqno_t to wsrep_trx_meta_t in wsrep API rev 75
// wsrep_seqno_t wsrep_trx_seqno;
wsrep_trx_meta_t wsrep_trx_meta;
uint32 wsrep_rand;
rpl_group_info* wsrep_rgi;
bool wsrep_converted_lock_session;
wsrep_ws_handle_t wsrep_ws_handle;
#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;
const char* wsrep_TOI_pre_query; /* a query to apply before
the actual TOI query */
size_t wsrep_TOI_pre_query_len;
wsrep_po_handle_t wsrep_po_handle;
size_t wsrep_po_cnt;
my_bool wsrep_po_in_trans;
#ifdef GTID_SUPPORT
rpl_sid wsrep_po_sid;
#endif /* GTID_SUPPORT */
void* wsrep_apply_format;
bool wsrep_apply_toi; /* applier processing in TOI */
#endif /* WITH_WSREP */
};


Expand Down

0 comments on commit 0abde01

Please sign in to comment.