1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-09 22:24:09 +03:00

MDEV-28006 Delete Spider plugin variables regarding UDFs and related code

Delete the plugin variables, which are deprecated by MDEV-28005,
regarding UDFs.
This commit is contained in:
Nayuta Yanagisawa
2022-05-14 16:37:23 +09:00
parent e98e8c7f7e
commit 77a18e8217
10 changed files with 47 additions and 301 deletions

View File

@@ -43,37 +43,6 @@ Warnings:
Warning 1287 The table parameter 'internal_offset' is deprecated and will be removed in a future release Warning 1287 The table parameter 'internal_offset' is deprecated and will be removed in a future release
DROP TABLE tbl_a; DROP TABLE tbl_a;
DROP TABLE tbl_b; DROP TABLE tbl_b;
# MDEV-28005 Deprecate Spider plugin variables regarding UDFs
SET GLOBAL spider_udf_ds_bulk_insert_rows = 1;
Warnings:
Warning 1287 '@@spider_udf_ds_bulk_insert_rows' is deprecated and will be removed in a future release
SHOW VARIABLES LIKE "spider_udf_ds_bulk_insert_rows";
Variable_name Value
spider_udf_ds_bulk_insert_rows -1
SET spider_udf_ds_table_loop_mode = 1;
Warnings:
Warning 1287 '@@spider_udf_ds_table_loop_mode' is deprecated and will be removed in a future release
SHOW VARIABLES LIKE "spider_udf_ds_table_loop_mode";
Variable_name Value
spider_udf_ds_table_loop_mode 1
SET spider_udf_ds_use_real_table = 1;
Warnings:
Warning 1287 '@@spider_udf_ds_use_real_table' is deprecated and will be removed in a future release
SHOW VARIABLES LIKE "spider_udf_ds_use_real_table";
Variable_name Value
spider_udf_ds_use_real_table 1
SET GLOBAL spider_udf_ct_bulk_insert_interval = 1;
Warnings:
Warning 1287 '@@spider_udf_ct_bulk_insert_interval' is deprecated and will be removed in a future release
SHOW VARIABLES LIKE "spider_udf_ct_bulk_insert_interval";
Variable_name Value
spider_udf_ct_bulk_insert_interval 1
SET GLOBAL spider_udf_ct_bulk_insert_rows = 1;
Warnings:
Warning 1287 '@@spider_udf_ct_bulk_insert_rows' is deprecated and will be removed in a future release
SHOW VARIABLES LIKE "spider_udf_ct_bulk_insert_rows";
Variable_name Value
spider_udf_ct_bulk_insert_rows 1
# MDEV-27981 Deprecate spider_internal_limit # MDEV-27981 Deprecate spider_internal_limit
SET spider_internal_limit = 1; SET spider_internal_limit = 1;
Warnings: Warnings:

View File

@@ -29,22 +29,6 @@ eval CREATE TABLE tbl_b (a INT) $MASTER_1_ENGINE COMMENT='internal_offset "1"';
DROP TABLE tbl_a; DROP TABLE tbl_a;
DROP TABLE tbl_b; DROP TABLE tbl_b;
--echo # MDEV-28005 Deprecate Spider plugin variables regarding UDFs
SET GLOBAL spider_udf_ds_bulk_insert_rows = 1;
SHOW VARIABLES LIKE "spider_udf_ds_bulk_insert_rows";
SET spider_udf_ds_table_loop_mode = 1;
SHOW VARIABLES LIKE "spider_udf_ds_table_loop_mode";
SET spider_udf_ds_use_real_table = 1;
SHOW VARIABLES LIKE "spider_udf_ds_use_real_table";
SET GLOBAL spider_udf_ct_bulk_insert_interval = 1;
SHOW VARIABLES LIKE "spider_udf_ct_bulk_insert_interval";
SET GLOBAL spider_udf_ct_bulk_insert_rows = 1;
SHOW VARIABLES LIKE "spider_udf_ct_bulk_insert_rows";
--echo # MDEV-27981 Deprecate spider_internal_limit --echo # MDEV-27981 Deprecate spider_internal_limit
SET spider_internal_limit = 1; SET spider_internal_limit = 1;
SHOW VARIABLES LIKE "spider_internal_limit"; SHOW VARIABLES LIKE "spider_internal_limit";

View File

@@ -1000,8 +1000,7 @@ long long spider_copy_tables_body(
else else
copy_tables->access_charset = system_charset_info; copy_tables->access_charset = system_charset_info;
bulk_insert_rows = spider_param_udf_ct_bulk_insert_rows( bulk_insert_rows= copy_tables->bulk_insert_rows;
copy_tables->bulk_insert_rows);
for (src_tbl_conn = copy_tables->table_conn[0]; src_tbl_conn; for (src_tbl_conn = copy_tables->table_conn[0]; src_tbl_conn;
src_tbl_conn = src_tbl_conn->next) src_tbl_conn = src_tbl_conn->next)
{ {

View File

@@ -9138,10 +9138,8 @@ int spider_db_udf_direct_sql(
SPIDER_CONN *conn = direct_sql->conn; SPIDER_CONN *conn = direct_sql->conn;
SPIDER_DB_RESULT *result = NULL; SPIDER_DB_RESULT *result = NULL;
TABLE *table; TABLE *table;
int bulk_insert_rows = (int) spider_param_udf_ds_bulk_insert_rows(thd, int bulk_insert_rows= (int) direct_sql->bulk_insert_rows;
direct_sql->bulk_insert_rows); int table_loop_mode= direct_sql->table_loop_mode;
int table_loop_mode = spider_param_udf_ds_table_loop_mode(thd,
direct_sql->table_loop_mode);
double ping_interval_at_trx_start = double ping_interval_at_trx_start =
spider_param_ping_interval_at_trx_start(thd); spider_param_ping_interval_at_trx_start(thd);
time_t tmp_time = (time_t) time((time_t*) 0); time_t tmp_time = (time_t) time((time_t*) 0);
@@ -9255,14 +9253,13 @@ int spider_db_udf_direct_sql(
{ {
while (!error_num && !end_of_file) while (!error_num && !end_of_file)
{ {
udf_table_mutex_index = spider_udf_calc_hash( udf_table_mutex_index=
direct_sql->db_names[roop_count], spider_udf_calc_hash(direct_sql->db_names[roop_count],
spider_param_udf_table_lock_mutex_count()); spider_udf_table_lock_mutex_count);
udf_table_mutex_index += spider_udf_calc_hash( udf_table_mutex_index+=
direct_sql->table_names[roop_count], spider_udf_calc_hash(direct_sql->table_names[roop_count],
spider_param_udf_table_lock_mutex_count()); spider_udf_table_lock_mutex_count);
udf_table_mutex_index %= udf_table_mutex_index%= spider_udf_table_lock_mutex_count;
spider_param_udf_table_lock_mutex_count();
pthread_mutex_lock( pthread_mutex_lock(
&trx->udf_table_mutexes[udf_table_mutex_index]); &trx->udf_table_mutexes[udf_table_mutex_index]);
table = direct_sql->tables[roop_count]; table = direct_sql->tables[roop_count];
@@ -10313,8 +10310,7 @@ int spider_db_udf_copy_tables(
pthread_mutex_unlock(&tmp_conn->mta_conn_mutex); pthread_mutex_unlock(&tmp_conn->mta_conn_mutex);
goto error_db_query; goto error_db_query;
} }
bulk_insert_rows = spider_param_udf_ct_bulk_insert_rows( bulk_insert_rows= copy_tables->bulk_insert_rows;
copy_tables->bulk_insert_rows);
if ( if (
select_ct->append_key_order_str(key_info, 0, FALSE) || select_ct->append_key_order_str(key_info, 0, FALSE) ||
select_ct->append_limit(0, bulk_insert_rows) || select_ct->append_limit(0, bulk_insert_rows) ||
@@ -10526,8 +10522,7 @@ int spider_db_udf_copy_tables(
insert_ct->set_sql_to_pos(); insert_ct->set_sql_to_pos();
} }
DBUG_PRINT("info",("spider sleep")); DBUG_PRINT("info",("spider sleep"));
bulk_insert_interval = spider_param_udf_ct_bulk_insert_interval( bulk_insert_interval= copy_tables->bulk_insert_interval;
copy_tables->bulk_insert_interval);
my_sleep(bulk_insert_interval); my_sleep(bulk_insert_interval);
} }
} }

View File

@@ -1594,10 +1594,9 @@ long long spider_direct_sql_body(
} }
trx->updated_in_this_trx = TRUE; trx->updated_in_this_trx = TRUE;
DBUG_PRINT("info",("spider trx->updated_in_this_trx=TRUE")); DBUG_PRINT("info",("spider trx->updated_in_this_trx=TRUE"));
use_real_table = spider_param_udf_ds_use_real_table(thd, use_real_table= direct_sql->use_real_table;
direct_sql->use_real_table); for (roop_count= 0; roop_count < direct_sql->table_count; roop_count++)
for (roop_count = 0; roop_count < direct_sql->table_count; roop_count++) {
{
#ifdef SPIDER_NEED_INIT_ONE_TABLE_FOR_FIND_TEMPORARY_TABLE #ifdef SPIDER_NEED_INIT_ONE_TABLE_FOR_FIND_TEMPORARY_TABLE
#ifdef SPIDER_use_LEX_CSTRING_for_database_tablename_alias #ifdef SPIDER_use_LEX_CSTRING_for_database_tablename_alias
LEX_CSTRING db_name = LEX_CSTRING db_name =

View File

@@ -1952,103 +1952,6 @@ int spider_param_direct_dup_insert(
direct_dup_insert : THDVAR(thd, direct_dup_insert)); direct_dup_insert : THDVAR(thd, direct_dup_insert));
} }
static uint spider_udf_table_lock_mutex_count;
/*
1-: mutex count
*/
static MYSQL_SYSVAR_UINT(
udf_table_lock_mutex_count,
spider_udf_table_lock_mutex_count,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Mutex count of table lock for Spider UDFs",
NULL,
NULL,
20,
1,
4294967295U,
0
);
uint spider_param_udf_table_lock_mutex_count()
{
DBUG_ENTER("spider_param_udf_table_lock_mutex_count");
DBUG_RETURN(spider_udf_table_lock_mutex_count);
}
static uint spider_udf_table_mon_mutex_count;
/*
1-: mutex count
*/
static MYSQL_SYSVAR_UINT(
udf_table_mon_mutex_count,
spider_udf_table_mon_mutex_count,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Mutex count of table mon for Spider UDFs",
NULL,
NULL,
20,
1,
4294967295U,
0
);
uint spider_param_udf_table_mon_mutex_count()
{
DBUG_ENTER("spider_param_udf_table_mon_mutex_count");
DBUG_RETURN(spider_udf_table_mon_mutex_count);
}
/*
1-:number of rows
*/
static MYSQL_THDVAR_LONGLONG(
udf_ds_bulk_insert_rows, /* name */
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Number of rows for bulk inserting", /* comment */
NULL, /* check */
NULL, /* update */
-1, /* def */
-1, /* min */
9223372036854775807LL, /* max */
0 /* blk */
);
longlong spider_param_udf_ds_bulk_insert_rows(
THD *thd,
longlong udf_ds_bulk_insert_rows
) {
DBUG_ENTER("spider_param_udf_ds_bulk_insert_rows");
DBUG_RETURN(THDVAR(thd, udf_ds_bulk_insert_rows) <= 0 ?
udf_ds_bulk_insert_rows : THDVAR(thd, udf_ds_bulk_insert_rows));
}
/*
-1 :use table parameter
0 :drop records
1 :insert last table
2 :insert first table and loop again
*/
static MYSQL_THDVAR_INT(
udf_ds_table_loop_mode, /* name */
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Table loop mode if the number of tables in table list are less than the number of result sets", /* comment */
NULL, /* check */
NULL, /* update */
-1, /* def */
-1, /* min */
2, /* max */
0 /* blk */
);
int spider_param_udf_ds_table_loop_mode(
THD *thd,
int udf_ds_table_loop_mode
) {
DBUG_ENTER("spider_param_udf_ds_table_loop_mode");
DBUG_RETURN(THDVAR(thd, udf_ds_table_loop_mode) == -1 ?
udf_ds_table_loop_mode : THDVAR(thd, udf_ds_table_loop_mode));
}
static char *spider_remote_access_charset; static char *spider_remote_access_charset;
/* /*
*/ */
@@ -2281,58 +2184,6 @@ int spider_param_bka_mode(
bka_mode : THDVAR(thd, bka_mode)); bka_mode : THDVAR(thd, bka_mode));
} }
static int spider_udf_ct_bulk_insert_interval;
/*
-1 : The UDF parameter is adopted.
0 or more : Milliseconds.
*/
static MYSQL_SYSVAR_INT(
udf_ct_bulk_insert_interval,
spider_udf_ct_bulk_insert_interval,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED,
"The interval time between bulk insert and next bulk insert at coping",
NULL,
NULL,
-1,
-1,
2147483647,
0
);
int spider_param_udf_ct_bulk_insert_interval(
int udf_ct_bulk_insert_interval
) {
DBUG_ENTER("spider_param_udf_ct_bulk_insert_interval");
DBUG_RETURN(spider_udf_ct_bulk_insert_interval < 0 ?
udf_ct_bulk_insert_interval : spider_udf_ct_bulk_insert_interval);
}
static longlong spider_udf_ct_bulk_insert_rows;
/*
-1,0 : The UDF parameter is adopted.
1 or more : Number of rows.
*/
static MYSQL_SYSVAR_LONGLONG(
udf_ct_bulk_insert_rows,
spider_udf_ct_bulk_insert_rows,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED,
"The number of rows inserted with bulk insert of one time at coping",
NULL,
NULL,
-1,
-1,
9223372036854775807LL,
0
);
longlong spider_param_udf_ct_bulk_insert_rows(
longlong udf_ct_bulk_insert_rows
) {
DBUG_ENTER("spider_param_udf_ct_bulk_insert_rows");
DBUG_RETURN(spider_udf_ct_bulk_insert_rows <= 0 ?
udf_ct_bulk_insert_rows : spider_udf_ct_bulk_insert_rows);
}
/* /*
-1 :use table parameter -1 :use table parameter
0 :not use 0 :not use
@@ -2517,33 +2368,6 @@ int spider_param_read_only_mode(
read_only_mode : THDVAR(thd, read_only_mode)); read_only_mode : THDVAR(thd, read_only_mode));
} }
/*
-1 :use UDF parameter
0 :can not use
1 :can use
*/
static MYSQL_THDVAR_INT(
udf_ds_use_real_table, /* name */
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_DEPRECATED, /* opt */
"Use real table for temporary table list", /* comment */
NULL, /* check */
NULL, /* update */
-1, /* def */
-1, /* min */
1, /* max */
0 /* blk */
);
int spider_param_udf_ds_use_real_table(
THD *thd,
int udf_ds_use_real_table
) {
DBUG_ENTER("spider_param_udf_ds_use_real_table");
DBUG_RETURN(THDVAR(thd, udf_ds_use_real_table) == -1 ?
udf_ds_use_real_table : THDVAR(thd, udf_ds_use_real_table));
}
static my_bool spider_general_log; static my_bool spider_general_log;
static MYSQL_SYSVAR_BOOL( static MYSQL_SYSVAR_BOOL(
general_log, general_log,
@@ -3182,10 +3006,6 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR(local_lock_table), MYSQL_SYSVAR(local_lock_table),
MYSQL_SYSVAR(use_pushdown_udf), MYSQL_SYSVAR(use_pushdown_udf),
MYSQL_SYSVAR(direct_dup_insert), MYSQL_SYSVAR(direct_dup_insert),
MYSQL_SYSVAR(udf_table_lock_mutex_count),
MYSQL_SYSVAR(udf_table_mon_mutex_count),
MYSQL_SYSVAR(udf_ds_bulk_insert_rows),
MYSQL_SYSVAR(udf_ds_table_loop_mode),
MYSQL_SYSVAR(remote_access_charset), MYSQL_SYSVAR(remote_access_charset),
MYSQL_SYSVAR(remote_autocommit), MYSQL_SYSVAR(remote_autocommit),
MYSQL_SYSVAR(remote_time_zone), MYSQL_SYSVAR(remote_time_zone),
@@ -3197,8 +3017,6 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR(connect_mutex), MYSQL_SYSVAR(connect_mutex),
MYSQL_SYSVAR(bka_engine), MYSQL_SYSVAR(bka_engine),
MYSQL_SYSVAR(bka_mode), MYSQL_SYSVAR(bka_mode),
MYSQL_SYSVAR(udf_ct_bulk_insert_interval),
MYSQL_SYSVAR(udf_ct_bulk_insert_rows),
MYSQL_SYSVAR(use_handler), MYSQL_SYSVAR(use_handler),
MYSQL_SYSVAR(error_read_mode), MYSQL_SYSVAR(error_read_mode),
MYSQL_SYSVAR(error_write_mode), MYSQL_SYSVAR(error_write_mode),
@@ -3206,7 +3024,6 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR(skip_parallel_search), MYSQL_SYSVAR(skip_parallel_search),
MYSQL_SYSVAR(direct_order_limit), MYSQL_SYSVAR(direct_order_limit),
MYSQL_SYSVAR(read_only_mode), MYSQL_SYSVAR(read_only_mode),
MYSQL_SYSVAR(udf_ds_use_real_table),
MYSQL_SYSVAR(general_log), MYSQL_SYSVAR(general_log),
MYSQL_SYSVAR(index_hint_pushdown), MYSQL_SYSVAR(index_hint_pushdown),
MYSQL_SYSVAR(max_connections), MYSQL_SYSVAR(max_connections),

View File

@@ -14,6 +14,9 @@
along with this program); if not, write to the Free Software along with this program); if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
constexpr uint spider_udf_table_lock_mutex_count= 20;
constexpr uint spider_udf_table_mon_mutex_count= 20;
my_bool spider_param_support_xa(); my_bool spider_param_support_xa();
my_bool spider_param_connect_mutex(); my_bool spider_param_connect_mutex();
uint spider_param_connect_error_interval(); uint spider_param_connect_error_interval();
@@ -263,16 +266,6 @@ int spider_param_direct_dup_insert(
THD *thd, THD *thd,
int direct_dup_insert int direct_dup_insert
); );
uint spider_param_udf_table_lock_mutex_count();
uint spider_param_udf_table_mon_mutex_count();
longlong spider_param_udf_ds_bulk_insert_rows(
THD *thd,
longlong udf_ds_bulk_insert_rows
);
int spider_param_udf_ds_table_loop_mode(
THD *thd,
int udf_ds_table_loop_mode
);
char *spider_param_remote_access_charset(); char *spider_param_remote_access_charset();
int spider_param_remote_autocommit(); int spider_param_remote_autocommit();
char *spider_param_remote_time_zone(); char *spider_param_remote_time_zone();
@@ -293,12 +286,6 @@ int spider_param_bka_mode(
THD *thd, THD *thd,
int bka_mode int bka_mode
); );
int spider_param_udf_ct_bulk_insert_interval(
int udf_ct_bulk_insert_interval
);
longlong spider_param_udf_ct_bulk_insert_rows(
longlong udf_ct_bulk_insert_rows
);
int spider_param_use_handler( int spider_param_use_handler(
THD *thd, THD *thd,
int use_handler int use_handler
@@ -327,10 +314,6 @@ int spider_param_read_only_mode(
THD *thd, THD *thd,
int read_only_mode int read_only_mode
); );
int spider_param_udf_ds_use_real_table(
THD *thd,
int udf_ds_use_real_table
);
my_bool spider_param_general_log(); my_bool spider_param_general_log();
my_bool spider_param_index_hint_pushdown( my_bool spider_param_index_hint_pushdown(
THD *thd THD *thd

View File

@@ -97,8 +97,8 @@ SPIDER_TABLE_MON_LIST *spider_get_ping_table_mon_list(
free_root(&mem_root, MYF(0)); free_root(&mem_root, MYF(0));
} }
mutex_hash = spider_udf_calc_hash(str->c_ptr(), mutex_hash=
spider_param_udf_table_mon_mutex_count()); spider_udf_calc_hash(str->c_ptr(), spider_udf_table_mon_mutex_count);
DBUG_PRINT("info",("spider hash key=%s", str->c_ptr())); DBUG_PRINT("info",("spider hash key=%s", str->c_ptr()));
DBUG_PRINT("info",("spider hash key length=%u", str->length())); DBUG_PRINT("info",("spider hash key length=%u", str->length()));
hash_value = my_calc_hash( hash_value = my_calc_hash(
@@ -224,8 +224,8 @@ int spider_release_ping_table_mon_list(
conv_name_str.q_append(conv_name, conv_name_length); conv_name_str.q_append(conv_name, conv_name_length);
conv_name_str.q_append(link_idx_str, link_idx_str_length); conv_name_str.q_append(link_idx_str, link_idx_str_length);
mutex_hash = spider_udf_calc_hash(conv_name_str.c_ptr_safe(), mutex_hash= spider_udf_calc_hash(conv_name_str.c_ptr_safe(),
spider_param_udf_table_mon_mutex_count()); spider_udf_table_mon_mutex_count);
my_hash_value_type hash_value = my_calc_hash( my_hash_value_type hash_value = my_calc_hash(
&spider_udf_table_mon_list_hash[mutex_hash], &spider_udf_table_mon_list_hash[mutex_hash],
(uchar*) conv_name_str.c_ptr(), conv_name_str.length()); (uchar*) conv_name_str.c_ptr(), conv_name_str.length());

View File

@@ -4386,7 +4386,7 @@ SPIDER_SHARE *spider_create_share(
(uint) (sizeof(*tmp_cardinality_upd) * bitmap_size), (uint) (sizeof(*tmp_cardinality_upd) * bitmap_size),
&tmp_table_mon_mutex_bitmap, &tmp_table_mon_mutex_bitmap,
(uint) (sizeof(*tmp_table_mon_mutex_bitmap) * (uint) (sizeof(*tmp_table_mon_mutex_bitmap) *
((spider_param_udf_table_mon_mutex_count() + 7) / 8)), ((spider_udf_table_mon_mutex_count + 7) / 8)),
NullS)) NullS))
) { ) {
*error_num = HA_ERR_OUT_OF_MEM; *error_num = HA_ERR_OUT_OF_MEM;
@@ -4436,7 +4436,7 @@ SPIDER_SHARE *spider_create_share(
buf_pos = strmov(buf_pos, link_idx_str); buf_pos = strmov(buf_pos, link_idx_str);
*buf_pos = '\0'; *buf_pos = '\0';
spider_set_bit(tmp_table_mon_mutex_bitmap, spider_set_bit(tmp_table_mon_mutex_bitmap,
spider_udf_calc_hash(buf, spider_param_udf_table_mon_mutex_count()) spider_udf_calc_hash(buf, spider_udf_table_mon_mutex_count)
); );
} }
@@ -4667,7 +4667,7 @@ SPIDER_SHARE *spider_get_share(
{ {
pthread_mutex_lock(&share->mutex); pthread_mutex_lock(&share->mutex);
for (roop_count = 0; for (roop_count = 0;
roop_count < (int) spider_param_udf_table_mon_mutex_count(); roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++ roop_count++
) { ) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -4699,7 +4699,7 @@ SPIDER_SHARE *spider_get_share(
FALSE, error_num)) FALSE, error_num))
) { ) {
for (roop_count = 0; for (roop_count = 0;
roop_count < (int) spider_param_udf_table_mon_mutex_count(); roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++ roop_count++
) { ) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -4721,7 +4721,7 @@ SPIDER_SHARE *spider_get_share(
*error_num != HA_ERR_END_OF_FILE *error_num != HA_ERR_END_OF_FILE
) { ) {
for (roop_count = 0; for (roop_count = 0;
roop_count < (int) spider_param_udf_table_mon_mutex_count(); roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++ roop_count++
) { ) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -4754,7 +4754,7 @@ SPIDER_SHARE *spider_get_share(
} }
} }
for (roop_count = 0; for (roop_count = 0;
roop_count < (int) spider_param_udf_table_mon_mutex_count(); roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++ roop_count++
) { ) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -5147,7 +5147,7 @@ SPIDER_SHARE *spider_get_share(
{ {
pthread_mutex_lock(&share->mutex); pthread_mutex_lock(&share->mutex);
for (roop_count = 0; for (roop_count = 0;
roop_count < (int) spider_param_udf_table_mon_mutex_count(); roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++ roop_count++
) { ) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -5180,7 +5180,7 @@ SPIDER_SHARE *spider_get_share(
FALSE, error_num)) FALSE, error_num))
) { ) {
for (roop_count = 0; for (roop_count = 0;
roop_count < (int) spider_param_udf_table_mon_mutex_count(); roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++ roop_count++
) { ) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -5199,7 +5199,7 @@ SPIDER_SHARE *spider_get_share(
*error_num != HA_ERR_END_OF_FILE *error_num != HA_ERR_END_OF_FILE
) { ) {
for (roop_count = 0; for (roop_count = 0;
roop_count < (int) spider_param_udf_table_mon_mutex_count(); roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++ roop_count++
) { ) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -5229,7 +5229,7 @@ SPIDER_SHARE *spider_get_share(
} }
} }
for (roop_count = 0; for (roop_count = 0;
roop_count < (int) spider_param_udf_table_mon_mutex_count(); roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++ roop_count++
) { ) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count)) if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -6399,7 +6399,7 @@ int spider_db_done(
} }
spider_free(NULL, spider_table_sts_threads, MYF(0)); spider_free(NULL, spider_table_sts_threads, MYF(0));
for (roop_count = spider_param_udf_table_mon_mutex_count() - 1; for (roop_count= spider_udf_table_mon_mutex_count - 1;
roop_count >= 0; roop_count--) roop_count >= 0; roop_count--)
{ {
while ((table_mon_list = (SPIDER_TABLE_MON_LIST *) my_hash_element( while ((table_mon_list = (SPIDER_TABLE_MON_LIST *) my_hash_element(
@@ -6415,10 +6415,10 @@ int spider_db_done(
spider_udf_table_mon_list_hash[roop_count].array.size_of_element); spider_udf_table_mon_list_hash[roop_count].array.size_of_element);
my_hash_free(&spider_udf_table_mon_list_hash[roop_count]); my_hash_free(&spider_udf_table_mon_list_hash[roop_count]);
} }
for (roop_count = spider_param_udf_table_mon_mutex_count() - 1; for (roop_count= spider_udf_table_mon_mutex_count - 1;
roop_count >= 0; roop_count--) roop_count >= 0; roop_count--)
pthread_cond_destroy(&spider_udf_table_mon_conds[roop_count]); pthread_cond_destroy(&spider_udf_table_mon_conds[roop_count]);
for (roop_count = spider_param_udf_table_mon_mutex_count() - 1; for (roop_count= spider_udf_table_mon_mutex_count - 1;
roop_count >= 0; roop_count--) roop_count >= 0; roop_count--)
pthread_mutex_destroy(&spider_udf_table_mon_mutexes[roop_count]); pthread_mutex_destroy(&spider_udf_table_mon_mutexes[roop_count]);
spider_free(NULL, spider_udf_table_mon_mutexes, MYF(0)); spider_free(NULL, spider_udf_table_mon_mutexes, MYF(0));
@@ -6768,17 +6768,17 @@ int spider_db_init(
if (!(spider_udf_table_mon_mutexes = (pthread_mutex_t *) if (!(spider_udf_table_mon_mutexes = (pthread_mutex_t *)
spider_bulk_malloc(NULL, 53, MYF(MY_WME | MY_ZEROFILL), spider_bulk_malloc(NULL, 53, MYF(MY_WME | MY_ZEROFILL),
&spider_udf_table_mon_mutexes, (uint) (sizeof(pthread_mutex_t) * &spider_udf_table_mon_mutexes, (uint) (sizeof(pthread_mutex_t) *
spider_param_udf_table_mon_mutex_count()), spider_udf_table_mon_mutex_count),
&spider_udf_table_mon_conds, (uint) (sizeof(pthread_cond_t) * &spider_udf_table_mon_conds, (uint) (sizeof(pthread_cond_t) *
spider_param_udf_table_mon_mutex_count()), spider_udf_table_mon_mutex_count),
&spider_udf_table_mon_list_hash, (uint) (sizeof(HASH) * &spider_udf_table_mon_list_hash, (uint) (sizeof(HASH) *
spider_param_udf_table_mon_mutex_count()), spider_udf_table_mon_mutex_count),
NullS)) NullS))
) )
goto error_alloc_mon_mutxes; goto error_alloc_mon_mutxes;
for (roop_count = 0; for (roop_count = 0;
roop_count < (int) spider_param_udf_table_mon_mutex_count(); roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++) roop_count++)
{ {
if (mysql_mutex_init(spd_key_mutex_udf_table_mon, if (mysql_mutex_init(spd_key_mutex_udf_table_mon,
@@ -6786,7 +6786,7 @@ int spider_db_init(
goto error_init_udf_table_mon_mutex; goto error_init_udf_table_mon_mutex;
} }
for (roop_count = 0; for (roop_count = 0;
roop_count < (int) spider_param_udf_table_mon_mutex_count(); roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++) roop_count++)
{ {
if (mysql_cond_init(spd_key_cond_udf_table_mon, if (mysql_cond_init(spd_key_cond_udf_table_mon,
@@ -6794,7 +6794,7 @@ int spider_db_init(
goto error_init_udf_table_mon_cond; goto error_init_udf_table_mon_cond;
} }
for (roop_count = 0; for (roop_count = 0;
roop_count < (int) spider_param_udf_table_mon_mutex_count(); roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++) roop_count++)
{ {
if (my_hash_init(PSI_INSTRUMENT_ME, &spider_udf_table_mon_list_hash[roop_count], if (my_hash_init(PSI_INSTRUMENT_ME, &spider_udf_table_mon_list_hash[roop_count],
@@ -6880,7 +6880,7 @@ error_init_table_sts_threads:
spider_free_sts_threads(&spider_table_sts_threads[roop_count]); spider_free_sts_threads(&spider_table_sts_threads[roop_count]);
} }
spider_free(NULL, spider_table_sts_threads, MYF(0)); spider_free(NULL, spider_table_sts_threads, MYF(0));
roop_count = spider_param_udf_table_mon_mutex_count() - 1; roop_count= spider_udf_table_mon_mutex_count - 1;
error_init_udf_table_mon_list_hash: error_init_udf_table_mon_list_hash:
for (; roop_count >= 0; roop_count--) for (; roop_count >= 0; roop_count--)
{ {
@@ -6890,11 +6890,11 @@ error_init_udf_table_mon_list_hash:
spider_udf_table_mon_list_hash[roop_count].array.size_of_element); spider_udf_table_mon_list_hash[roop_count].array.size_of_element);
my_hash_free(&spider_udf_table_mon_list_hash[roop_count]); my_hash_free(&spider_udf_table_mon_list_hash[roop_count]);
} }
roop_count = spider_param_udf_table_mon_mutex_count() - 1; roop_count= spider_udf_table_mon_mutex_count - 1;
error_init_udf_table_mon_cond: error_init_udf_table_mon_cond:
for (; roop_count >= 0; roop_count--) for (; roop_count >= 0; roop_count--)
pthread_cond_destroy(&spider_udf_table_mon_conds[roop_count]); pthread_cond_destroy(&spider_udf_table_mon_conds[roop_count]);
roop_count = spider_param_udf_table_mon_mutex_count() - 1; roop_count= spider_udf_table_mon_mutex_count - 1;
error_init_udf_table_mon_mutex: error_init_udf_table_mon_mutex:
for (; roop_count >= 0; roop_count--) for (; roop_count >= 0; roop_count--)
pthread_mutex_destroy(&spider_udf_table_mon_mutexes[roop_count]); pthread_mutex_destroy(&spider_udf_table_mon_mutexes[roop_count]);

View File

@@ -1123,7 +1123,7 @@ int spider_free_trx_alloc(
spider_free_tmp_share_alloc(trx->tmp_share); spider_free_tmp_share_alloc(trx->tmp_share);
} }
spider_db_udf_free_set_names(trx); spider_db_udf_free_set_names(trx);
for (roop_count = spider_param_udf_table_lock_mutex_count() - 1; for (roop_count = spider_udf_table_lock_mutex_count - 1;
roop_count >= 0; roop_count--) roop_count >= 0; roop_count--)
pthread_mutex_destroy(&trx->udf_table_mutexes[roop_count]); pthread_mutex_destroy(&trx->udf_table_mutexes[roop_count]);
spider_free_trx_ha(trx); spider_free_trx_ha(trx);
@@ -1176,7 +1176,7 @@ SPIDER_TRX *spider_get_trx(
&tmp_share, (uint) (sizeof(SPIDER_SHARE)), &tmp_share, (uint) (sizeof(SPIDER_SHARE)),
&tmp_wide_handler, (uint) sizeof(SPIDER_WIDE_HANDLER), &tmp_wide_handler, (uint) sizeof(SPIDER_WIDE_HANDLER),
&udf_table_mutexes, (uint) (sizeof(pthread_mutex_t) * &udf_table_mutexes, (uint) (sizeof(pthread_mutex_t) *
spider_param_udf_table_lock_mutex_count()), spider_udf_table_lock_mutex_count),
NullS)) NullS))
) )
goto error_alloc_trx; goto error_alloc_trx;
@@ -1186,7 +1186,7 @@ SPIDER_TRX *spider_get_trx(
trx->udf_table_mutexes = udf_table_mutexes; trx->udf_table_mutexes = udf_table_mutexes;
for (roop_count = 0; for (roop_count = 0;
roop_count < (int) spider_param_udf_table_lock_mutex_count(); roop_count < (int) spider_udf_table_lock_mutex_count;
roop_count++) roop_count++)
{ {
if (mysql_mutex_init(spd_key_mutex_udf_table, if (mysql_mutex_init(spd_key_mutex_udf_table,