Commit b200cf78 authored by Yuchen Pei's avatar Yuchen Pei Committed by Sergei Golubchik

MDEV-34716 spider: some trivial cleanups and documentation

- document tmp_share, which are temporary spider shares with only one
link (no ha)
- simplify spider_get_sys_tables_connect_info() where link_idx is
always 0
parent 4af516c4
......@@ -246,6 +246,7 @@ int spider_udf_get_copy_tgt_tables(
char table_key[MAX_KEY_LENGTH];
SPIDER_COPY_TABLE_CONN *table_conn = NULL, *src_table_conn_prev = NULL,
*dst_table_conn_prev = NULL;
/* This share has only one link. */
SPIDER_SHARE *tmp_share;
char **tmp_connect_info;
uint *tmp_connect_info_length;
......
......@@ -1465,6 +1465,7 @@ typedef struct st_spider_mon_table_result
typedef struct st_spider_table_mon
{
/* This share has only one link. */
SPIDER_SHARE *share;
uint32 server_id;
st_spider_table_mon_list *parent;
......@@ -1491,6 +1492,7 @@ typedef struct st_spider_table_mon_list
SPIDER_TABLE_MON *current;
volatile int mon_status;
/* This share has only one link */
SPIDER_SHARE *share;
pthread_mutex_t caller_mutex;
......@@ -1504,6 +1506,7 @@ typedef struct st_spider_table_mon_list
typedef struct st_spider_copy_table_conn
{
/* This share has only one link. */
SPIDER_SHARE *share;
int link_idx;
SPIDER_CONN *conn;
......
This diff is collapsed.
......@@ -946,6 +946,7 @@ int spider_free_share_alloc(
DBUG_RETURN(0);
}
/* Free a tmp_share, which has only one link */
void spider_free_tmp_share_alloc(
SPIDER_SHARE *share
) {
......@@ -5892,6 +5893,7 @@ int spider_open_all_tables(
THD *thd = trx->thd;
TABLE *table_tables;
int error_num, *need_mon, mon_val;
/* This share has only one link */
SPIDER_SHARE tmp_share;
char *db_name, *table_name;
uint db_name_length, table_name_length;
......@@ -5973,9 +5975,6 @@ int spider_open_all_tables(
table_name_length
)) ||
(error_num = spider_create_conn_keys(&tmp_share)) ||
/*
(error_num = spider_db_create_table_names_str(&tmp_share)) ||
*/
(error_num = spider_create_tmp_dbton_share(&tmp_share))
) {
spider_sys_index_end(table_tables);
......@@ -7367,6 +7366,10 @@ bool spider_check_pk_update(
DBUG_RETURN(FALSE);
}
/*
Set fields of a tmp share which has only one link. For use in
monitoring, spider_copy_tables udf etc.
*/
void spider_set_tmp_share_pointer(
SPIDER_SHARE *tmp_share,
char **tmp_connect_info,
......
......@@ -2746,6 +2746,7 @@ int spider_internal_xa_rollback_by_xid(
int error_num;
char xa_key[MAX_KEY_LENGTH];
char xa_member_key[MAX_KEY_LENGTH];
/* This share has only one link */
SPIDER_SHARE tmp_share;
char *tmp_connect_info[SPIDER_TMP_SHARE_CHAR_PTR_COUNT];
uint tmp_connect_info_length[SPIDER_TMP_SHARE_UINT_COUNT];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment