Commit e1d31a10 authored by Yuchen Pei's avatar Yuchen Pei

MDEV-31524 Fixing spider table param / variable overriding

The existing (incorrect) overriding mechanism is:

Non-minus-one var value overrides table param overrides default value.

Before MDEV-27169, unspecified var value is -1. So if the user sets
both the var to be a value other than -1 and the table param, the var
value will prevail, which is incorrect.

After MDEV-27169, unspecified var value is default value. So if the
user does not set the var but sets the table param, the default value
will prevail, which is even more incorrect.

This patch fixes it so that table param, if specified, always
overrides var value, and the latter if not specified or set to -1,
falls back to the default value

We achieve this by replacing all such overriding in spd_param.cc with
macros that override in the correct way, and removing all the
"overriding -1" lines involving table params in
spider_set_connect_info_default() except for those table params not
defined as sysvar/thdvar in spd_params.cc

We also introduced macros for non-overriding sysvar and thdvar, so
that the code is cleaner and less error-prone

In server versions where MDEV-27169 has not been applied, we also
backport the patch, that is, replacing -1 default values with real
default values

In server versions where MDEV-28006 has not been applied, we do the
same for udf params
parent 7dde504a
MDEV-31524 Spider variables that double as table params overriding mechanism is buggy
for master_1
for child2
for child3
SET @old_spider_read_only_mode = @@session.spider_read_only_mode;
CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
set session spider_read_only_mode = default;
create table t2 (c int);
create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
/* 1 */ insert into t1 values (42);
drop table t1, t2;
set session spider_read_only_mode = 1;
create table t2 (c int);
create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
/* 2 */ insert into t1 values (42);
ERROR HY000: Table 'test.t1' is read only
drop table t1, t2;
set session spider_read_only_mode = -1;
create table t2 (c int);
create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
/* 3 */ insert into t1 values (42);
drop table t1, t2;
SET session spider_read_only_mode = default;
create table t2 (c int);
create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
/* 4 */ insert into t1 values (42);
ERROR HY000: Table 'test.t1' is read only
drop table t1, t2;
set session spider_read_only_mode = 1;
create table t2 (c int);
create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "0", WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
/* 5 */ insert into t1 values (42);
drop table t1, t2;
SET session spider_read_only_mode = -1;
create table t2 (c int);
create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
/* 6 */ insert into t1 values (42);
ERROR HY000: Table 'test.t1' is read only
drop table t1, t2;
drop server srv_mdev_31524;
SET session spider_read_only_mode = @old_spider_read_only_mode;
for master_1
for child2
for child3
--echo
--echo MDEV-31524 Spider variables that double as table params overriding mechanism is buggy
--echo
--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
--let $srv=srv_mdev_31524
SET @old_spider_read_only_mode = @@session.spider_read_only_mode;
evalp CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
# when the user does not set var nor the table option, the default
# value (0 in this case) takes effect.
set session spider_read_only_mode = default;
create table t2 (c int);
eval create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "$srv",TABLE "t2"';
/* 1 */ insert into t1 values (42);
drop table t1, t2;
# when the user sets var but not the table option, the var should be
# take effect.
set session spider_read_only_mode = 1;
create table t2 (c int);
eval create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "$srv",TABLE "t2"';
--error 12518
/* 2 */ insert into t1 values (42);
drop table t1, t2;
# when the user sets var to -1 and does not set the table option, the
# default value takes effect.
set session spider_read_only_mode = -1;
create table t2 (c int);
eval create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "$srv",TABLE "t2"';
/* 3 */ insert into t1 values (42);
drop table t1, t2;
# when the user does not set the var, but sets the table option, the
# table option should take effect
SET session spider_read_only_mode = default;
create table t2 (c int);
eval create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "$srv",TABLE "t2"';
--error 12518
/* 4 */ insert into t1 values (42);
drop table t1, t2;
# when the user sets both var and table option, the table option
# should take precedence
set session spider_read_only_mode = 1;
create table t2 (c int);
eval create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "0", WRAPPER "mysql", srv "$srv",TABLE "t2"';
/* 5 */ insert into t1 values (42);
drop table t1, t2;
# when the user sets the var to -1 and sets the table option, the
# table option should take effect
SET session spider_read_only_mode = -1;
create table t2 (c int);
eval create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "$srv",TABLE "t2"';
--error 12518
/* 6 */ insert into t1 values (42);
drop table t1, t2;
eval drop server $srv;
SET session spider_read_only_mode = @old_spider_read_only_mode;
--disable_query_log
--disable_result_log
--source ../../t/test_deinit.inc
--enable_result_log
--enable_query_log
...@@ -64,12 +64,6 @@ int spider_udf_set_copy_tables_param_default( ...@@ -64,12 +64,6 @@ int spider_udf_set_copy_tables_param_default(
} }
} }
if (copy_tables->bulk_insert_interval == -1)
copy_tables->bulk_insert_interval = 10;
if (copy_tables->bulk_insert_rows == -1)
copy_tables->bulk_insert_rows = 100;
if (copy_tables->use_table_charset == -1)
copy_tables->use_table_charset = 1;
if (copy_tables->use_transaction == -1) if (copy_tables->use_transaction == -1)
copy_tables->use_transaction = 1; copy_tables->use_transaction = 1;
#ifndef WITHOUT_SPIDER_BG_SEARCH #ifndef WITHOUT_SPIDER_BG_SEARCH
......
...@@ -11559,7 +11559,7 @@ int spider_db_udf_copy_tables( ...@@ -11559,7 +11559,7 @@ int spider_db_udf_copy_tables(
error_num = result->get_errno(); error_num = result->get_errno();
if (error_num == HA_ERR_END_OF_FILE) if (error_num == HA_ERR_END_OF_FILE)
{ {
if (roop_count < copy_tables->bulk_insert_rows) if (roop_count < bulk_insert_rows)
{ {
end_of_file = TRUE; end_of_file = TRUE;
if (roop_count) if (roop_count)
...@@ -11583,8 +11583,6 @@ int spider_db_udf_copy_tables( ...@@ -11583,8 +11583,6 @@ 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(
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) ||
......
...@@ -1451,25 +1451,10 @@ int spider_udf_set_direct_sql_param_default( ...@@ -1451,25 +1451,10 @@ int spider_udf_set_direct_sql_param_default(
} }
} }
if (direct_sql->table_loop_mode == -1)
direct_sql->table_loop_mode = 0;
if (direct_sql->priority == -1) if (direct_sql->priority == -1)
direct_sql->priority = 1000000; direct_sql->priority = 1000000;
if (direct_sql->connect_timeout == -1)
direct_sql->connect_timeout = 6;
if (direct_sql->net_read_timeout == -1)
direct_sql->net_read_timeout = 600;
if (direct_sql->net_write_timeout == -1)
direct_sql->net_write_timeout = 600;
if (direct_sql->bulk_insert_rows == -1)
direct_sql->bulk_insert_rows = 3000;
if (direct_sql->connection_channel == -1) if (direct_sql->connection_channel == -1)
direct_sql->connection_channel = 0; direct_sql->connection_channel = 0;
#if MYSQL_VERSION_ID < 50500
#else
if (direct_sql->use_real_table == -1)
direct_sql->use_real_table = 0;
#endif
if (direct_sql->error_rw_mode == -1) if (direct_sql->error_rw_mode == -1)
direct_sql->error_rw_mode = 0; direct_sql->error_rw_mode = 0;
for (roop_count = 0; roop_count < direct_sql->table_count; roop_count++) for (roop_count = 0; roop_count < direct_sql->table_count; roop_count++)
......
/* Copyright (C) 2008-2018 Kentoku Shiba /* Copyright (C) 2008-2018 Kentoku Shiba
Copyright (C) 2023 MariaDB plc
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -13,6 +14,26 @@ ...@@ -13,6 +14,26 @@
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 */
/**
@file
There are several kinds of spider parameters.
- sysvar/thdvar that are not table parameters. These variables do
not appear in a `SPIDER_SHARE`. Examples include `support_xa` and
`conn_recycle_mode`. Their values are commonly retrieved by
`SPIDER_SYSVAR_VALUE_FUNC()` and `SPIDER_THDVAR_VALUE_FUNC()`
- sysvar/thdvar that are also table parameters. These variables
commonly appear in a `SPIDER_SHARE`. Examples include
`read_only_mode` and `use_table_charset`. Table parameter values
override variable values, and their values are commonly retrieved
by `SPIDER_SYSVAR_OVERRIDE_VALUE_FUNC()` and
`SPIDER_THDVAR_OVERRIDE_VALUE_FUNC()`.
- table parameters that are not sysvar/thdvar. Examples include
host and username. They are not handled in this file which is only
concerned with global/session variables
*/
#define MYSQL_SERVER 1 #define MYSQL_SERVER 1
#include <my_global.h> #include <my_global.h>
#include "mysql_version.h" #include "mysql_version.h"
...@@ -42,6 +63,57 @@ extern struct st_maria_plugin spider_i_s_alloc_mem_maria; ...@@ -42,6 +63,57 @@ extern struct st_maria_plugin spider_i_s_alloc_mem_maria;
extern volatile ulonglong spider_mon_table_cache_version; extern volatile ulonglong spider_mon_table_cache_version;
extern volatile ulonglong spider_mon_table_cache_version_req; extern volatile ulonglong spider_mon_table_cache_version_req;
/*
Define a function returning the value of a global variable.
*/
#define SPIDER_SYSVAR_VALUE_FUNC(param_type, param_name) \
param_type spider_param_ ## param_name() \
{ \
return SYSVAR(param_name); \
}
/*
Define a function returning the value of a session variable.
*/
#define SPIDER_THDVAR_VALUE_FUNC(param_type, param_name) \
param_type spider_param_ ## param_name(THD *thd) \
{ \
return THDVAR(thd, param_name); \
}
/*
Define a function returning the value of a table param that is also a
global variable.
If the table param value is not -1, use the table param value.
Otherwise if the variable value is not -1, use the variable value.
Otherwise use the default variable value.
*/
#define SPIDER_SYSVAR_OVERRIDE_VALUE_FUNC(param_type, param_name) \
param_type spider_param_ ## param_name(param_type param_name) \
{ \
return param_name != -1 ? param_name : \
SYSVAR(param_name) != -1 ? SYSVAR(param_name) : \
MYSQL_SYSVAR_NAME(param_name).def_val; \
}
/*
Define a function returning the value of a table param that is also a
session variable.
If the table param value is not -1, use the table param value.
Otherwise if the variable value is not -1, use the variable value.
Otherwise use the default variable value.
*/
#define SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(param_type, param_name) \
param_type spider_param_ ## param_name(THD* thd, \
param_type param_name) \
{ \
return param_name != -1 ? param_name : \
THDVAR(thd, param_name) != -1 ? THDVAR(thd, param_name) : \
MYSQL_SYSVAR_NAME(param_name).def_val; \
}
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS #ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
static int spider_direct_update(THD *thd, SHOW_VAR *var, char *buff) static int spider_direct_update(THD *thd, SHOW_VAR *var, char *buff)
{ {
...@@ -172,11 +244,7 @@ static MYSQL_SYSVAR_BOOL( ...@@ -172,11 +244,7 @@ static MYSQL_SYSVAR_BOOL(
TRUE TRUE
); );
my_bool spider_param_support_xa() SPIDER_SYSVAR_VALUE_FUNC(my_bool, support_xa)
{
DBUG_ENTER("spider_param_support_xa");
DBUG_RETURN(spider_support_xa);
}
static my_bool spider_connect_mutex; static my_bool spider_connect_mutex;
static MYSQL_SYSVAR_BOOL( static MYSQL_SYSVAR_BOOL(
...@@ -189,11 +257,7 @@ static MYSQL_SYSVAR_BOOL( ...@@ -189,11 +257,7 @@ static MYSQL_SYSVAR_BOOL(
FALSE FALSE
); );
my_bool spider_param_connect_mutex() SPIDER_SYSVAR_VALUE_FUNC(my_bool, connect_mutex)
{
DBUG_ENTER("spider_param_connect_mutex");
DBUG_RETURN(spider_connect_mutex);
}
static uint spider_connect_error_interval; static uint spider_connect_error_interval;
/* /*
...@@ -212,11 +276,7 @@ static MYSQL_SYSVAR_UINT( ...@@ -212,11 +276,7 @@ static MYSQL_SYSVAR_UINT(
0 0
); );
uint spider_param_connect_error_interval() SPIDER_SYSVAR_VALUE_FUNC(uint, connect_error_interval)
{
DBUG_ENTER("spider_param_connect_error_interval");
DBUG_RETURN(spider_connect_error_interval);
}
static uint spider_table_init_error_interval; static uint spider_table_init_error_interval;
/* /*
...@@ -235,15 +295,11 @@ static MYSQL_SYSVAR_UINT( ...@@ -235,15 +295,11 @@ static MYSQL_SYSVAR_UINT(
0 0
); );
uint spider_param_table_init_error_interval() SPIDER_SYSVAR_VALUE_FUNC(uint, table_init_error_interval)
{
DBUG_ENTER("spider_param_table_init_error_interval");
DBUG_RETURN(spider_table_init_error_interval);
}
static int spider_use_table_charset; static int spider_use_table_charset;
/* /*
-1 :use table parameter -1 :fallback to default
0 :use utf8 0 :use utf8
1 :use table charset 1 :use table charset
*/ */
...@@ -254,19 +310,13 @@ static MYSQL_SYSVAR_INT( ...@@ -254,19 +310,13 @@ static MYSQL_SYSVAR_INT(
"Use table charset for remote access", "Use table charset for remote access",
NULL, NULL,
NULL, NULL,
-1, 1,
-1, -1,
1, 1,
0 0
); );
int spider_param_use_table_charset( SPIDER_SYSVAR_OVERRIDE_VALUE_FUNC(int, use_table_charset)
int use_table_charset
) {
DBUG_ENTER("spider_param_use_table_charset");
DBUG_RETURN(spider_use_table_charset == -1 ?
use_table_charset : spider_use_table_charset);
}
/* /*
0: no recycle 0: no recycle
...@@ -285,12 +335,7 @@ static MYSQL_THDVAR_UINT( ...@@ -285,12 +335,7 @@ static MYSQL_THDVAR_UINT(
0 /* blk */ 0 /* blk */
); );
uint spider_param_conn_recycle_mode( SPIDER_THDVAR_VALUE_FUNC(uint, conn_recycle_mode)
THD *thd
) {
DBUG_ENTER("spider_param_conn_recycle_mode");
DBUG_RETURN(THDVAR(thd, conn_recycle_mode));
}
/* /*
0: weak 0: weak
...@@ -308,12 +353,7 @@ static MYSQL_THDVAR_UINT( ...@@ -308,12 +353,7 @@ static MYSQL_THDVAR_UINT(
0 /* blk */ 0 /* blk */
); );
uint spider_param_conn_recycle_strict( SPIDER_THDVAR_VALUE_FUNC(uint, conn_recycle_strict)
THD *thd
) {
DBUG_ENTER("spider_param_conn_recycle_strict");
DBUG_RETURN(THDVAR(thd, conn_recycle_strict));
}
/* /*
FALSE: no sync FALSE: no sync
...@@ -328,12 +368,7 @@ static MYSQL_THDVAR_BOOL( ...@@ -328,12 +368,7 @@ static MYSQL_THDVAR_BOOL(
TRUE /* def */ TRUE /* def */
); );
bool spider_param_sync_trx_isolation( SPIDER_THDVAR_VALUE_FUNC(bool, sync_trx_isolation)
THD *thd
) {
DBUG_ENTER("spider_param_sync_trx_isolation");
DBUG_RETURN(THDVAR(thd, sync_trx_isolation));
}
/* /*
FALSE: no use FALSE: no use
...@@ -348,12 +383,7 @@ static MYSQL_THDVAR_BOOL( ...@@ -348,12 +383,7 @@ static MYSQL_THDVAR_BOOL(
FALSE /* def */ FALSE /* def */
); );
bool spider_param_use_consistent_snapshot( SPIDER_THDVAR_VALUE_FUNC(bool, use_consistent_snapshot)
THD *thd
) {
DBUG_ENTER("spider_param_use_consistent_snapshot");
DBUG_RETURN(THDVAR(thd, use_consistent_snapshot));
}
/* /*
FALSE: off FALSE: off
...@@ -368,12 +398,7 @@ static MYSQL_THDVAR_BOOL( ...@@ -368,12 +398,7 @@ static MYSQL_THDVAR_BOOL(
FALSE /* def */ FALSE /* def */
); );
bool spider_param_internal_xa( SPIDER_THDVAR_VALUE_FUNC(bool, internal_xa)
THD *thd
) {
DBUG_ENTER("spider_param_internal_xa");
DBUG_RETURN(THDVAR(thd, internal_xa));
}
/* /*
0 :err when use a spider table 0 :err when use a spider table
...@@ -393,12 +418,7 @@ static MYSQL_THDVAR_UINT( ...@@ -393,12 +418,7 @@ static MYSQL_THDVAR_UINT(
0 /* blk */ 0 /* blk */
); );
uint spider_param_internal_xa_snapshot( SPIDER_THDVAR_VALUE_FUNC(uint, internal_xa_snapshot)
THD *thd
) {
DBUG_ENTER("spider_param_internal_xa_snapshot");
DBUG_RETURN(THDVAR(thd, internal_xa_snapshot));
}
/* /*
0 :off 0 :off
...@@ -417,12 +437,7 @@ static MYSQL_THDVAR_UINT( ...@@ -417,12 +437,7 @@ static MYSQL_THDVAR_UINT(
0 /* blk */ 0 /* blk */
); );
uint spider_param_force_commit( SPIDER_THDVAR_VALUE_FUNC(uint, force_commit)
THD *thd
) {
DBUG_ENTER("spider_param_force_commit");
DBUG_RETURN(THDVAR(thd, force_commit));
}
/* /*
0: register all XA transaction 0: register all XA transaction
...@@ -440,15 +455,10 @@ static MYSQL_THDVAR_UINT( ...@@ -440,15 +455,10 @@ static MYSQL_THDVAR_UINT(
0 /* blk */ 0 /* blk */
); );
uint spider_param_xa_register_mode( SPIDER_THDVAR_VALUE_FUNC(uint, xa_register_mode)
THD *thd
) {
DBUG_ENTER("spider_param_xa_register_mode");
DBUG_RETURN(THDVAR(thd, xa_register_mode));
}
/* /*
-1 :use table parameter -1 :fallback to default
0-:offset 0-:offset
*/ */
static MYSQL_THDVAR_LONGLONG( static MYSQL_THDVAR_LONGLONG(
...@@ -457,23 +467,16 @@ static MYSQL_THDVAR_LONGLONG( ...@@ -457,23 +467,16 @@ static MYSQL_THDVAR_LONGLONG(
"Internal offset", /* comment */ "Internal offset", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
9223372036854775807LL, /* max */ 9223372036854775807LL, /* max */
0 /* blk */ 0 /* blk */
); );
longlong spider_param_internal_offset( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(longlong, internal_offset)
THD *thd,
longlong internal_offset
) {
DBUG_ENTER("spider_param_internal_offset");
DBUG_RETURN(THDVAR(thd, internal_offset) < 0 ?
internal_offset : THDVAR(thd, internal_offset));
}
/* /*
-1 :use table parameter -1 :fallback to default
0-:limit 0-:limit
*/ */
static MYSQL_THDVAR_LONGLONG( static MYSQL_THDVAR_LONGLONG(
...@@ -482,23 +485,16 @@ static MYSQL_THDVAR_LONGLONG( ...@@ -482,23 +485,16 @@ static MYSQL_THDVAR_LONGLONG(
"Internal limit", /* comment */ "Internal limit", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 9223372036854775807LL, /* def */
-1, /* min */ -1, /* min */
9223372036854775807LL, /* max */ 9223372036854775807LL, /* max */
0 /* blk */ 0 /* blk */
); );
longlong spider_param_internal_limit( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(longlong, internal_limit)
THD *thd,
longlong internal_limit
) {
DBUG_ENTER("spider_param_internal_limit");
DBUG_RETURN(THDVAR(thd, internal_limit) < 0 ?
internal_limit : THDVAR(thd, internal_limit));
}
/* /*
-1 :use table parameter -1 :fallback to default
0-:number of rows at a select 0-:number of rows at a select
*/ */
static MYSQL_THDVAR_LONGLONG( static MYSQL_THDVAR_LONGLONG(
...@@ -507,23 +503,16 @@ static MYSQL_THDVAR_LONGLONG( ...@@ -507,23 +503,16 @@ static MYSQL_THDVAR_LONGLONG(
"Number of rows at a select", /* comment */ "Number of rows at a select", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 9223372036854775807LL, /* def */
-1, /* min */ -1, /* min */
9223372036854775807LL, /* max */ 9223372036854775807LL, /* max */
0 /* blk */ 0 /* blk */
); );
longlong spider_param_split_read( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(longlong, split_read)
THD *thd,
longlong split_read
) {
DBUG_ENTER("spider_param_split_read");
DBUG_RETURN(THDVAR(thd, split_read) < 0 ?
split_read : THDVAR(thd, split_read));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :doesn't use "offset" and "limit" for "split_read" 0 :doesn't use "offset" and "limit" for "split_read"
1-:magnification 1-:magnification
*/ */
...@@ -533,23 +522,16 @@ static MYSQL_THDVAR_INT( ...@@ -533,23 +522,16 @@ static MYSQL_THDVAR_INT(
"Use offset and limit parameter in SQL for split_read parameter.", /* comment */ "Use offset and limit parameter in SQL for split_read parameter.", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 2, /* def */
-1, /* min */ -1, /* min */
2147483647, /* max */ 2147483647, /* max */
0 /* blk */ 0 /* blk */
); );
double spider_param_semi_split_read( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(double, semi_split_read)
THD *thd,
double semi_split_read
) {
DBUG_ENTER("spider_param_semi_split_read");
DBUG_RETURN(THDVAR(thd, semi_split_read) < 0 ?
semi_split_read : THDVAR(thd, semi_split_read));
}
/* /*
-1 :use table parameter -1 :fallback to default
0-:the limit value 0-:the limit value
*/ */
static MYSQL_THDVAR_LONGLONG( static MYSQL_THDVAR_LONGLONG(
...@@ -558,23 +540,16 @@ static MYSQL_THDVAR_LONGLONG( ...@@ -558,23 +540,16 @@ static MYSQL_THDVAR_LONGLONG(
"The limit value for semi_split_read", /* comment */ "The limit value for semi_split_read", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 9223372036854775807LL, /* def */
-1, /* min */ -1, /* min */
9223372036854775807LL, /* max */ 9223372036854775807LL, /* max */
0 /* blk */ 0 /* blk */
); );
longlong spider_param_semi_split_read_limit( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(longlong, semi_split_read_limit)
THD *thd,
longlong semi_split_read_limit
) {
DBUG_ENTER("spider_param_semi_split_read_limit");
DBUG_RETURN(THDVAR(thd, semi_split_read_limit) < 0 ?
semi_split_read_limit : THDVAR(thd, semi_split_read_limit));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :no alloc 0 :no alloc
1-:alloc size 1-:alloc size
*/ */
...@@ -584,23 +559,16 @@ static MYSQL_THDVAR_INT( ...@@ -584,23 +559,16 @@ static MYSQL_THDVAR_INT(
"Initial sql string alloc size", /* comment */ "Initial sql string alloc size", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 1024, /* def */
-1, /* min */ -1, /* min */
2147483647, /* max */ 2147483647, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_init_sql_alloc_size( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, init_sql_alloc_size)
THD *thd,
int init_sql_alloc_size
) {
DBUG_ENTER("spider_param_init_sql_alloc_size");
DBUG_RETURN(THDVAR(thd, init_sql_alloc_size) < 0 ?
init_sql_alloc_size : THDVAR(thd, init_sql_alloc_size));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :off 0 :off
1 :on 1 :on
*/ */
...@@ -610,24 +578,17 @@ static MYSQL_THDVAR_INT( ...@@ -610,24 +578,17 @@ static MYSQL_THDVAR_INT(
"Reset sql string alloc after execute", /* comment */ "Reset sql string alloc after execute", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 1, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_reset_sql_alloc( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, reset_sql_alloc)
THD *thd,
int reset_sql_alloc
) {
DBUG_ENTER("spider_param_reset_sql_alloc");
DBUG_RETURN(THDVAR(thd, reset_sql_alloc) < 0 ?
reset_sql_alloc : THDVAR(thd, reset_sql_alloc));
}
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
/* /*
-1 :use table parameter -1 :fallback to default
0-:result free size for handlersocket 0-:result free size for handlersocket
*/ */
static MYSQL_THDVAR_LONGLONG( static MYSQL_THDVAR_LONGLONG(
...@@ -636,24 +597,17 @@ static MYSQL_THDVAR_LONGLONG( ...@@ -636,24 +597,17 @@ static MYSQL_THDVAR_LONGLONG(
"Result free size for handlersocket", /* comment */ "Result free size for handlersocket", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 1048576, /* def */
-1, /* min */ -1, /* min */
9223372036854775807LL, /* max */ 9223372036854775807LL, /* max */
0 /* blk */ 0 /* blk */
); );
longlong spider_param_hs_result_free_size( SPIDER_THDVAR_OVERRIDE_VALUE_FUN(longlong, hs_result_free_size)
THD *thd,
longlong hs_result_free_size
) {
DBUG_ENTER("spider_param_hs_result_free_size");
DBUG_RETURN(THDVAR(thd, hs_result_free_size) < 0 ?
hs_result_free_size : THDVAR(thd, hs_result_free_size));
}
#endif #endif
/* /*
-1 :use table parameter -1 :fallback to default
0 :off 0 :off
1 :on 1 :on
*/ */
...@@ -663,23 +617,16 @@ static MYSQL_THDVAR_INT( ...@@ -663,23 +617,16 @@ static MYSQL_THDVAR_INT(
"Sprit read mode for multi range", /* comment */ "Sprit read mode for multi range", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 100, /* def */
-1, /* min */ -1, /* min */
2147483647, /* max */ 2147483647, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_multi_split_read( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, multi_split_read)
THD *thd,
int multi_split_read
) {
DBUG_ENTER("spider_param_multi_split_read");
DBUG_RETURN(THDVAR(thd, multi_split_read) < 0 ?
multi_split_read : THDVAR(thd, multi_split_read));
}
/* /*
-1 :use table parameter -1 :fallback to default
0-:max order columns 0-:max order columns
*/ */
static MYSQL_THDVAR_INT( static MYSQL_THDVAR_INT(
...@@ -688,20 +635,13 @@ static MYSQL_THDVAR_INT( ...@@ -688,20 +635,13 @@ static MYSQL_THDVAR_INT(
"Max columns for order by", /* comment */ "Max columns for order by", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 32767, /* def */
-1, /* min */ -1, /* min */
32767, /* max */ 32767, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_max_order( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, max_order)
THD *thd,
int max_order
) {
DBUG_ENTER("spider_param_max_order");
DBUG_RETURN(THDVAR(thd, max_order) < 0 ?
max_order : THDVAR(thd, max_order));
}
/* /*
-1 :off -1 :off
...@@ -722,12 +662,7 @@ static MYSQL_THDVAR_INT( ...@@ -722,12 +662,7 @@ static MYSQL_THDVAR_INT(
0 /* blk */ 0 /* blk */
); );
int spider_param_semi_trx_isolation( SPIDER_THDVAR_VALUE_FUNC(int, semi_trx_isolation)
THD *thd
) {
DBUG_ENTER("spider_param_semi_trx_isolation");
DBUG_RETURN(THDVAR(thd, semi_trx_isolation));
}
static int spider_param_semi_table_lock_check( static int spider_param_semi_table_lock_check(
MYSQL_THD thd, MYSQL_THD thd,
...@@ -779,19 +714,13 @@ static MYSQL_THDVAR_INT( ...@@ -779,19 +714,13 @@ static MYSQL_THDVAR_INT(
"Table lock during execute a sql", /* comment */ "Table lock during execute a sql", /* comment */
&spider_param_semi_table_lock_check, /* check */ &spider_param_semi_table_lock_check, /* check */
NULL, /* update */ NULL, /* update */
1, /* def */ 0, /* def */
0, /* min */ 0, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_semi_table_lock( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, semi_table_lock)
THD *thd,
int semi_table_lock
) {
DBUG_ENTER("spider_param_semi_table_lock");
DBUG_RETURN((semi_table_lock & THDVAR(thd, semi_table_lock)));
}
static int spider_param_semi_table_lock_connection_check( static int spider_param_semi_table_lock_connection_check(
MYSQL_THD thd, MYSQL_THD thd,
...@@ -844,20 +773,13 @@ static MYSQL_THDVAR_INT( ...@@ -844,20 +773,13 @@ static MYSQL_THDVAR_INT(
"Use different connection if semi_table_lock is enabled", /* comment */ "Use different connection if semi_table_lock is enabled", /* comment */
&spider_param_semi_table_lock_connection_check, /* check */ &spider_param_semi_table_lock_connection_check, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 1, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_semi_table_lock_connection( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, semi_table_lock_connection)
THD *thd,
int semi_table_lock_connection
) {
DBUG_ENTER("spider_param_semi_table_lock_connection");
DBUG_RETURN(THDVAR(thd, semi_table_lock_connection) == -1 ?
semi_table_lock_connection : THDVAR(thd, semi_table_lock_connection));
}
/* /*
0-:block_size 0-:block_size
...@@ -874,15 +796,10 @@ static MYSQL_THDVAR_UINT( ...@@ -874,15 +796,10 @@ static MYSQL_THDVAR_UINT(
0 /* blk */ 0 /* blk */
); );
uint spider_param_block_size( SPIDER_THDVAR_VALUE_FUNC(uint, block_size)
THD *thd
) {
DBUG_ENTER("spider_param_block_size");
DBUG_RETURN(THDVAR(thd, block_size));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :off 0 :off
1 :lock in share mode 1 :lock in share mode
2 :for update 2 :for update
...@@ -893,20 +810,13 @@ static MYSQL_THDVAR_INT( ...@@ -893,20 +810,13 @@ static MYSQL_THDVAR_INT(
"Lock for select with update", /* comment */ "Lock for select with update", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 1, /* def */
-1, /* min */ -1, /* min */
2, /* max */ 2, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_selupd_lock_mode( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, selupd_lock_mode)
THD *thd,
int selupd_lock_mode
) {
DBUG_ENTER("spider_param_selupd_lock_mode");
DBUG_RETURN(THDVAR(thd, selupd_lock_mode) == -1 ?
selupd_lock_mode : THDVAR(thd, selupd_lock_mode));
}
/* /*
FALSE: no sync FALSE: no sync
...@@ -921,12 +831,7 @@ static MYSQL_THDVAR_BOOL( ...@@ -921,12 +831,7 @@ static MYSQL_THDVAR_BOOL(
TRUE /* def */ TRUE /* def */
); );
bool spider_param_sync_autocommit( SPIDER_THDVAR_VALUE_FUNC(bool, sync_autocommit)
THD *thd
) {
DBUG_ENTER("spider_param_sync_autocommit");
DBUG_RETURN(THDVAR(thd, sync_autocommit));
}
/* /*
FALSE: not use FALSE: not use
...@@ -941,12 +846,7 @@ static MYSQL_THDVAR_BOOL( ...@@ -941,12 +846,7 @@ static MYSQL_THDVAR_BOOL(
TRUE /* def */ TRUE /* def */
); );
bool spider_param_use_default_database( SPIDER_THDVAR_VALUE_FUNC(bool, use_default_database)
THD *thd
) {
DBUG_ENTER("spider_param_use_default_database");
DBUG_RETURN(THDVAR(thd, use_default_database));
}
/* /*
-1 :don't know or does not matter; don't send 'SET SQL_LOG_OFF' statement -1 :don't know or does not matter; don't send 'SET SQL_LOG_OFF' statement
...@@ -965,15 +865,10 @@ static MYSQL_THDVAR_INT( ...@@ -965,15 +865,10 @@ static MYSQL_THDVAR_INT(
0 /* blk */ 0 /* blk */
); );
int spider_param_internal_sql_log_off( SPIDER_THDVAR_VALUE_FUNC(int, internal_sql_log_off)
THD *thd
) {
DBUG_ENTER("spider_param_internal_sql_log_off");
DBUG_RETURN(THDVAR(thd, internal_sql_log_off));
}
/* /*
-1 :use table parameter -1 :fallback to default
0-:bulk insert size 0-:bulk insert size
*/ */
static MYSQL_THDVAR_INT( static MYSQL_THDVAR_INT(
...@@ -982,23 +877,16 @@ static MYSQL_THDVAR_INT( ...@@ -982,23 +877,16 @@ static MYSQL_THDVAR_INT(
"Bulk insert size", /* comment */ "Bulk insert size", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 16000, /* def */
-1, /* min */ -1, /* min */
2147483647, /* max */ 2147483647, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_bulk_size( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, bulk_size)
THD *thd,
int bulk_size
) {
DBUG_ENTER("spider_param_bulk_size");
DBUG_RETURN(THDVAR(thd, bulk_size) < 0 ?
bulk_size : THDVAR(thd, bulk_size));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 : Send "update" and "delete" statements one by one. 0 : Send "update" and "delete" statements one by one.
1 : Send collected multiple "update" and "delete" statements. 1 : Send collected multiple "update" and "delete" statements.
(Collected statements are sent one by one) (Collected statements are sent one by one)
...@@ -1011,23 +899,16 @@ static MYSQL_THDVAR_INT( ...@@ -1011,23 +899,16 @@ static MYSQL_THDVAR_INT(
"The mode of bulk updating and deleting", /* comment */ "The mode of bulk updating and deleting", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
2, /* max */ 2, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_bulk_update_mode( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, bulk_update_mode)
THD *thd,
int bulk_update_mode
) {
DBUG_ENTER("spider_param_bulk_update_mode");
DBUG_RETURN(THDVAR(thd, bulk_update_mode) == -1 ?
bulk_update_mode : THDVAR(thd, bulk_update_mode));
}
/* /*
-1 :use table parameter -1 :fallback to default
0-:bulk update size 0-:bulk update size
*/ */
static MYSQL_THDVAR_INT( static MYSQL_THDVAR_INT(
...@@ -1036,23 +917,24 @@ static MYSQL_THDVAR_INT( ...@@ -1036,23 +917,24 @@ static MYSQL_THDVAR_INT(
"Bulk update size", /* comment */ "Bulk update size", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 16000, /* def */
-1, /* min */ -1, /* min */
2147483647, /* max */ 2147483647, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_bulk_update_size( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, bulk_update_size)
THD *thd,
int bulk_update_size
) {
DBUG_ENTER("spider_param_bulk_update_size");
DBUG_RETURN(THDVAR(thd, bulk_update_size) == -1 ?
bulk_update_size : THDVAR(thd, bulk_update_size));
}
/* /*
-1 :use table parameter Notes on merge conflicts (remove after merging):
10.5: 48faa20db848012e2187a09e05aba832078cb82e
10.6: 51ff9eddf7c0aaf1e022fcb3b48ec36835df7785
10.9: 06a61b8e453126c2de1649073f247d34e85f9702
10.10: 90cd0c156f5bb53fd058d2bbfb83f850ffae6722
10.11+: 124eb662700708f3c4b0fb77968f8b854d6bb4aa
*/
/*
-1 :fallback to default
0 :off 0 :off
1 :on 1 :on
*/ */
...@@ -1062,23 +944,16 @@ static MYSQL_THDVAR_INT( ...@@ -1062,23 +944,16 @@ static MYSQL_THDVAR_INT(
"Execute optimize to remote server", /* comment */ "Execute optimize to remote server", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_internal_optimize( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, internal_optimize)
THD *thd,
int internal_optimize
) {
DBUG_ENTER("spider_param_internal_optimize");
DBUG_RETURN(THDVAR(thd, internal_optimize) == -1 ?
internal_optimize : THDVAR(thd, internal_optimize));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :off 0 :off
1 :on 1 :on
*/ */
...@@ -1088,20 +963,13 @@ static MYSQL_THDVAR_INT( ...@@ -1088,20 +963,13 @@ static MYSQL_THDVAR_INT(
"Execute optimize to remote server with local", /* comment */ "Execute optimize to remote server with local", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_internal_optimize_local( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, internal_optimize_local)
THD *thd,
int internal_optimize_local
) {
DBUG_ENTER("spider_param_internal_optimize_local");
DBUG_RETURN(THDVAR(thd, internal_optimize_local) == -1 ?
internal_optimize_local : THDVAR(thd, internal_optimize_local));
}
/* /*
FALSE: off FALSE: off
...@@ -1116,12 +984,7 @@ static MYSQL_THDVAR_BOOL( ...@@ -1116,12 +984,7 @@ static MYSQL_THDVAR_BOOL(
FALSE /* def */ FALSE /* def */
); );
bool spider_param_use_flash_logs( SPIDER_THDVAR_VALUE_FUNC(bool, use_flash_logs)
THD *thd
) {
DBUG_ENTER("spider_param_use_flash_logs");
DBUG_RETURN(THDVAR(thd, use_flash_logs));
}
/* /*
0 :off 0 :off
...@@ -1140,12 +1003,7 @@ static MYSQL_THDVAR_INT( ...@@ -1140,12 +1003,7 @@ static MYSQL_THDVAR_INT(
0 /* blk */ 0 /* blk */
); );
int spider_param_use_snapshot_with_flush_tables( SPIDER_THDVAR_VALUE_FUNC(int, use_snapshot_with_flush_tables)
THD *thd
) {
DBUG_ENTER("spider_param_use_snapshot_with_flush_tables");
DBUG_RETURN(THDVAR(thd, use_snapshot_with_flush_tables));
}
/* /*
FALSE: off FALSE: off
...@@ -1160,12 +1018,7 @@ static MYSQL_THDVAR_BOOL( ...@@ -1160,12 +1018,7 @@ static MYSQL_THDVAR_BOOL(
FALSE /* def */ FALSE /* def */
); );
bool spider_param_use_all_conns_snapshot( SPIDER_THDVAR_VALUE_FUNC(bool, use_all_conns_snapshot)
THD *thd
) {
DBUG_ENTER("spider_param_use_all_conns_snapshot");
DBUG_RETURN(THDVAR(thd, use_all_conns_snapshot));
}
/* /*
FALSE: off FALSE: off
...@@ -1180,12 +1033,7 @@ static MYSQL_THDVAR_BOOL( ...@@ -1180,12 +1033,7 @@ static MYSQL_THDVAR_BOOL(
FALSE /* def */ FALSE /* def */
); );
bool spider_param_lock_exchange( SPIDER_THDVAR_VALUE_FUNC(bool, lock_exchange)
THD *thd
) {
DBUG_ENTER("spider_param_lock_exchange");
DBUG_RETURN(THDVAR(thd, lock_exchange));
}
/* /*
FALSE: off FALSE: off
...@@ -1200,12 +1048,7 @@ static MYSQL_THDVAR_BOOL( ...@@ -1200,12 +1048,7 @@ static MYSQL_THDVAR_BOOL(
FALSE /* def */ FALSE /* def */
); );
bool spider_param_internal_unlock( SPIDER_THDVAR_VALUE_FUNC(bool, internal_unlock)
THD *thd
) {
DBUG_ENTER("spider_param_internal_unlock");
DBUG_RETURN(THDVAR(thd, internal_unlock));
}
/* /*
FALSE: off FALSE: off
...@@ -1220,15 +1063,10 @@ static MYSQL_THDVAR_BOOL( ...@@ -1220,15 +1063,10 @@ static MYSQL_THDVAR_BOOL(
TRUE /* def */ TRUE /* def */
); );
bool spider_param_semi_trx( SPIDER_THDVAR_VALUE_FUNC(bool, semi_trx)
THD *thd
) {
DBUG_ENTER("spider_param_semi_trx");
DBUG_RETURN(THDVAR(thd, semi_trx));
}
/* /*
-1 :use table parameter -1 :fallback to default
0-:seconds of timeout 0-:seconds of timeout
*/ */
static MYSQL_THDVAR_INT( static MYSQL_THDVAR_INT(
...@@ -1237,25 +1075,16 @@ static MYSQL_THDVAR_INT( ...@@ -1237,25 +1075,16 @@ static MYSQL_THDVAR_INT(
"Wait timeout of connecting to remote server", /* comment */ "Wait timeout of connecting to remote server", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 6, /* def */
-1, /* min */ -1, /* min */
2147483647, /* max */ 2147483647, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_connect_timeout( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, connect_timeout)
THD *thd,
int connect_timeout
) {
DBUG_ENTER("spider_param_connect_timeout");
if (thd)
DBUG_RETURN(THDVAR(thd, connect_timeout) == -1 ?
connect_timeout : THDVAR(thd, connect_timeout));
DBUG_RETURN(connect_timeout);
}
/* /*
-1 :use table parameter -1 :fallback to default
0-:seconds of timeout 0-:seconds of timeout
*/ */
static MYSQL_THDVAR_INT( static MYSQL_THDVAR_INT(
...@@ -1264,25 +1093,16 @@ static MYSQL_THDVAR_INT( ...@@ -1264,25 +1093,16 @@ static MYSQL_THDVAR_INT(
"Wait timeout of receiving data from remote server", /* comment */ "Wait timeout of receiving data from remote server", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 600, /* def */
-1, /* min */ -1, /* min */
2147483647, /* max */ 2147483647, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_net_read_timeout( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, net_read_timeout)
THD *thd,
int net_read_timeout
) {
DBUG_ENTER("spider_param_net_read_timeout");
if (thd)
DBUG_RETURN(THDVAR(thd, net_read_timeout) == -1 ?
net_read_timeout : THDVAR(thd, net_read_timeout));
DBUG_RETURN(net_read_timeout);
}
/* /*
-1 :use table parameter -1 :fallback to default
0-:seconds of timeout 0-:seconds of timeout
*/ */
static MYSQL_THDVAR_INT( static MYSQL_THDVAR_INT(
...@@ -1291,25 +1111,16 @@ static MYSQL_THDVAR_INT( ...@@ -1291,25 +1111,16 @@ static MYSQL_THDVAR_INT(
"Wait timeout of sending data to remote server", /* comment */ "Wait timeout of sending data to remote server", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 600, /* def */
-1, /* min */ -1, /* min */
2147483647, /* max */ 2147483647, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_net_write_timeout( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, net_write_timeout)
THD *thd,
int net_write_timeout
) {
DBUG_ENTER("spider_param_net_write_timeout");
if (thd)
DBUG_RETURN(THDVAR(thd, net_write_timeout) == -1 ?
net_write_timeout : THDVAR(thd, net_write_timeout));
DBUG_RETURN(net_write_timeout);
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :It acquires it collectively. 0 :It acquires it collectively.
1 :Acquisition one by one.If it discontinues once, and it will need 1 :Acquisition one by one.If it discontinues once, and it will need
it later, it retrieves it again when there is interrupt on the way. it later, it retrieves it again when there is interrupt on the way.
...@@ -1322,23 +1133,16 @@ static MYSQL_THDVAR_INT( ...@@ -1322,23 +1133,16 @@ static MYSQL_THDVAR_INT(
"The retrieval result from a remote server is acquired by acquisition one by one", /* comment */ "The retrieval result from a remote server is acquired by acquisition one by one", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 3, /* def */
-1, /* min */ -1, /* min */
3, /* max */ 3, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_quick_mode( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, quick_mode)
THD *thd,
int quick_mode
) {
DBUG_ENTER("spider_param_quick_mode");
DBUG_RETURN(THDVAR(thd, quick_mode) < 0 ?
quick_mode : THDVAR(thd, quick_mode));
}
/* /*
-1 :use table parameter -1 :fallback to default
0-:number of records 0-:number of records
*/ */
static MYSQL_THDVAR_LONGLONG( static MYSQL_THDVAR_LONGLONG(
...@@ -1347,23 +1151,16 @@ static MYSQL_THDVAR_LONGLONG( ...@@ -1347,23 +1151,16 @@ static MYSQL_THDVAR_LONGLONG(
"Number of records in a page when acquisition one by one", /* comment */ "Number of records in a page when acquisition one by one", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 1024, /* def */
-1, /* min */ -1, /* min */
9223372036854775807LL, /* max */ 9223372036854775807LL, /* max */
0 /* blk */ 0 /* blk */
); );
longlong spider_param_quick_page_size( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(longlong, quick_page_size)
THD *thd,
longlong quick_page_size
) {
DBUG_ENTER("spider_param_quick_page_size");
DBUG_RETURN(THDVAR(thd, quick_page_size) < 0 ?
quick_page_size : THDVAR(thd, quick_page_size));
}
/* /*
-1 :use table parameter -1 :fallback to default
0-:the limitation of memory size 0-:the limitation of memory size
*/ */
static MYSQL_THDVAR_LONGLONG( static MYSQL_THDVAR_LONGLONG(
...@@ -1372,23 +1169,16 @@ static MYSQL_THDVAR_LONGLONG( ...@@ -1372,23 +1169,16 @@ static MYSQL_THDVAR_LONGLONG(
"The limitation of memory size in a page when acquisition one by one", /* comment */ "The limitation of memory size in a page when acquisition one by one", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 10485760, /* def */
-1, /* min */ -1, /* min */
9223372036854775807LL, /* max */ 9223372036854775807LL, /* max */
0 /* blk */ 0 /* blk */
); );
longlong spider_param_quick_page_byte( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(longlong, quick_page_byte)
THD *thd,
longlong quick_page_byte
) {
DBUG_ENTER("spider_param_quick_page_byte");
DBUG_RETURN(THDVAR(thd, quick_page_byte) < 0 ?
quick_page_byte : THDVAR(thd, quick_page_byte));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :It doesn't use low memory mode. 0 :It doesn't use low memory mode.
1 :It uses low memory mode. 1 :It uses low memory mode.
*/ */
...@@ -1398,23 +1188,16 @@ static MYSQL_THDVAR_INT( ...@@ -1398,23 +1188,16 @@ static MYSQL_THDVAR_INT(
"Use low memory mode when SQL(SELECT) internally issued to a remote server is executed and get a result list", /* comment */ "Use low memory mode when SQL(SELECT) internally issued to a remote server is executed and get a result list", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 1, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_low_mem_read( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, low_mem_read)
THD *thd,
int low_mem_read
) {
DBUG_ENTER("spider_param_low_mem_read");
DBUG_RETURN(THDVAR(thd, low_mem_read) < 0 ?
low_mem_read : THDVAR(thd, low_mem_read));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :Use index columns if select statement can solve by using index, 0 :Use index columns if select statement can solve by using index,
otherwise use all columns. otherwise use all columns.
1 :Use columns that are judged necessary. 1 :Use columns that are judged necessary.
...@@ -1425,24 +1208,17 @@ static MYSQL_THDVAR_INT( ...@@ -1425,24 +1208,17 @@ static MYSQL_THDVAR_INT(
"The mode of using columns at select clause", /* comment */ "The mode of using columns at select clause", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 1, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_select_column_mode( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, select_column_mode)
THD *thd,
int select_column_mode
) {
DBUG_ENTER("spider_param_select_column_mode");
DBUG_RETURN(THDVAR(thd, select_column_mode) == -1 ?
select_column_mode : THDVAR(thd, select_column_mode));
}
#ifndef WITHOUT_SPIDER_BG_SEARCH #ifndef WITHOUT_SPIDER_BG_SEARCH
/* /*
-1 :use table parameter -1 :fallback to default
0 :background search is disabled 0 :background search is disabled
1 :background search is used if search with no lock 1 :background search is used if search with no lock
2 :background search is used if search with no lock or shared lock 2 :background search is used if search with no lock or shared lock
...@@ -1454,23 +1230,16 @@ static MYSQL_THDVAR_INT( ...@@ -1454,23 +1230,16 @@ static MYSQL_THDVAR_INT(
"Mode of background search", /* comment */ "Mode of background search", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
3, /* max */ 3, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_bgs_mode( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, bgs_mode)
THD *thd,
int bgs_mode
) {
DBUG_ENTER("spider_param_bgs_mode");
DBUG_RETURN(THDVAR(thd, bgs_mode) < 0 ?
bgs_mode : THDVAR(thd, bgs_mode));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :records is gotten usually 0 :records is gotten usually
1-:number of records 1-:number of records
*/ */
...@@ -1480,23 +1249,16 @@ static MYSQL_THDVAR_LONGLONG( ...@@ -1480,23 +1249,16 @@ static MYSQL_THDVAR_LONGLONG(
"Number of first read records when background search is used", /* comment */ "Number of first read records when background search is used", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 2, /* def */
-1, /* min */ -1, /* min */
9223372036854775807LL, /* max */ 9223372036854775807LL, /* max */
0 /* blk */ 0 /* blk */
); );
longlong spider_param_bgs_first_read( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(longlong, bgs_first_read)
THD *thd,
longlong bgs_first_read
) {
DBUG_ENTER("spider_param_bgs_first_read");
DBUG_RETURN(THDVAR(thd, bgs_first_read) < 0 ?
bgs_first_read : THDVAR(thd, bgs_first_read));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :records is gotten usually 0 :records is gotten usually
1-:number of records 1-:number of records
*/ */
...@@ -1506,24 +1268,17 @@ static MYSQL_THDVAR_LONGLONG( ...@@ -1506,24 +1268,17 @@ static MYSQL_THDVAR_LONGLONG(
"Number of second read records when background search is used", /* comment */ "Number of second read records when background search is used", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 100, /* def */
-1, /* min */ -1, /* min */
9223372036854775807LL, /* max */ 9223372036854775807LL, /* max */
0 /* blk */ 0 /* blk */
); );
longlong spider_param_bgs_second_read( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(longlong, bgs_second_read)
THD *thd,
longlong bgs_second_read
) {
DBUG_ENTER("spider_param_bgs_second_read");
DBUG_RETURN(THDVAR(thd, bgs_second_read) < 0 ?
bgs_second_read : THDVAR(thd, bgs_second_read));
}
#endif #endif
/* /*
-1 :use table parameter -1 :fallback to default
0 :records is gotten usually 0 :records is gotten usually
1-:number of records 1-:number of records
*/ */
...@@ -1533,23 +1288,16 @@ static MYSQL_THDVAR_LONGLONG( ...@@ -1533,23 +1288,16 @@ static MYSQL_THDVAR_LONGLONG(
"Number of first read records", /* comment */ "Number of first read records", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
9223372036854775807LL, /* max */ 9223372036854775807LL, /* max */
0 /* blk */ 0 /* blk */
); );
longlong spider_param_first_read( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(longlong, first_read)
THD *thd,
longlong first_read
) {
DBUG_ENTER("spider_param_first_read");
DBUG_RETURN(THDVAR(thd, first_read) < 0 ?
first_read : THDVAR(thd, first_read));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :records is gotten usually 0 :records is gotten usually
1-:number of records 1-:number of records
*/ */
...@@ -1559,23 +1307,16 @@ static MYSQL_THDVAR_LONGLONG( ...@@ -1559,23 +1307,16 @@ static MYSQL_THDVAR_LONGLONG(
"Number of second read records", /* comment */ "Number of second read records", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
9223372036854775807LL, /* max */ 9223372036854775807LL, /* max */
0 /* blk */ 0 /* blk */
); );
longlong spider_param_second_read( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(longlong, second_read)
THD *thd,
longlong second_read
) {
DBUG_ENTER("spider_param_second_read");
DBUG_RETURN(THDVAR(thd, second_read) < 0 ?
second_read : THDVAR(thd, second_read));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :always get the newest information 0 :always get the newest information
1-:interval 1-:interval
*/ */
...@@ -1585,23 +1326,16 @@ static MYSQL_THDVAR_INT( ...@@ -1585,23 +1326,16 @@ static MYSQL_THDVAR_INT(
"Interval of cardinality confirmation.(second)", /* comment */ "Interval of cardinality confirmation.(second)", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 51, /* def */
-1, /* min */ -1, /* min */
2147483647, /* max */ 2147483647, /* max */
0 /* blk */ 0 /* blk */
); );
double spider_param_crd_interval( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(double, crd_interval)
THD *thd,
double crd_interval
) {
DBUG_ENTER("spider_param_crd_interval");
DBUG_RETURN(THDVAR(thd, crd_interval) == -1 ?
crd_interval : THDVAR(thd, crd_interval));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :use table parameter 0 :use table parameter
1 :use show command 1 :use show command
2 :use information schema 2 :use information schema
...@@ -1613,24 +1347,17 @@ static MYSQL_THDVAR_INT( ...@@ -1613,24 +1347,17 @@ static MYSQL_THDVAR_INT(
"Mode of cardinality confirmation.", /* comment */ "Mode of cardinality confirmation.", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 1, /* def */
-1, /* min */ -1, /* min */
3, /* max */ 3, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_crd_mode( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, crd_mode)
THD *thd,
int crd_mode
) {
DBUG_ENTER("spider_param_crd_mode");
DBUG_RETURN(THDVAR(thd, crd_mode) <= 0 ?
crd_mode : THDVAR(thd, crd_mode));
}
#ifdef WITH_PARTITION_STORAGE_ENGINE #ifdef WITH_PARTITION_STORAGE_ENGINE
/* /*
-1 :use table parameter -1 :fallback to default
0 :No synchronization. 0 :No synchronization.
1 :Cardinality is synchronized when opening a table. 1 :Cardinality is synchronized when opening a table.
Then no synchronization. Then no synchronization.
...@@ -1642,24 +1369,17 @@ static MYSQL_THDVAR_INT( ...@@ -1642,24 +1369,17 @@ static MYSQL_THDVAR_INT(
"Cardinality synchronization in partitioned table.", /* comment */ "Cardinality synchronization in partitioned table.", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
2, /* max */ 2, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_crd_sync( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, crd_sync)
THD *thd,
int crd_sync
) {
DBUG_ENTER("spider_param_crd_sync");
DBUG_RETURN(THDVAR(thd, crd_sync) == -1 ?
crd_sync : THDVAR(thd, crd_sync));
}
#endif #endif
/* /*
-1 :use table parameter -1 :fallback to default
0 :The crd_weight is used as a fixed value. 0 :The crd_weight is used as a fixed value.
1 :The crd_weight is used as an addition value. 1 :The crd_weight is used as an addition value.
2 :The crd_weight is used as a multiplication value. 2 :The crd_weight is used as a multiplication value.
...@@ -1670,23 +1390,16 @@ static MYSQL_THDVAR_INT( ...@@ -1670,23 +1390,16 @@ static MYSQL_THDVAR_INT(
"Type of cardinality calculation.", /* comment */ "Type of cardinality calculation.", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 2, /* def */
-1, /* min */ -1, /* min */
2, /* max */ 2, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_crd_type( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, crd_type)
THD *thd,
int crd_type
) {
DBUG_ENTER("spider_param_crd_type");
DBUG_RETURN(THDVAR(thd, crd_type) == -1 ?
crd_type : THDVAR(thd, crd_type));
}
/* /*
-1 :use table parameter -1 :fallback to default
0-:weight 0-:weight
*/ */
static MYSQL_THDVAR_INT( static MYSQL_THDVAR_INT(
...@@ -1695,24 +1408,17 @@ static MYSQL_THDVAR_INT( ...@@ -1695,24 +1408,17 @@ static MYSQL_THDVAR_INT(
"Weight coefficient to calculate effectiveness of index from cardinality of column.", /* comment */ "Weight coefficient to calculate effectiveness of index from cardinality of column.", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 2, /* def */
-1, /* min */ -1, /* min */
2147483647, /* max */ 2147483647, /* max */
0 /* blk */ 0 /* blk */
); );
double spider_param_crd_weight( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(double, crd_weight)
THD *thd,
double crd_weight
) {
DBUG_ENTER("spider_param_crd_weight");
DBUG_RETURN(THDVAR(thd, crd_weight) == -1 ?
crd_weight : THDVAR(thd, crd_weight));
}
#ifndef WITHOUT_SPIDER_BG_SEARCH #ifndef WITHOUT_SPIDER_BG_SEARCH
/* /*
-1 :use table parameter -1 :fallback to default
0 :Background confirmation is disabled 0 :Background confirmation is disabled
1 :Background confirmation is enabled (create thread per table/partition) 1 :Background confirmation is enabled (create thread per table/partition)
2 :Background confirmation is enabled (use static threads) 2 :Background confirmation is enabled (use static threads)
...@@ -1723,24 +1429,17 @@ static MYSQL_THDVAR_INT( ...@@ -1723,24 +1429,17 @@ static MYSQL_THDVAR_INT(
"Mode of cardinality confirmation at background.", /* comment */ "Mode of cardinality confirmation at background.", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 2, /* def */
-1, /* min */ -1, /* min */
2, /* max */ 2, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_crd_bg_mode( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, crd_bg_mode)
THD *thd,
int crd_bg_mode
) {
DBUG_ENTER("spider_param_crd_bg_mode");
DBUG_RETURN(THDVAR(thd, crd_bg_mode) == -1 ?
crd_bg_mode : THDVAR(thd, crd_bg_mode));
}
#endif #endif
/* /*
-1 :use table parameter -1 :fallback to default
0 :always get the newest information 0 :always get the newest information
1-:interval 1-:interval
*/ */
...@@ -1750,23 +1449,16 @@ static MYSQL_THDVAR_INT( ...@@ -1750,23 +1449,16 @@ static MYSQL_THDVAR_INT(
"Interval of table state confirmation.(second)", /* comment */ "Interval of table state confirmation.(second)", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 10, /* def */
-1, /* min */ -1, /* min */
2147483647, /* max */ 2147483647, /* max */
0 /* blk */ 0 /* blk */
); );
double spider_param_sts_interval( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(double, sts_interval)
THD *thd,
double sts_interval
) {
DBUG_ENTER("spider_param_sts_interval");
DBUG_RETURN(THDVAR(thd, sts_interval) == -1 ?
sts_interval : THDVAR(thd, sts_interval));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :use table parameter 0 :use table parameter
1 :use show command 1 :use show command
2 :use information schema 2 :use information schema
...@@ -1777,24 +1469,17 @@ static MYSQL_THDVAR_INT( ...@@ -1777,24 +1469,17 @@ static MYSQL_THDVAR_INT(
"Mode of table state confirmation.", /* comment */ "Mode of table state confirmation.", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 1, /* def */
-1, /* min */ -1, /* min */
2, /* max */ 2, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_sts_mode( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, sts_mode)
THD *thd,
int sts_mode
) {
DBUG_ENTER("spider_param_sts_mode");
DBUG_RETURN(THDVAR(thd, sts_mode) <= 0 ?
sts_mode : THDVAR(thd, sts_mode));
}
#ifdef WITH_PARTITION_STORAGE_ENGINE #ifdef WITH_PARTITION_STORAGE_ENGINE
/* /*
-1 :use table parameter -1 :fallback to default
0 :No synchronization. 0 :No synchronization.
1 :Table state is synchronized when opening a table. 1 :Table state is synchronized when opening a table.
Then no synchronization. Then no synchronization.
...@@ -1806,25 +1491,18 @@ static MYSQL_THDVAR_INT( ...@@ -1806,25 +1491,18 @@ static MYSQL_THDVAR_INT(
"Table state synchronization in partitioned table.", /* comment */ "Table state synchronization in partitioned table.", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
2, /* max */ 2, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_sts_sync( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, sts_sync)
THD *thd,
int sts_sync
) {
DBUG_ENTER("spider_param_sts_sync");
DBUG_RETURN(THDVAR(thd, sts_sync) == -1 ?
sts_sync : THDVAR(thd, sts_sync));
}
#endif #endif
#ifndef WITHOUT_SPIDER_BG_SEARCH #ifndef WITHOUT_SPIDER_BG_SEARCH
/* /*
-1 :use table parameter -1 :fallback to default
0 :Background confirmation is disabled 0 :Background confirmation is disabled
1 :Background confirmation is enabled (create thread per table/partition) 1 :Background confirmation is enabled (create thread per table/partition)
2 :Background confirmation is enabled (use static threads) 2 :Background confirmation is enabled (use static threads)
...@@ -1835,20 +1513,13 @@ static MYSQL_THDVAR_INT( ...@@ -1835,20 +1513,13 @@ static MYSQL_THDVAR_INT(
"Mode of table state confirmation at background.", /* comment */ "Mode of table state confirmation at background.", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 2, /* def */
-1, /* min */ -1, /* min */
2, /* max */ 2, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_sts_bg_mode( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, sts_bg_mode)
THD *thd,
int sts_bg_mode
) {
DBUG_ENTER("spider_param_sts_bg_mode");
DBUG_RETURN(THDVAR(thd, sts_bg_mode) == -1 ?
sts_bg_mode : THDVAR(thd, sts_bg_mode));
}
#endif #endif
/* /*
...@@ -1867,12 +1538,7 @@ static MYSQL_THDVAR_INT( ...@@ -1867,12 +1538,7 @@ static MYSQL_THDVAR_INT(
0 /* blk */ 0 /* blk */
); );
double spider_param_ping_interval_at_trx_start( SPIDER_THDVAR_VALUE_FUNC(double, ping_interval_at_trx_start)
THD *thd
) {
DBUG_ENTER("spider_param_ping_interval_at_trx_start");
DBUG_RETURN(THDVAR(thd, ping_interval_at_trx_start));
}
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
/* /*
...@@ -1900,7 +1566,7 @@ double spider_param_hs_ping_interval( ...@@ -1900,7 +1566,7 @@ double spider_param_hs_ping_interval(
#endif #endif
/* /*
-1 :use table parameter -1 :fallback to default
0 :normal mode 0 :normal mode
1 :quick mode 1 :quick mode
2 :set 0 value 2 :set 0 value
...@@ -1911,20 +1577,13 @@ static MYSQL_THDVAR_INT( ...@@ -1911,20 +1577,13 @@ static MYSQL_THDVAR_INT(
"Mode of auto increment.", /* comment */ "Mode of auto increment.", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
3, /* max */ 3, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_auto_increment_mode( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, auto_increment_mode)
THD *thd,
int auto_increment_mode
) {
DBUG_ENTER("spider_param_auto_increment_mode");
DBUG_RETURN(THDVAR(thd, auto_increment_mode) == -1 ?
auto_increment_mode : THDVAR(thd, auto_increment_mode));
}
/* /*
FALSE: off FALSE: off
...@@ -1939,12 +1598,7 @@ static MYSQL_THDVAR_BOOL( ...@@ -1939,12 +1598,7 @@ static MYSQL_THDVAR_BOOL(
FALSE /* def */ FALSE /* def */
); );
bool spider_param_same_server_link( SPIDER_THDVAR_VALUE_FUNC(bool, same_server_link)
THD *thd
) {
DBUG_ENTER("spider_param_same_server_link");
DBUG_RETURN(THDVAR(thd, same_server_link));
}
/* /*
FALSE: transmits FALSE: transmits
...@@ -1960,15 +1614,10 @@ static MYSQL_THDVAR_BOOL( ...@@ -1960,15 +1614,10 @@ static MYSQL_THDVAR_BOOL(
FALSE /* def */ FALSE /* def */
); );
bool spider_param_local_lock_table( SPIDER_THDVAR_VALUE_FUNC(bool, local_lock_table)
THD *thd
) {
DBUG_ENTER("spider_param_local_lock_table");
DBUG_RETURN(THDVAR(thd, local_lock_table));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :don't transmit 0 :don't transmit
1 :transmits 1 :transmits
*/ */
...@@ -1984,17 +1633,10 @@ static MYSQL_THDVAR_INT( ...@@ -1984,17 +1633,10 @@ static MYSQL_THDVAR_INT(
0 /* blk */ 0 /* blk */
); );
int spider_param_use_pushdown_udf( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, use_pushdown_udf)
THD *thd,
int use_pushdown_udf
) {
DBUG_ENTER("spider_param_use_pushdown_udf");
DBUG_RETURN(THDVAR(thd, use_pushdown_udf) == -1 ?
use_pushdown_udf : THDVAR(thd, use_pushdown_udf));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :duplicate check on local server 0 :duplicate check on local server
1 :avoid duplicate check on local server 1 :avoid duplicate check on local server
*/ */
...@@ -2004,20 +1646,13 @@ static MYSQL_THDVAR_INT( ...@@ -2004,20 +1646,13 @@ static MYSQL_THDVAR_INT(
"Execute \"REPLACE\" and \"INSERT IGNORE\" on remote server and avoid duplicate check on local server", /* comment */ "Execute \"REPLACE\" and \"INSERT IGNORE\" on remote server and avoid duplicate check on local server", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_direct_dup_insert( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, direct_dup_insert)
THD *thd,
int direct_dup_insert
) {
DBUG_ENTER("spider_param_direct_dup_insert");
DBUG_RETURN(THDVAR(thd, direct_dup_insert) < 0 ?
direct_dup_insert : THDVAR(thd, direct_dup_insert));
}
static uint spider_udf_table_lock_mutex_count; static uint spider_udf_table_lock_mutex_count;
/* /*
...@@ -2036,11 +1671,7 @@ static MYSQL_SYSVAR_UINT( ...@@ -2036,11 +1671,7 @@ static MYSQL_SYSVAR_UINT(
0 0
); );
uint spider_param_udf_table_lock_mutex_count() SPIDER_SYSVAR_VALUE_FUNC(uint, 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; static uint spider_udf_table_mon_mutex_count;
/* /*
...@@ -2059,11 +1690,7 @@ static MYSQL_SYSVAR_UINT( ...@@ -2059,11 +1690,7 @@ static MYSQL_SYSVAR_UINT(
0 0
); );
uint spider_param_udf_table_mon_mutex_count() SPIDER_SYSVAR_VALUE_FUNC(uint, 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 1-:number of rows
...@@ -2074,23 +1701,16 @@ static MYSQL_THDVAR_LONGLONG( ...@@ -2074,23 +1701,16 @@ static MYSQL_THDVAR_LONGLONG(
"Number of rows for bulk inserting", /* comment */ "Number of rows for bulk inserting", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 3000, /* def */
-1, /* min */ -1, /* min */
9223372036854775807LL, /* max */ 9223372036854775807LL, /* max */
0 /* blk */ 0 /* blk */
); );
longlong spider_param_udf_ds_bulk_insert_rows( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(longlong, 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 -1 :fallback to default
0 :drop records 0 :drop records
1 :insert last table 1 :insert last table
2 :insert first table and loop again 2 :insert first table and loop again
...@@ -2101,20 +1721,13 @@ static MYSQL_THDVAR_INT( ...@@ -2101,20 +1721,13 @@ static MYSQL_THDVAR_INT(
"Table loop mode if the number of tables in table list are less than the number of result sets", /* comment */ "Table loop mode if the number of tables in table list are less than the number of result sets", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
2, /* max */ 2, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_udf_ds_table_loop_mode( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, 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;
/* /*
...@@ -2155,11 +1768,7 @@ static MYSQL_SYSVAR_STR( ...@@ -2155,11 +1768,7 @@ static MYSQL_SYSVAR_STR(
#endif #endif
#endif #endif
char *spider_param_remote_access_charset() SPIDER_SYSVAR_VALUE_FUNC(char*, remote_access_charset)
{
DBUG_ENTER("spider_param_remote_access_charset");
DBUG_RETURN(spider_remote_access_charset);
}
static int spider_remote_autocommit; static int spider_remote_autocommit;
/* /*
...@@ -2180,11 +1789,7 @@ static MYSQL_SYSVAR_INT( ...@@ -2180,11 +1789,7 @@ static MYSQL_SYSVAR_INT(
0 0
); );
int spider_param_remote_autocommit() SPIDER_SYSVAR_VALUE_FUNC(int, remote_autocommit)
{
DBUG_ENTER("spider_param_remote_autocommit");
DBUG_RETURN(spider_remote_autocommit);
}
static char *spider_remote_time_zone; static char *spider_remote_time_zone;
/* /*
...@@ -2225,11 +1830,7 @@ static MYSQL_SYSVAR_STR( ...@@ -2225,11 +1830,7 @@ static MYSQL_SYSVAR_STR(
#endif #endif
#endif #endif
char *spider_param_remote_time_zone() SPIDER_SYSVAR_VALUE_FUNC(char *, remote_time_zone)
{
DBUG_ENTER("spider_param_remote_time_zone");
DBUG_RETURN(spider_remote_time_zone);
}
static int spider_remote_sql_log_off; static int spider_remote_sql_log_off;
/* /*
...@@ -2250,11 +1851,7 @@ static MYSQL_SYSVAR_INT( ...@@ -2250,11 +1851,7 @@ static MYSQL_SYSVAR_INT(
0 0
); );
int spider_param_remote_sql_log_off() SPIDER_SYSVAR_VALUE_FUNC(int, remote_sql_log_off)
{
DBUG_ENTER("spider_param_remote_sql_log_off");
DBUG_RETURN(spider_remote_sql_log_off);
}
static int spider_remote_trx_isolation; static int spider_remote_trx_isolation;
/* /*
...@@ -2277,11 +1874,7 @@ static MYSQL_SYSVAR_INT( ...@@ -2277,11 +1874,7 @@ static MYSQL_SYSVAR_INT(
0 0
); );
int spider_param_remote_trx_isolation() SPIDER_SYSVAR_VALUE_FUNC(int, remote_trx_isolation)
{
DBUG_ENTER("spider_param_remote_trx_isolation");
DBUG_RETURN(spider_remote_trx_isolation);
}
static char *spider_remote_default_database; static char *spider_remote_default_database;
/* /*
...@@ -2322,11 +1915,7 @@ static MYSQL_SYSVAR_STR( ...@@ -2322,11 +1915,7 @@ static MYSQL_SYSVAR_STR(
#endif #endif
#endif #endif
char *spider_param_remote_default_database() SPIDER_SYSVAR_VALUE_FUNC(char *, remote_default_database)
{
DBUG_ENTER("spider_param_remote_default_database");
DBUG_RETURN(spider_remote_default_database);
}
/* /*
0-:connect retry interval (micro second) 0-:connect retry interval (micro second)
...@@ -2416,12 +2005,11 @@ char *spider_param_bka_engine( ...@@ -2416,12 +2005,11 @@ char *spider_param_bka_engine(
char *bka_engine char *bka_engine
) { ) {
DBUG_ENTER("spider_param_bka_engine"); DBUG_ENTER("spider_param_bka_engine");
DBUG_RETURN(THDVAR(thd, bka_engine) ? DBUG_RETURN(bka_engine ? bka_engine : THDVAR(thd, bka_engine));
THDVAR(thd, bka_engine) : bka_engine);
} }
/* /*
-1 :use table parameter -1 :fallback to default
0 :use union all 0 :use union all
1 :use temporary table 1 :use temporary table
*/ */
...@@ -2431,24 +2019,17 @@ static MYSQL_THDVAR_INT( ...@@ -2431,24 +2019,17 @@ static MYSQL_THDVAR_INT(
"Mode of BKA for Spider", /* comment */ "Mode of BKA for Spider", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 1, /* def */
-1, /* min */ -1, /* min */
2, /* max */ 2, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_bka_mode( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, bka_mode)
THD *thd,
int bka_mode
) {
DBUG_ENTER("spider_param_bka_mode");
DBUG_RETURN(THDVAR(thd, bka_mode) == -1 ?
bka_mode : THDVAR(thd, bka_mode));
}
static int spider_udf_ct_bulk_insert_interval; static int spider_udf_ct_bulk_insert_interval;
/* /*
-1 : The UDF parameter is adopted. -1 : Fallback to default.
0 or more : Milliseconds. 0 or more : Milliseconds.
*/ */
static MYSQL_SYSVAR_INT( static MYSQL_SYSVAR_INT(
...@@ -2458,23 +2039,17 @@ static MYSQL_SYSVAR_INT( ...@@ -2458,23 +2039,17 @@ static MYSQL_SYSVAR_INT(
"The interval time between bulk insert and next bulk insert at coping", "The interval time between bulk insert and next bulk insert at coping",
NULL, NULL,
NULL, NULL,
-1, 10,
-1, -1,
2147483647, 2147483647,
0 0
); );
int spider_param_udf_ct_bulk_insert_interval( SPIDER_SYSVAR_OVERRIDE_VALUE_FUNC(int, 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; static longlong spider_udf_ct_bulk_insert_rows;
/* /*
-1,0 : The UDF parameter is adopted. -1,0 : Fallback to default.
1 or more : Number of rows. 1 or more : Number of rows.
*/ */
static MYSQL_SYSVAR_LONGLONG( static MYSQL_SYSVAR_LONGLONG(
...@@ -2484,19 +2059,13 @@ static MYSQL_SYSVAR_LONGLONG( ...@@ -2484,19 +2059,13 @@ static MYSQL_SYSVAR_LONGLONG(
"The number of rows inserted with bulk insert of one time at coping", "The number of rows inserted with bulk insert of one time at coping",
NULL, NULL,
NULL, NULL,
-1, 100,
-1, -1,
9223372036854775807LL, 9223372036854775807LL,
0 0
); );
longlong spider_param_udf_ct_bulk_insert_rows( SPIDER_SYSVAR_OVERRIDE_VALUE_FUNC(longlong, 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);
}
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
/* /*
...@@ -2594,7 +2163,7 @@ uint spider_param_hs_w_conn_recycle_strict( ...@@ -2594,7 +2163,7 @@ uint spider_param_hs_w_conn_recycle_strict(
} }
/* /*
-1 :use table parameter -1 :fallback to default
0 :not use 0 :not use
1 :use handlersocket 1 :use handlersocket
*/ */
...@@ -2604,23 +2173,16 @@ static MYSQL_THDVAR_INT( ...@@ -2604,23 +2173,16 @@ static MYSQL_THDVAR_INT(
"Use handlersocket for reading", /* comment */ "Use handlersocket for reading", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_use_hs_read( SPIDER_THDVAR_OVERRIDE_VALUE_FUN(int, use_hs_read)
THD *thd,
int use_hs_read
) {
DBUG_ENTER("spider_param_use_hs_read");
DBUG_RETURN(THDVAR(thd, use_hs_read) == -1 ?
use_hs_read : THDVAR(thd, use_hs_read));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :not use 0 :not use
1 :use handlersocket 1 :use handlersocket
*/ */
...@@ -2630,24 +2192,17 @@ static MYSQL_THDVAR_INT( ...@@ -2630,24 +2192,17 @@ static MYSQL_THDVAR_INT(
"Use handlersocket for writing", /* comment */ "Use handlersocket for writing", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_use_hs_write( SPIDER_THDVAR_OVERRIDE_VALUE_FUN(int, use_hs_write)
THD *thd,
int use_hs_write
) {
DBUG_ENTER("spider_param_use_hs_write");
DBUG_RETURN(THDVAR(thd, use_hs_write) == -1 ?
use_hs_write : THDVAR(thd, use_hs_write));
}
#endif #endif
/* /*
-1 :use table parameter -1 :fallback to default
0 :not use 0 :not use
1 :use handler 1 :use handler
*/ */
...@@ -2657,23 +2212,16 @@ static MYSQL_THDVAR_INT( ...@@ -2657,23 +2212,16 @@ static MYSQL_THDVAR_INT(
"Use handler for reading", /* comment */ "Use handler for reading", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
3, /* max */ 3, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_use_handler( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, use_handler)
THD *thd,
int use_handler
) {
DBUG_ENTER("spider_param_use_handler");
DBUG_RETURN(THDVAR(thd, use_handler) == -1 ?
use_handler : THDVAR(thd, use_handler));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :return error if error 0 :return error if error
1 :return 0 record if error 1 :return 0 record if error
*/ */
...@@ -2683,23 +2231,16 @@ static MYSQL_THDVAR_INT( ...@@ -2683,23 +2231,16 @@ static MYSQL_THDVAR_INT(
"Read error mode if error", /* comment */ "Read error mode if error", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_error_read_mode( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, error_read_mode)
THD *thd,
int error_read_mode
) {
DBUG_ENTER("spider_param_error_read_mode");
DBUG_RETURN(THDVAR(thd, error_read_mode) == -1 ?
error_read_mode : THDVAR(thd, error_read_mode));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :return error if error 0 :return error if error
1 :return 0 record if error 1 :return 0 record if error
*/ */
...@@ -2709,23 +2250,16 @@ static MYSQL_THDVAR_INT( ...@@ -2709,23 +2250,16 @@ static MYSQL_THDVAR_INT(
"Write error mode if error", /* comment */ "Write error mode if error", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_error_write_mode( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, error_write_mode)
THD *thd,
int error_write_mode
) {
DBUG_ENTER("spider_param_error_write_mode");
DBUG_RETURN(THDVAR(thd, error_write_mode) == -1 ?
error_write_mode : THDVAR(thd, error_write_mode));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :not skip 0 :not skip
1 :skip 1 :skip
*/ */
...@@ -2735,23 +2269,16 @@ static MYSQL_THDVAR_INT( ...@@ -2735,23 +2269,16 @@ static MYSQL_THDVAR_INT(
"Skip generating internal default condition", /* comment */ "Skip generating internal default condition", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_skip_default_condition( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, skip_default_condition)
THD *thd,
int skip_default_condition
) {
DBUG_ENTER("spider_param_skip_default_condition");
DBUG_RETURN(THDVAR(thd, skip_default_condition) == -1 ?
skip_default_condition : THDVAR(thd, skip_default_condition));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :not skip 0 :not skip
1 :skip parallel search if query is not SELECT statement 1 :skip parallel search if query is not SELECT statement
2 :skip parallel search if query has SQL_NO_CACHE 2 :skip parallel search if query has SQL_NO_CACHE
...@@ -2763,23 +2290,16 @@ static MYSQL_THDVAR_INT( ...@@ -2763,23 +2290,16 @@ static MYSQL_THDVAR_INT(
"Skip parallel search by specific conditions", /* comment */ "Skip parallel search by specific conditions", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
3, /* max */ 3, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_skip_parallel_search( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, skip_parallel_search)
THD *thd,
int skip_parallel_search
) {
DBUG_ENTER("spider_param_skip_parallel_search");
DBUG_RETURN(THDVAR(thd, skip_parallel_search) == -1 ?
skip_parallel_search : THDVAR(thd, skip_parallel_search));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :not send directly 0 :not send directly
1-:send directly 1-:send directly
*/ */
...@@ -2789,23 +2309,16 @@ static MYSQL_THDVAR_LONGLONG( ...@@ -2789,23 +2309,16 @@ static MYSQL_THDVAR_LONGLONG(
"Send 'ORDER BY' and 'LIMIT' to remote server directly", /* comment */ "Send 'ORDER BY' and 'LIMIT' to remote server directly", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 9223372036854775807LL, /* def */
-1, /* min */ -1, /* min */
9223372036854775807LL, /* max */ 9223372036854775807LL, /* max */
0 /* blk */ 0 /* blk */
); );
longlong spider_param_direct_order_limit( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(longlong, direct_order_limit)
THD *thd,
longlong direct_order_limit
) {
DBUG_ENTER("spider_param_direct_order_limit");
DBUG_RETURN(THDVAR(thd, direct_order_limit) == -1 ?
direct_order_limit : THDVAR(thd, direct_order_limit));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :writable 0 :writable
1 :read only 1 :read only
*/ */
...@@ -2815,25 +2328,18 @@ static MYSQL_THDVAR_INT( ...@@ -2815,25 +2328,18 @@ static MYSQL_THDVAR_INT(
"Read only", /* comment */ "Read only", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_read_only_mode( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, read_only_mode)
THD *thd,
int read_only_mode
) {
DBUG_ENTER("spider_param_read_only_mode");
DBUG_RETURN(THDVAR(thd, read_only_mode) == -1 ?
read_only_mode : THDVAR(thd, read_only_mode));
}
#ifdef HA_CAN_BULK_ACCESS #ifdef HA_CAN_BULK_ACCESS
static int spider_bulk_access_free; static int spider_bulk_access_free;
/* /*
-1 :use table parameter -1 :fallback to default
0 :in reset 0 :in reset
1 :in close 1 :in close
*/ */
...@@ -2844,25 +2350,19 @@ static MYSQL_SYSVAR_INT( ...@@ -2844,25 +2350,19 @@ static MYSQL_SYSVAR_INT(
"Free mode of bulk access resources", "Free mode of bulk access resources",
NULL, NULL,
NULL, NULL,
-1, 0,
-1, -1,
1, 1,
0 0
); );
int spider_param_bulk_access_free( SPIDER_SYSVAR_OVERRIDE_VALUE_FUN(int, bulk_access_free)
int bulk_access_free
) {
DBUG_ENTER("spider_param_bulk_access_free");
DBUG_RETURN(spider_bulk_access_free == -1 ?
bulk_access_free : spider_bulk_access_free);
}
#endif #endif
#if MYSQL_VERSION_ID < 50500 #if MYSQL_VERSION_ID < 50500
#else #else
/* /*
-1 :use UDF parameter -1 :fallback to default
0 :can not use 0 :can not use
1 :can use 1 :can use
*/ */
...@@ -2872,20 +2372,13 @@ static MYSQL_THDVAR_INT( ...@@ -2872,20 +2372,13 @@ static MYSQL_THDVAR_INT(
"Use real table for temporary table list", /* comment */ "Use real table for temporary table list", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_udf_ds_use_real_table( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, 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));
}
#endif #endif
static my_bool spider_general_log; static my_bool spider_general_log;
...@@ -2899,11 +2392,7 @@ static MYSQL_SYSVAR_BOOL( ...@@ -2899,11 +2392,7 @@ static MYSQL_SYSVAR_BOOL(
FALSE FALSE
); );
my_bool spider_param_general_log() SPIDER_SYSVAR_VALUE_FUNC(my_bool, general_log)
{
DBUG_ENTER("spider_param_general_log");
DBUG_RETURN(spider_general_log);
}
/* /*
FALSE: no pushdown hints FALSE: no pushdown hints
...@@ -2918,12 +2407,7 @@ static MYSQL_THDVAR_BOOL( ...@@ -2918,12 +2407,7 @@ static MYSQL_THDVAR_BOOL(
FALSE /* def */ FALSE /* def */
); );
my_bool spider_param_index_hint_pushdown( SPIDER_THDVAR_VALUE_FUNC(my_bool, index_hint_pushdown)
THD *thd
) {
DBUG_ENTER("spider_param_index_hint_pushdown");
DBUG_RETURN(THDVAR(thd, index_hint_pushdown));
}
static uint spider_max_connections; static uint spider_max_connections;
static MYSQL_SYSVAR_UINT( static MYSQL_SYSVAR_UINT(
...@@ -2939,11 +2423,7 @@ static MYSQL_SYSVAR_UINT( ...@@ -2939,11 +2423,7 @@ static MYSQL_SYSVAR_UINT(
0 /* blk */ 0 /* blk */
); );
uint spider_param_max_connections() SPIDER_SYSVAR_VALUE_FUNC(uint, max_connections)
{
DBUG_ENTER("spider_param_max_connections");
DBUG_RETURN(spider_max_connections);
}
static uint spider_conn_wait_timeout; static uint spider_conn_wait_timeout;
static MYSQL_SYSVAR_UINT( static MYSQL_SYSVAR_UINT(
...@@ -2959,11 +2439,7 @@ static MYSQL_SYSVAR_UINT( ...@@ -2959,11 +2439,7 @@ static MYSQL_SYSVAR_UINT(
0 /* blk */ 0 /* blk */
); );
uint spider_param_conn_wait_timeout() SPIDER_SYSVAR_VALUE_FUNC(uint, conn_wait_timeout)
{
DBUG_ENTER("spider_param_conn_wait_timeout");
DBUG_RETURN(spider_conn_wait_timeout);
}
static uint spider_log_result_errors; static uint spider_log_result_errors;
/* /*
...@@ -2986,11 +2462,7 @@ static MYSQL_SYSVAR_UINT( ...@@ -2986,11 +2462,7 @@ static MYSQL_SYSVAR_UINT(
0 0
); );
uint spider_param_log_result_errors() SPIDER_SYSVAR_VALUE_FUNC(uint, log_result_errors)
{
DBUG_ENTER("spider_param_log_result_errors");
DBUG_RETURN(spider_log_result_errors);
}
static uint spider_log_result_error_with_sql; static uint spider_log_result_error_with_sql;
/* /*
...@@ -3012,11 +2484,7 @@ static MYSQL_SYSVAR_UINT( ...@@ -3012,11 +2484,7 @@ static MYSQL_SYSVAR_UINT(
0 0
); );
uint spider_param_log_result_error_with_sql() SPIDER_SYSVAR_VALUE_FUNC(uint, log_result_error_with_sql)
{
DBUG_ENTER("spider_param_log_result_error_with_sql");
DBUG_RETURN(spider_log_result_error_with_sql);
}
static char *spider_version = (char *) SPIDER_DETAIL_VERSION; static char *spider_version = (char *) SPIDER_DETAIL_VERSION;
static MYSQL_SYSVAR_STR( static MYSQL_SYSVAR_STR(
...@@ -3045,15 +2513,10 @@ static MYSQL_THDVAR_UINT( ...@@ -3045,15 +2513,10 @@ static MYSQL_THDVAR_UINT(
0 /* blk */ 0 /* blk */
); );
uint spider_param_internal_xa_id_type( SPIDER_THDVAR_VALUE_FUNC(uint, internal_xa_id_type)
THD *thd
) {
DBUG_ENTER("spider_param_internal_xa_id_type");
DBUG_RETURN(THDVAR(thd, internal_xa_id_type));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :OFF 0 :OFF
1 :automatic channel 1 :automatic channel
2-63 :use custom channel 2-63 :use custom channel
...@@ -3064,20 +2527,13 @@ static MYSQL_THDVAR_INT( ...@@ -3064,20 +2527,13 @@ static MYSQL_THDVAR_INT(
"Read casually if it is possible", /* comment */ "Read casually if it is possible", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
63, /* max */ 63, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_casual_read( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, casual_read)
THD *thd,
int casual_read
) {
DBUG_ENTER("spider_param_casual_read");
DBUG_RETURN(THDVAR(thd, casual_read) == -1 ?
casual_read : THDVAR(thd, casual_read));
}
static my_bool spider_dry_access; static my_bool spider_dry_access;
static MYSQL_SYSVAR_BOOL( static MYSQL_SYSVAR_BOOL(
...@@ -3090,14 +2546,10 @@ static MYSQL_SYSVAR_BOOL( ...@@ -3090,14 +2546,10 @@ static MYSQL_SYSVAR_BOOL(
FALSE FALSE
); );
my_bool spider_param_dry_access() SPIDER_SYSVAR_VALUE_FUNC(my_bool, dry_access)
{
DBUG_ENTER("spider_param_dry_access");
DBUG_RETURN(spider_dry_access);
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :fast 0 :fast
1 :correct delete row number 1 :correct delete row number
*/ */
...@@ -3107,23 +2559,16 @@ static MYSQL_THDVAR_INT( ...@@ -3107,23 +2559,16 @@ static MYSQL_THDVAR_INT(
"The type of delete_all_rows", /* comment */ "The type of delete_all_rows", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 1, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_delete_all_rows_type( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, delete_all_rows_type)
THD *thd,
int delete_all_rows_type
) {
DBUG_ENTER("spider_param_delete_all_rows_type");
DBUG_RETURN(THDVAR(thd, delete_all_rows_type) == -1 ?
delete_all_rows_type : THDVAR(thd, delete_all_rows_type));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :compact 0 :compact
1 :add original table name 1 :add original table name
*/ */
...@@ -3133,23 +2578,16 @@ static MYSQL_THDVAR_INT( ...@@ -3133,23 +2578,16 @@ static MYSQL_THDVAR_INT(
"The type of temporary table name for bka", /* comment */ "The type of temporary table name for bka", /* comment */
NULL, /* check */ NULL, /* check */
NULL, /* update */ NULL, /* update */
-1, /* def */ 0, /* def */
-1, /* min */ -1, /* min */
1, /* max */ 1, /* max */
0 /* blk */ 0 /* blk */
); );
int spider_param_bka_table_name_type( SPIDER_THDVAR_OVERRIDE_VALUE_FUNC(int, bka_table_name_type)
THD *thd,
int bka_table_name_type
) {
DBUG_ENTER("spider_param_bka_table_name_type");
DBUG_RETURN(THDVAR(thd, bka_table_name_type) == -1 ?
bka_table_name_type : THDVAR(thd, bka_table_name_type));
}
/* /*
-1 :use table parameter -1 :fallback to default
0 :off 0 :off
1 :on 1 :on
*/ */
...@@ -3165,16 +2603,11 @@ static MYSQL_THDVAR_INT( ...@@ -3165,16 +2603,11 @@ static MYSQL_THDVAR_INT(
0 /* blk */ 0 /* blk */
); );
int spider_param_use_cond_other_than_pk_for_update( SPIDER_THDVAR_VALUE_FUNC(int, use_cond_other_than_pk_for_update)
THD *thd
) {
DBUG_ENTER("spider_param_reset_sql_alloc");
DBUG_RETURN(THDVAR(thd, use_cond_other_than_pk_for_update));
}
static int spider_store_last_sts; static int spider_store_last_sts;
/* /*
-1 : use table parameter -1 : fallback to default
0 : do not store 0 : do not store
1 : do store 1 : do store
*/ */
...@@ -3185,23 +2618,17 @@ static MYSQL_SYSVAR_INT( ...@@ -3185,23 +2618,17 @@ static MYSQL_SYSVAR_INT(
"Store last sts result into system table", "Store last sts result into system table",
NULL, NULL,
NULL, NULL,
-1, 1,
-1, -1,
1, 1,
0 0
); );
int spider_param_store_last_sts( SPIDER_SYSVAR_OVERRIDE_VALUE_FUNC(int, store_last_sts)
int store_last_sts
) {
DBUG_ENTER("spider_param_store_last_sts");
DBUG_RETURN(spider_store_last_sts == -1 ?
store_last_sts : spider_store_last_sts);
}
static int spider_store_last_crd; static int spider_store_last_crd;
/* /*
-1 : use table parameter -1 : fallback to default
0 : do not store 0 : do not store
1 : do store 1 : do store
*/ */
...@@ -3212,23 +2639,17 @@ static MYSQL_SYSVAR_INT( ...@@ -3212,23 +2639,17 @@ static MYSQL_SYSVAR_INT(
"Store last crd result into system table", "Store last crd result into system table",
NULL, NULL,
NULL, NULL,
-1, 1,
-1, -1,
1, 1,
0 0
); );
int spider_param_store_last_crd( SPIDER_SYSVAR_OVERRIDE_VALUE_FUNC(int, store_last_crd)
int store_last_crd
) {
DBUG_ENTER("spider_param_store_last_crd");
DBUG_RETURN(spider_store_last_crd == -1 ?
store_last_crd : spider_store_last_crd);
}
static int spider_load_sts_at_startup; static int spider_load_sts_at_startup;
/* /*
-1 : use table parameter -1 : fallback to default
0 : do not load 0 : do not load
1 : do load 1 : do load
*/ */
...@@ -3239,23 +2660,17 @@ static MYSQL_SYSVAR_INT( ...@@ -3239,23 +2660,17 @@ static MYSQL_SYSVAR_INT(
"Load sts from system table at startup", "Load sts from system table at startup",
NULL, NULL,
NULL, NULL,
-1, 1,
-1, -1,
1, 1,
0 0
); );
int spider_param_load_sts_at_startup( SPIDER_SYSVAR_OVERRIDE_VALUE_FUNC(int, load_sts_at_startup)
int load_sts_at_startup
) {
DBUG_ENTER("spider_param_load_sts_at_startup");
DBUG_RETURN(spider_load_sts_at_startup == -1 ?
load_sts_at_startup : spider_load_sts_at_startup);
}
static int spider_load_crd_at_startup; static int spider_load_crd_at_startup;
/* /*
-1 : use table parameter -1 : fallback to default
0 : do not load 0 : do not load
1 : do load 1 : do load
*/ */
...@@ -3266,19 +2681,13 @@ static MYSQL_SYSVAR_INT( ...@@ -3266,19 +2681,13 @@ static MYSQL_SYSVAR_INT(
"Load crd from system table at startup", "Load crd from system table at startup",
NULL, NULL,
NULL, NULL,
-1, 1,
-1, -1,
1, 1,
0 0
); );
int spider_param_load_crd_at_startup( SPIDER_SYSVAR_OVERRIDE_VALUE_FUNC(int, load_crd_at_startup)
int load_crd_at_startup
) {
DBUG_ENTER("spider_param_load_crd_at_startup");
DBUG_RETURN(spider_load_crd_at_startup == -1 ?
load_crd_at_startup : spider_load_crd_at_startup);
}
#ifndef WITHOUT_SPIDER_BG_SEARCH #ifndef WITHOUT_SPIDER_BG_SEARCH
static uint spider_table_sts_thread_count; static uint spider_table_sts_thread_count;
...@@ -3298,11 +2707,7 @@ static MYSQL_SYSVAR_UINT( ...@@ -3298,11 +2707,7 @@ static MYSQL_SYSVAR_UINT(
0 0
); );
uint spider_param_table_sts_thread_count() SPIDER_SYSVAR_VALUE_FUNC(uint, table_sts_thread_count)
{
DBUG_ENTER("spider_param_table_sts_thread_count");
DBUG_RETURN(spider_table_sts_thread_count);
}
static uint spider_table_crd_thread_count; static uint spider_table_crd_thread_count;
/* /*
...@@ -3321,11 +2726,7 @@ static MYSQL_SYSVAR_UINT( ...@@ -3321,11 +2726,7 @@ static MYSQL_SYSVAR_UINT(
0 0
); );
uint spider_param_table_crd_thread_count() SPIDER_SYSVAR_VALUE_FUNC(uint, table_crd_thread_count)
{
DBUG_ENTER("spider_param_table_crd_thread_count");
DBUG_RETURN(spider_table_crd_thread_count);
}
#endif #endif
static int spider_slave_trx_isolation; static int spider_slave_trx_isolation;
...@@ -3349,11 +2750,7 @@ static MYSQL_SYSVAR_INT( ...@@ -3349,11 +2750,7 @@ static MYSQL_SYSVAR_INT(
0 /* blk */ 0 /* blk */
); );
int spider_param_slave_trx_isolation() SPIDER_SYSVAR_VALUE_FUNC(int, slave_trx_isolation)
{
DBUG_ENTER("spider_param_slave_trx_isolation");
DBUG_RETURN(spider_slave_trx_isolation);
}
/* /*
-1 :not set -1 :not set
...@@ -3418,12 +2815,7 @@ static MYSQL_THDVAR_BOOL( ...@@ -3418,12 +2815,7 @@ static MYSQL_THDVAR_BOOL(
TRUE /* def */ TRUE /* def */
); );
bool spider_param_sync_sql_mode( SPIDER_THDVAR_VALUE_FUNC(bool, sync_sql_mode)
THD *thd
) {
DBUG_ENTER("spider_param_sync_sql_mode");
DBUG_RETURN(THDVAR(thd, sync_sql_mode));
}
static struct st_mysql_storage_engine spider_storage_engine = static struct st_mysql_storage_engine spider_storage_engine =
{ MYSQL_HANDLERTON_INTERFACE_VERSION }; { MYSQL_HANDLERTON_INTERFACE_VERSION };
......
...@@ -3700,10 +3700,6 @@ int spider_set_connect_info_default( ...@@ -3700,10 +3700,6 @@ int spider_set_connect_info_default(
#endif #endif
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET) #if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
if (share->use_hs_reads[roop_count] == -1)
share->use_hs_reads[roop_count] = 0;
if (share->use_hs_writes[roop_count] == -1)
share->use_hs_writes[roop_count] = 0;
if (share->hs_read_ports[roop_count] == -1) if (share->hs_read_ports[roop_count] == -1)
{ {
share->hs_read_ports[roop_count] = 9998; share->hs_read_ports[roop_count] = 9998;
...@@ -3735,154 +3731,24 @@ int spider_set_connect_info_default( ...@@ -3735,154 +3731,24 @@ int spider_set_connect_info_default(
share->hs_write_to_reads[roop_count] = 1; share->hs_write_to_reads[roop_count] = 1;
} }
#endif #endif
if (share->use_handlers[roop_count] == -1)
share->use_handlers[roop_count] = 0;
if (share->connect_timeouts[roop_count] == -1)
share->connect_timeouts[roop_count] = 6;
if (share->net_read_timeouts[roop_count] == -1)
share->net_read_timeouts[roop_count] = 600;
if (share->net_write_timeouts[roop_count] == -1)
share->net_write_timeouts[roop_count] = 600;
if (share->access_balances[roop_count] == -1) if (share->access_balances[roop_count] == -1)
share->access_balances[roop_count] = 100; share->access_balances[roop_count] = 100;
if (share->bka_table_name_types[roop_count] == -1)
share->bka_table_name_types[roop_count] = 0;
} }
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (share->sts_bg_mode == -1)
share->sts_bg_mode = 2;
#endif
if (share->sts_interval == -1)
share->sts_interval = 10;
if (share->sts_mode == -1)
share->sts_mode = 1;
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (share->sts_sync == -1)
share->sts_sync = 0;
#endif
if (share->store_last_sts == -1)
share->store_last_sts = 1;
if (share->load_sts_at_startup == -1)
share->load_sts_at_startup = 1;
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (share->crd_bg_mode == -1)
share->crd_bg_mode = 2;
#endif
if (share->crd_interval == -1)
share->crd_interval = 51;
if (share->crd_mode == -1)
share->crd_mode = 1;
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (share->crd_sync == -1)
share->crd_sync = 0;
#endif
if (share->store_last_crd == -1)
share->store_last_crd = 1;
if (share->load_crd_at_startup == -1)
share->load_crd_at_startup = 1;
if (share->crd_type == -1)
share->crd_type = 2;
if (share->crd_weight == -1)
share->crd_weight = 2;
if (share->internal_offset == -1)
share->internal_offset = 0;
if (share->internal_limit == -1)
share->internal_limit = 9223372036854775807LL;
if (share->split_read == -1)
share->split_read = 9223372036854775807LL;
if (share->semi_split_read == -1)
share->semi_split_read = 2;
if (share->semi_split_read_limit == -1)
share->semi_split_read_limit = 9223372036854775807LL;
if (share->init_sql_alloc_size == -1)
share->init_sql_alloc_size = 1024;
if (share->reset_sql_alloc == -1)
share->reset_sql_alloc = 1;
if (share->multi_split_read == -1)
share->multi_split_read = 100;
if (share->max_order == -1)
share->max_order = 32767;
if (share->semi_table_lock == -1)
share->semi_table_lock = 0;
if (share->semi_table_lock_conn == -1)
share->semi_table_lock_conn = 1;
if (share->selupd_lock_mode == -1)
share->selupd_lock_mode = 1;
if (share->query_cache == -1) if (share->query_cache == -1)
share->query_cache = 0; share->query_cache = 0;
if (share->query_cache_sync == -1) if (share->query_cache_sync == -1)
share->query_cache_sync = 0; share->query_cache_sync = 0;
if (share->bulk_size == -1)
share->bulk_size = 16000;
if (share->bulk_update_mode == -1)
share->bulk_update_mode = 0;
if (share->bulk_update_size == -1)
share->bulk_update_size = 16000;
if (share->internal_optimize == -1)
share->internal_optimize = 0;
if (share->internal_optimize_local == -1)
share->internal_optimize_local = 0;
if (share->scan_rate == -1) if (share->scan_rate == -1)
share->scan_rate = 1; share->scan_rate = 1;
if (share->read_rate == -1) if (share->read_rate == -1)
share->read_rate = 0.0002; share->read_rate = 0.0002;
if (share->priority == -1) if (share->priority == -1)
share->priority = 1000000; share->priority = 1000000;
if (share->quick_mode == -1)
share->quick_mode = 3;
if (share->quick_page_size == -1)
share->quick_page_size = 1024;
if (share->quick_page_byte == -1)
share->quick_page_byte = 10485760;
if (share->low_mem_read == -1)
share->low_mem_read = 1;
if (share->table_count_mode == -1) if (share->table_count_mode == -1)
share->table_count_mode = 0; share->table_count_mode = 0;
if (share->select_column_mode == -1)
share->select_column_mode = 1;
#ifndef WITHOUT_SPIDER_BG_SEARCH
if (share->bgs_mode == -1)
share->bgs_mode = 0;
if (share->bgs_first_read == -1)
share->bgs_first_read = 2;
if (share->bgs_second_read == -1)
share->bgs_second_read = 100;
#endif
if (share->first_read == -1)
share->first_read = 0;
if (share->second_read == -1)
share->second_read = 0;
if (share->auto_increment_mode == -1)
share->auto_increment_mode = 0;
if (share->use_table_charset == -1)
share->use_table_charset = 1;
if (share->use_pushdown_udf == -1)
share->use_pushdown_udf = 1;
if (share->skip_default_condition == -1)
share->skip_default_condition = 0;
if (share->skip_parallel_search == -1)
share->skip_parallel_search = 0;
if (share->direct_dup_insert == -1)
share->direct_dup_insert = 0;
if (share->direct_order_limit == -1)
share->direct_order_limit = 9223372036854775807LL;
if (share->read_only_mode == -1)
share->read_only_mode = 0;
if (share->error_read_mode == -1)
share->error_read_mode = 0;
if (share->error_write_mode == -1)
share->error_write_mode = 0;
if (share->active_link_count == -1) if (share->active_link_count == -1)
share->active_link_count = share->all_link_count; share->active_link_count = share->all_link_count;
#if defined(HS_HAS_SQLCOM) && defined(HAVE_HANDLERSOCKET)
if (share->hs_result_free_size == -1)
share->hs_result_free_size = 1048576;
#endif
#ifdef HA_CAN_BULK_ACCESS
if (share->bulk_access_free == -1)
share->bulk_access_free = 0;
#endif
#ifdef HA_CAN_FORCE_BULK_UPDATE #ifdef HA_CAN_FORCE_BULK_UPDATE
if (share->force_bulk_update == -1) if (share->force_bulk_update == -1)
share->force_bulk_update = 0; share->force_bulk_update = 0;
...@@ -3891,18 +3757,6 @@ int spider_set_connect_info_default( ...@@ -3891,18 +3757,6 @@ int spider_set_connect_info_default(
if (share->force_bulk_delete == -1) if (share->force_bulk_delete == -1)
share->force_bulk_delete = 0; share->force_bulk_delete = 0;
#endif #endif
if (share->casual_read == -1)
share->casual_read = 0;
if (share->delete_all_rows_type == -1)
{
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
share->delete_all_rows_type = 1;
#else
share->delete_all_rows_type = 0;
#endif
}
if (share->bka_mode == -1)
share->bka_mode = 1;
if (!share->bka_engine) if (!share->bka_engine)
{ {
DBUG_PRINT("info",("spider create default bka_engine")); DBUG_PRINT("info",("spider create default bka_engine"));
......
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