Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
00ae4272
Commit
00ae4272
authored
Jan 28, 2022
by
Nayuta Yanagisawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-27642 Spider: remove #ifdef WITHOUT_SPIDER_BG_SEARCH
parent
cfd145fa
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
0 additions
and
382 deletions
+0
-382
storage/spider/ha_spider.cc
storage/spider/ha_spider.cc
+0
-86
storage/spider/spd_conn.cc
storage/spider/spd_conn.cc
+0
-16
storage/spider/spd_conn.h
storage/spider/spd_conn.h
+0
-2
storage/spider/spd_copy_tables.cc
storage/spider/spd_copy_tables.cc
+0
-10
storage/spider/spd_copy_tables.h
storage/spider/spd_copy_tables.h
+0
-2
storage/spider/spd_db_conn.cc
storage/spider/spd_db_conn.cc
+0
-48
storage/spider/spd_db_include.h
storage/spider/spd_db_include.h
+0
-14
storage/spider/spd_direct_sql.cc
storage/spider/spd_direct_sql.cc
+0
-16
storage/spider/spd_direct_sql.h
storage/spider/spd_direct_sql.h
+0
-2
storage/spider/spd_group_by_handler.cc
storage/spider/spd_group_by_handler.cc
+0
-10
storage/spider/spd_include.h
storage/spider/spd_include.h
+0
-34
storage/spider/spd_param.cc
storage/spider/spd_param.cc
+0
-16
storage/spider/spd_param.h
storage/spider/spd_param.h
+0
-8
storage/spider/spd_table.cc
storage/spider/spd_table.cc
+0
-112
storage/spider/spd_table.h
storage/spider/spd_table.h
+0
-2
storage/spider/spd_udf.cc
storage/spider/spd_udf.cc
+0
-2
storage/spider/spd_udf.h
storage/spider/spd_udf.h
+0
-2
No files found.
storage/spider/ha_spider.cc
View file @
00ae4272
This diff is collapsed.
Click to expand it.
storage/spider/spd_conn.cc
View file @
00ae4272
...
...
@@ -58,7 +58,6 @@ pthread_mutex_t spider_conn_id_mutex;
pthread_mutex_t
spider_ipport_conn_mutex
;
ulonglong
spider_conn_id
=
1
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
extern
pthread_attr_t
spider_pt_attr
;
#ifdef HAVE_PSI_INTERFACE
...
...
@@ -66,7 +65,6 @@ extern PSI_mutex_key spd_key_mutex_mta_conn;
extern
PSI_mutex_key
spd_key_mutex_conn_i
;
extern
PSI_mutex_key
spd_key_mutex_conn_loop_check
;
extern
PSI_cond_key
spd_key_cond_conn_i
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
extern
PSI_mutex_key
spd_key_mutex_bg_conn_chain
;
extern
PSI_mutex_key
spd_key_mutex_bg_conn_sync
;
extern
PSI_mutex_key
spd_key_mutex_bg_conn
;
...
...
@@ -85,8 +83,6 @@ extern PSI_thread_key spd_key_thd_bg_sts;
extern
PSI_thread_key
spd_key_thd_bg_crd
;
extern
PSI_thread_key
spd_key_thd_bg_mon
;
#endif
#endif
#endif
/* UTC time zone for timestamp columns */
extern
Time_zone
*
UTC
;
...
...
@@ -268,9 +264,7 @@ int spider_free_conn_alloc(
SPIDER_CONN
*
conn
)
{
DBUG_ENTER
(
"spider_free_conn_alloc"
);
#ifndef WITHOUT_SPIDER_BG_SEARCH
spider_free_conn_thread
(
conn
);
#endif
spider_db_disconnect
(
conn
);
if
(
conn
->
db_conn
)
{
...
...
@@ -1823,7 +1817,6 @@ SPIDER_CONN *spider_tree_delete(
DBUG_RETURN
(
top
);
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
int
spider_set_conn_bg_param
(
ha_spider
*
spider
)
{
...
...
@@ -2070,10 +2063,8 @@ void spider_bg_all_conn_wait(
SPIDER_LINK_STATUS_RECOVERY
)
)
{
conn
=
spider
->
conns
[
roop_count
];
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
conn
&&
result_list
->
bgs_working
)
spider_bg_conn_wait
(
conn
);
#endif
}
DBUG_VOID_RETURN
;
}
...
...
@@ -2082,13 +2073,10 @@ int spider_bg_all_conn_pre_next(
ha_spider
*
spider
,
int
link_idx
)
{
#ifndef WITHOUT_SPIDER_BG_SEARCH
int
roop_start
,
roop_end
,
roop_count
,
lock_mode
,
link_ok
,
error_num
;
SPIDER_RESULT_LIST
*
result_list
=
&
spider
->
result_list
;
SPIDER_SHARE
*
share
=
spider
->
share
;
#endif
DBUG_ENTER
(
"spider_bg_all_conn_pre_next"
);
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
result_list
->
bgs_phase
>
0
)
{
lock_mode
=
spider_conn_lock_mode
(
spider
);
...
...
@@ -2118,7 +2106,6 @@ int spider_bg_all_conn_pre_next(
DBUG_RETURN
(
error_num
);
}
}
#endif
DBUG_RETURN
(
0
);
}
...
...
@@ -2164,10 +2151,8 @@ void spider_bg_all_conn_break(
SPIDER_LINK_STATUS_RECOVERY
)
)
{
conn
=
spider
->
conns
[
roop_count
];
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
conn
&&
result_list
->
bgs_working
)
spider_bg_conn_break
(
conn
,
spider
);
#endif
if
(
spider
->
quick_targets
[
roop_count
])
{
spider_db_free_one_quick_result
((
SPIDER_RESULT
*
)
result_list
->
current
);
...
...
@@ -3947,7 +3932,6 @@ void *spider_bg_mon_action(
}
}
}
#endif
int
spider_conn_first_link_idx
(
THD
*
thd
,
...
...
storage/spider/spd_conn.h
View file @
00ae4272
...
...
@@ -256,7 +256,6 @@ SPIDER_CONN *spider_tree_delete(
SPIDER_CONN
*
top
);
#ifndef WITHOUT_SPIDER_BG_SEARCH
int
spider_set_conn_bg_param
(
ha_spider
*
spider
);
...
...
@@ -353,7 +352,6 @@ void spider_free_mon_threads(
void
*
spider_bg_mon_action
(
void
*
arg
);
#endif
int
spider_conn_first_link_idx
(
THD
*
thd
,
...
...
storage/spider/spd_copy_tables.cc
View file @
00ae4272
...
...
@@ -68,10 +68,8 @@ int spider_udf_set_copy_tables_param_default(
copy_tables
->
use_table_charset
=
1
;
if
(
copy_tables
->
use_transaction
==
-
1
)
copy_tables
->
use_transaction
=
1
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
copy_tables
->
bg_mode
==
-
1
)
copy_tables
->
bg_mode
=
0
;
#endif
DBUG_RETURN
(
0
);
}
...
...
@@ -221,9 +219,7 @@ int spider_udf_parse_copy_tables_param(
copy_tables
->
bulk_insert_rows
=
-
1
;
copy_tables
->
use_table_charset
=
-
1
;
copy_tables
->
use_transaction
=
-
1
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
copy_tables
->
bg_mode
=
-
1
;
#endif
if
(
param_length
==
0
)
goto
set_default
;
...
...
@@ -276,9 +272,7 @@ int spider_udf_parse_copy_tables_param(
goto
error
;
continue
;
case
3
:
#ifndef WITHOUT_SPIDER_BG_SEARCH
SPIDER_PARAM_INT_WITH_MAX
(
"bgm"
,
bg_mode
,
0
,
1
);
#endif
SPIDER_PARAM_INT
(
"bii"
,
bulk_insert_interval
,
0
);
SPIDER_PARAM_LONGLONG
(
"bir"
,
bulk_insert_rows
,
1
);
SPIDER_PARAM_STR
(
"dtb"
,
database
);
...
...
@@ -286,12 +280,10 @@ int spider_udf_parse_copy_tables_param(
SPIDER_PARAM_INT_WITH_MAX
(
"utr"
,
use_transaction
,
0
,
1
);
error_num
=
param_string_parse
.
print_param_error
();
goto
error
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
case
7
:
SPIDER_PARAM_INT_WITH_MAX
(
"bg_mode"
,
bg_mode
,
0
,
1
);
error_num
=
param_string_parse
.
print_param_error
();
goto
error
;
#endif
case
8
:
SPIDER_PARAM_STR
(
"database"
,
database
);
error_num
=
param_string_parse
.
print_param_error
();
...
...
@@ -782,7 +774,6 @@ int spider_udf_copy_tables_create_table_list(
DBUG_RETURN
(
0
);
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
int
spider_udf_bg_copy_exec_sql
(
SPIDER_COPY_TABLE_CONN
*
table_conn
)
{
...
...
@@ -811,7 +802,6 @@ int spider_udf_bg_copy_exec_sql(
conn
->
bg_caller_sync_wait
=
FALSE
;
DBUG_RETURN
(
0
);
}
#endif
long
long
spider_copy_tables_body
(
UDF_INIT
*
initid
,
...
...
storage/spider/spd_copy_tables.h
View file @
00ae4272
...
...
@@ -48,8 +48,6 @@ int spider_udf_copy_tables_create_table_list(
uint
dst_link_idx_list_length
);
#ifndef WITHOUT_SPIDER_BG_SEARCH
int
spider_udf_bg_copy_exec_sql
(
SPIDER_COPY_TABLE_CONN
*
table_conn
);
#endif
storage/spider/spd_db_conn.cc
View file @
00ae4272
...
...
@@ -583,10 +583,8 @@ int spider_db_before_query(
int
error_num
;
DBUG_ENTER
(
"spider_db_before_query"
);
DBUG_ASSERT
(
need_mon
);
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
conn
->
bg_search
)
spider_bg_conn_break
(
conn
,
NULL
);
#endif
conn
->
in_before_query
=
TRUE
;
pthread_mutex_assert_owner
(
&
conn
->
mta_conn_mutex
);
DBUG_ASSERT
(
conn
->
mta_conn_mutex_file_pos
.
file_name
);
...
...
@@ -3607,9 +3605,7 @@ int spider_db_free_result(
DBUG_PRINT
(
"info"
,(
"spider result_list->finish_flg = FALSE"
));
result_list
->
finish_flg
=
FALSE
;
result_list
->
quick_phase
=
0
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list
->
bgs_phase
=
0
;
#endif
DBUG_RETURN
(
0
);
}
...
...
@@ -3671,9 +3667,7 @@ int spider_db_store_result(
current
=
(
SPIDER_RESULT
*
)
result_list
->
current
;
}
else
{
if
(
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list
->
bgs_phase
>
0
||
#endif
result_list
->
quick_phase
>
0
)
{
if
(
result_list
->
bgs_current
==
result_list
->
last
)
...
...
@@ -3701,9 +3695,7 @@ int spider_db_store_result(
result_list
->
bgs_current
=
result_list
->
bgs_current
->
next
;
}
if
(
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list
->
bgs_phase
==
1
||
#endif
result_list
->
quick_phase
==
2
)
{
if
(
result_list
->
low_mem_read
&&
...
...
@@ -3788,15 +3780,11 @@ int spider_db_store_result(
DBUG_PRINT
(
"info"
,(
"spider result_list->finish_flg = TRUE"
));
current
->
finish_flg
=
TRUE
;
result_list
->
finish_flg
=
TRUE
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
result_list
->
bgs_phase
<=
1
)
{
#endif
result_list
->
current_row_num
=
0
;
table
->
status
=
STATUS_NOT_FOUND
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
}
#endif
if
(
!
conn
->
mta_conn_mutex_unlock_later
&&
!
call_db_errorno
)
{
DBUG_ASSERT
(
!
conn
->
mta_conn_mutex_lock_already
);
...
...
@@ -3832,14 +3820,10 @@ int spider_db_store_result(
current
->
finish_flg
=
TRUE
;
result_list
->
finish_flg
=
TRUE
;
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
result_list
->
bgs_phase
<=
1
)
{
#endif
result_list
->
current_row_num
=
0
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
}
#endif
}
}
else
{
/* has_result() for case of result with result_tmp_tbl */
...
...
@@ -3910,9 +3894,7 @@ int spider_db_store_result(
conn
->
quick_target
=
NULL
;
spider
->
quick_targets
[
link_idx
]
=
NULL
;
if
(
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list
->
bgs_phase
<=
1
&&
#endif
result_list
->
quick_phase
==
0
)
{
result_list
->
current_row_num
=
0
;
...
...
@@ -4088,14 +4070,10 @@ int spider_db_store_result(
spider
->
quick_targets
[
link_idx
]
=
NULL
;
}
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
DBUG_PRINT
(
"info"
,
(
"spider bgs_phase=%d"
,
result_list
->
bgs_phase
));
#endif
DBUG_PRINT
(
"info"
,
(
"spider quick_phase=%d"
,
result_list
->
quick_phase
));
if
(
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list
->
bgs_phase
<=
1
&&
#endif
result_list
->
quick_phase
==
0
)
{
result_list
->
current_row_num
=
0
;
...
...
@@ -4154,9 +4132,7 @@ int spider_db_store_result_for_reuse_cursor(
current
=
(
SPIDER_RESULT
*
)
result_list
->
current
;
}
else
{
if
(
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list
->
bgs_phase
>
0
||
#endif
result_list
->
quick_phase
>
0
)
{
if
(
result_list
->
bgs_current
==
result_list
->
last
)
...
...
@@ -4178,9 +4154,7 @@ int spider_db_store_result_for_reuse_cursor(
result_list
->
bgs_current
=
result_list
->
bgs_current
->
next
;
}
if
(
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list
->
bgs_phase
==
1
||
#endif
result_list
->
quick_phase
==
2
)
{
result_list
->
current
=
result_list
->
bgs_current
;
...
...
@@ -4240,14 +4214,10 @@ int spider_db_store_result_for_reuse_cursor(
current
->
finish_flg
=
TRUE
;
result_list
->
finish_flg
=
TRUE
;
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
result_list
->
bgs_phase
<=
1
)
{
#endif
result_list
->
current_row_num
=
0
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
}
#endif
}
else
{
DBUG_ASSERT
(
current
->
prev
);
DBUG_ASSERT
(
current
->
prev
->
result
);
...
...
@@ -4286,9 +4256,7 @@ int spider_db_store_result_for_reuse_cursor(
conn
->
quick_target
=
NULL
;
spider
->
quick_targets
[
link_idx
]
=
NULL
;
if
(
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list
->
bgs_phase
<=
1
&&
#endif
result_list
->
quick_phase
==
0
)
{
result_list
->
current_row_num
=
0
;
...
...
@@ -4461,14 +4429,10 @@ int spider_db_store_result_for_reuse_cursor(
spider
->
quick_targets
[
link_idx
]
=
NULL
;
}
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
DBUG_PRINT
(
"info"
,
(
"spider bgs_phase=%d"
,
result_list
->
bgs_phase
));
#endif
DBUG_PRINT
(
"info"
,
(
"spider quick_phase=%d"
,
result_list
->
quick_phase
));
if
(
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list
->
bgs_phase
<=
1
&&
#endif
result_list
->
quick_phase
==
0
)
{
result_list
->
current_row_num
=
0
;
...
...
@@ -4684,7 +4648,6 @@ int spider_db_seek_next(
}
#endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
result_list
->
bgs_phase
>
0
)
{
#ifdef SPIDER_HAS_GROUP_BY_HANDLER
...
...
@@ -4728,7 +4691,6 @@ int spider_db_seek_next(
}
#endif
}
else
{
#endif
if
(
result_list
->
current
==
result_list
->
bgs_current
)
{
if
(
result_list
->
finish_flg
)
...
...
@@ -5102,9 +5064,7 @@ int spider_db_seek_next(
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
}
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
}
#endif
DBUG_RETURN
(
spider_db_fetch
(
buf
,
spider
,
table
));
}
else
DBUG_RETURN
(
spider_db_fetch
(
buf
,
spider
,
table
));
...
...
@@ -11311,7 +11271,6 @@ int spider_db_udf_copy_tables(
}
}
*/
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
copy_tables
->
bg_mode
)
{
for
(
dst_tbl_conn
=
copy_tables
->
table_conn
[
1
];
dst_tbl_conn
;
...
...
@@ -11325,7 +11284,6 @@ int spider_db_udf_copy_tables(
}
}
}
else
{
#endif
for
(
dst_tbl_conn
=
copy_tables
->
table_conn
[
1
];
dst_tbl_conn
;
dst_tbl_conn
=
dst_tbl_conn
->
next
)
{
...
...
@@ -11364,11 +11322,8 @@ int spider_db_udf_copy_tables(
pthread_mutex_unlock
(
&
tmp_conn
->
mta_conn_mutex
);
}
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
}
#endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
copy_tables
->
bg_mode
)
{
for
(
dst_tbl_conn
=
copy_tables
->
table_conn
[
1
];
dst_tbl_conn
;
...
...
@@ -11391,7 +11346,6 @@ int spider_db_udf_copy_tables(
}
}
}
#endif
}
if
(
copy_tables
->
use_transaction
)
...
...
@@ -11437,7 +11391,6 @@ int spider_db_udf_copy_tables(
DBUG_RETURN
(
0
);
error_db_query:
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
copy_tables
->
bg_mode
)
{
for
(
dst_tbl_conn
=
copy_tables
->
table_conn
[
1
];
dst_tbl_conn
;
...
...
@@ -11452,7 +11405,6 @@ int spider_db_udf_copy_tables(
}
}
}
#endif
error_unlock_tables:
error_commit:
error_lock_tables:
...
...
storage/spider/spd_db_include.h
View file @
00ae4272
...
...
@@ -1790,13 +1790,9 @@ typedef struct st_spider_result
{
uint
dbton_id
;
SPIDER_DB_RESULT
*
result
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile
#endif
st_spider_result
*
prev
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile
#endif
st_spider_result
*
next
;
SPIDER_POSITION
*
first_position
;
/* for quick mode */
int
pos_page_size
;
/* for quick mode */
...
...
@@ -1815,17 +1811,11 @@ typedef struct st_spider_result
typedef
struct
st_spider_result_list
{
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile
#endif
SPIDER_RESULT
*
first
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile
#endif
SPIDER_RESULT
*
last
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile
#endif
SPIDER_RESULT
*
current
;
KEY
*
key_info
;
int
key_order
;
...
...
@@ -1889,14 +1879,11 @@ typedef struct st_spider_result_list
longlong
second_read
;
int
set_split_read_count
;
int
*
casual_read
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
/* 0:nomal 1:store 2:store end */
volatile
#endif
int
quick_phase
;
bool
keyread
;
TABLE
*
table
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile
int
bgs_error
;
bool
bgs_error_with_message
;
char
bgs_error_msg
[
MYSQL_ERRMSG_SIZE
];
...
...
@@ -1907,7 +1894,6 @@ typedef struct st_spider_result_list
volatile
longlong
bgs_second_read
;
volatile
longlong
bgs_split_read
;
volatile
#endif
SPIDER_RESULT
*
bgs_current
;
SPIDER_DB_ROW
*
tmp_pos_row_first
;
}
SPIDER_RESULT_LIST
;
storage/spider/spd_direct_sql.cc
View file @
00ae4272
...
...
@@ -1427,7 +1427,6 @@ void spider_udf_free_direct_sql_alloc(
)
{
SPIDER_BG_DIRECT_SQL
*
bg_direct_sql
;
DBUG_ENTER
(
"spider_udf_free_direct_sql_alloc"
);
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
bg
)
{
pthread_mutex_lock
(
direct_sql
->
bg_mutex
);
...
...
@@ -1441,7 +1440,6 @@ void spider_udf_free_direct_sql_alloc(
pthread_cond_signal
(
direct_sql
->
bg_cond
);
pthread_mutex_unlock
(
direct_sql
->
bg_mutex
);
}
#endif
if
(
direct_sql
->
real_table_used
&&
direct_sql
->
open_tables_thd
)
{
spider_sys_close_table
(
direct_sql
->
open_tables_thd
,
...
...
@@ -1556,7 +1554,6 @@ long long spider_direct_sql_body(
my_error
(
ER_OUT_OF_RESOURCES
,
MYF
(
0
),
HA_ERR_OUT_OF_MEM
);
goto
error
;
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
bg
)
{
bg_direct_sql
=
(
SPIDER_BG_DIRECT_SQL
*
)
initid
->
ptr
;
...
...
@@ -1574,7 +1571,6 @@ long long spider_direct_sql_body(
direct_sql
->
parent
=
bg_direct_sql
;
bg_direct_sql
->
called_cnt
++
;
}
#endif
if
(
!
(
trx
=
spider_get_trx
(
thd
,
TRUE
,
&
error_num
)))
{
if
(
error_num
==
HA_ERR_OUT_OF_MEM
)
...
...
@@ -1723,7 +1719,6 @@ long long spider_direct_sql_body(
direct_sql
->
sql_length
=
0
;
direct_sql
->
sql
=
sql
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
bg
)
{
if
((
error_num
=
spider_udf_bg_direct_sql
(
direct_sql
)))
...
...
@@ -1733,7 +1728,6 @@ long long spider_direct_sql_body(
goto
error
;
}
}
else
{
#endif
if
(
conn
->
bg_init
)
pthread_mutex_lock
(
&
conn
->
bg_conn_mutex
);
if
((
error_num
=
spider_db_udf_direct_sql
(
direct_sql
)))
...
...
@@ -1750,15 +1744,11 @@ long long spider_direct_sql_body(
pthread_mutex_unlock
(
&
conn
->
bg_conn_mutex
);
if
(
direct_sql
->
modified_non_trans_table
)
thd
->
transaction
->
stmt
.
modified_non_trans_table
=
TRUE
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
}
if
(
!
bg
)
{
#endif
spider_udf_free_direct_sql_alloc
(
direct_sql
,
FALSE
);
#ifndef WITHOUT_SPIDER_BG_SEARCH
}
#endif
DBUG_RETURN
(
1
);
error:
...
...
@@ -1799,7 +1789,6 @@ my_bool spider_direct_sql_init_body(
strcpy
(
message
,
"spider_(bg)_direct_sql() requires string arguments"
);
goto
error
;
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
bg
)
{
if
(
!
(
bg_direct_sql
=
(
SPIDER_BG_DIRECT_SQL
*
)
...
...
@@ -1823,15 +1812,12 @@ my_bool spider_direct_sql_init_body(
}
initid
->
ptr
=
(
char
*
)
bg_direct_sql
;
}
#endif
DBUG_RETURN
(
FALSE
);
#ifndef WITHOUT_SPIDER_BG_SEARCH
error_cond_init:
pthread_mutex_destroy
(
&
bg_direct_sql
->
bg_mutex
);
error_mutex_init:
spider_free
(
spider_current_trx
,
bg_direct_sql
,
MYF
(
0
));
#endif
error:
DBUG_RETURN
(
TRUE
);
}
...
...
@@ -1859,7 +1845,6 @@ void spider_direct_sql_deinit_body(
DBUG_VOID_RETURN
;
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
void
spider_direct_sql_bg_start
(
UDF_INIT
*
initid
)
{
...
...
@@ -1948,4 +1933,3 @@ int spider_udf_bg_direct_sql(
}
DBUG_RETURN
(
0
);
}
#endif
storage/spider/spd_direct_sql.h
View file @
00ae4272
...
...
@@ -60,8 +60,6 @@ void spider_udf_free_direct_sql_alloc(
my_bool
bg
);
#ifndef WITHOUT_SPIDER_BG_SEARCH
int
spider_udf_bg_direct_sql
(
SPIDER_DIRECT_SQL
*
direct_sql
);
#endif
storage/spider/spd_group_by_handler.cc
View file @
00ae4272
...
...
@@ -1257,9 +1257,7 @@ int spider_group_by_handler::init_scan()
)
{
result_list
->
internal_limit
=
select_limit
/* + offset_limit */
;
result_list
->
split_read
=
select_limit
/* + offset_limit */
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
result_list
->
bgs_split_read
=
select_limit
/* + offset_limit */
;
#endif
result_list
->
split_read_base
=
9223372036854775807LL
;
result_list
->
semi_split_read
=
0
;
...
...
@@ -1270,10 +1268,8 @@ int spider_group_by_handler::init_scan()
}
result_list
->
semi_split_read_base
=
0
;
result_list
->
set_split_read
=
TRUE
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
((
error_num
=
spider_set_conn_bg_param
(
spider
)))
DBUG_RETURN
(
error_num
);
#endif
DBUG_PRINT
(
"info"
,(
"spider result_list.finish_flg = FALSE"
));
result_list
->
finish_flg
=
FALSE
;
result_list
->
record_num
=
0
;
...
...
@@ -1381,7 +1377,6 @@ int spider_group_by_handler::init_scan()
link_idx
=
link_idx_holder
->
link_idx
;
dbton_hdl
=
spider
->
dbton_handler
[
conn
->
dbton_id
];
spider
->
link_idx_chain
=
link_idx_chain
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
result_list
->
bgs_phase
>
0
)
{
if
((
error_num
=
spider_check_and_init_casual_read
(
trx
->
thd
,
spider
,
...
...
@@ -1405,7 +1400,6 @@ int spider_group_by_handler::init_scan()
DBUG_RETURN
(
error_num
);
}
}
else
{
#endif
pthread_mutex_assert_not_owner
(
&
conn
->
mta_conn_mutex
);
if
(
dbton_hdl
->
need_lock_before_set_sql_for_exec
(
SPIDER_SQL_TYPE_SELECT_SQL
))
...
...
@@ -1511,9 +1505,7 @@ int spider_group_by_handler::init_scan()
SPIDER_CLEAR_FILE_POS
(
&
conn
->
mta_conn_mutex_file_pos
);
pthread_mutex_unlock
(
&
conn
->
mta_conn_mutex
);
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
}
#endif
}
first
=
TRUE
;
...
...
@@ -1552,7 +1544,6 @@ int spider_group_by_handler::next_row()
table
->
status
=
STATUS_NOT_FOUND
;
DBUG_RETURN
(
spider
->
store_error_num
);
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
spider
->
result_list
.
bgs_phase
>
0
)
{
fields
->
set_pos_to_first_link_idx_chain
();
...
...
@@ -1581,7 +1572,6 @@ int spider_group_by_handler::next_row()
}
}
}
#endif
spider
->
use_pre_call
=
FALSE
;
}
}
else
if
(
offset_limit
)
...
...
storage/spider/spd_include.h
View file @
00ae4272
...
...
@@ -198,7 +198,6 @@ typedef struct st_spider_share SPIDER_SHARE;
typedef
struct
st_spider_table_mon_list
SPIDER_TABLE_MON_LIST
;
typedef
struct
st_spider_ip_port_conn
SPIDER_IP_PORT_CONN
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
typedef
struct
st_spider_thread
{
uint
thread_idx
;
...
...
@@ -215,7 +214,6 @@ typedef struct st_spider_thread
volatile
SPIDER_SHARE
*
queue_first
;
volatile
SPIDER_SHARE
*
queue_last
;
}
SPIDER_THREAD
;
#endif
typedef
struct
st_spider_file_pos
{
...
...
@@ -434,11 +432,8 @@ typedef struct st_spider_conn
uint
tgt_driver_length
;
uint
dbton_id
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile
#endif
void
*
quick_target
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile
bool
bg_init
;
volatile
bool
bg_break
;
volatile
bool
bg_kill
;
...
...
@@ -469,10 +464,7 @@ typedef struct st_spider_conn
const
char
*
bg_job_stack_file_name
;
ulong
bg_job_stack_line_no
;
uint
bg_job_stack_cur_pos
;
#endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile
#endif
int
*
need_mon
;
int
*
conn_need_mon
;
...
...
@@ -781,7 +773,6 @@ typedef struct st_spider_share
uchar
*
table_mon_mutex_bitmap
;
volatile
bool
sts_init
;
volatile
time_t
sts_get_time
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile
time_t
bg_sts_try_time
;
volatile
double
bg_sts_interval
;
volatile
int
bg_sts_mode
;
...
...
@@ -796,9 +787,7 @@ typedef struct st_spider_share
pthread_cond_t
bg_sts_cond
;
pthread_cond_t
bg_sts_sync_cond
;
volatile
bool
crd_init
;
#endif
volatile
time_t
crd_get_time
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile
time_t
bg_crd_try_time
;
volatile
double
bg_crd_interval
;
volatile
int
bg_crd_mode
;
...
...
@@ -812,8 +801,6 @@ typedef struct st_spider_share
pthread_t
bg_crd_thread
;
pthread_cond_t
bg_crd_cond
;
pthread_cond_t
bg_crd_sync_cond
;
#endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
volatile
bool
bg_mon_init
;
volatile
bool
bg_mon_kill
;
THD
**
bg_mon_thds
;
...
...
@@ -821,8 +808,6 @@ typedef struct st_spider_share
pthread_mutex_t
*
bg_mon_mutexes
;
pthread_cond_t
*
bg_mon_conds
;
pthread_cond_t
*
bg_mon_sleep_conds
;
#endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
/* static bg thread for sts and crd */
TABLE
table
;
ha_spider
*
sts_spider
;
...
...
@@ -839,7 +824,6 @@ typedef struct st_spider_share
volatile
SPIDER_SHARE
*
sts_next
;
volatile
SPIDER_SHARE
*
crd_prev
;
volatile
SPIDER_SHARE
*
crd_next
;
#endif
MEM_ROOT
mem_root
;
...
...
@@ -861,9 +845,7 @@ typedef struct st_spider_share
longlong
additional_table_flags
;
bool
have_recovery_link
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
int
sts_bg_mode
;
#endif
double
sts_interval
;
int
sts_mode
;
#ifdef WITH_PARTITION_STORAGE_ENGINE
...
...
@@ -871,9 +853,7 @@ typedef struct st_spider_share
#endif
int
store_last_sts
;
int
load_sts_at_startup
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
int
crd_bg_mode
;
#endif
double
crd_interval
;
int
crd_mode
;
#ifdef WITH_PARTITION_STORAGE_ENGINE
...
...
@@ -913,11 +893,9 @@ typedef struct st_spider_share
int
low_mem_read
;
int
table_count_mode
;
int
select_column_mode
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
int
bgs_mode
;
longlong
bgs_first_read
;
longlong
bgs_second_read
;
#endif
longlong
first_read
;
longlong
second_read
;
int
auto_increment_mode
;
...
...
@@ -975,16 +953,12 @@ typedef struct st_spider_share
long
*
tgt_ports
;
long
*
tgt_ssl_vscs
;
long
*
link_statuses
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
long
*
monitoring_bg_flag
;
long
*
monitoring_bg_kind
;
#endif
long
*
monitoring_binlog_pos_at_failing
;
long
*
monitoring_flag
;
long
*
monitoring_kind
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
longlong
*
monitoring_bg_interval
;
#endif
longlong
*
monitoring_limit
;
longlong
*
monitoring_sid
;
long
*
use_handlers
;
...
...
@@ -1067,16 +1041,12 @@ typedef struct st_spider_share
uint
tgt_ports_length
;
uint
tgt_ssl_vscs_length
;
uint
link_statuses_length
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
uint
monitoring_bg_flag_length
;
uint
monitoring_bg_kind_length
;
#endif
uint
monitoring_binlog_pos_at_failing_length
;
uint
monitoring_flag_length
;
uint
monitoring_kind_length
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
uint
monitoring_bg_interval_length
;
#endif
uint
monitoring_limit_length
;
uint
monitoring_sid_length
;
uint
use_handlers_length
;
...
...
@@ -1270,9 +1240,7 @@ typedef struct st_spider_copy_table_conn
spider_db_copy_table
*
copy_table
;
ha_spider
*
spider
;
int
need_mon
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
int
bg_error_num
;
#endif
st_spider_copy_table_conn
*
next
;
}
SPIDER_COPY_TABLE_CONN
;
...
...
@@ -1297,9 +1265,7 @@ typedef struct st_spider_copy_tables
longlong
bulk_insert_rows
;
int
use_table_charset
;
int
use_transaction
;
#ifndef WITHOUT_SPIDER_BG_SEARCH
int
bg_mode
;
#endif
char
*
database
;
...
...
storage/spider/spd_param.cc
View file @
00ae4272
...
...
@@ -1400,7 +1400,6 @@ int spider_param_select_column_mode(
select_column_mode
:
THDVAR
(
thd
,
select_column_mode
));
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
/*
-1 :use table parameter
0 :background search is disabled
...
...
@@ -1480,7 +1479,6 @@ longlong spider_param_bgs_second_read(
DBUG_RETURN
(
THDVAR
(
thd
,
bgs_second_read
)
<
0
?
bgs_second_read
:
THDVAR
(
thd
,
bgs_second_read
));
}
#endif
/*
-1 :use table parameter
...
...
@@ -1670,7 +1668,6 @@ double spider_param_crd_weight(
crd_weight
:
THDVAR
(
thd
,
crd_weight
));
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
/*
-1 :use table parameter
0 :Background confirmation is disabled
...
...
@@ -1697,7 +1694,6 @@ int spider_param_crd_bg_mode(
DBUG_RETURN
(
THDVAR
(
thd
,
crd_bg_mode
)
==
-
1
?
crd_bg_mode
:
THDVAR
(
thd
,
crd_bg_mode
));
}
#endif
/*
-1 :use table parameter
...
...
@@ -1782,7 +1778,6 @@ int spider_param_sts_sync(
}
#endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
/*
-1 :use table parameter
0 :Background confirmation is disabled
...
...
@@ -1809,7 +1804,6 @@ int spider_param_sts_bg_mode(
DBUG_RETURN
(
THDVAR
(
thd
,
sts_bg_mode
)
==
-
1
?
sts_bg_mode
:
THDVAR
(
thd
,
sts_bg_mode
));
}
#endif
/*
0 :always ping
...
...
@@ -2966,7 +2960,6 @@ int spider_param_load_crd_at_startup(
load_crd_at_startup
:
spider_load_crd_at_startup
);
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
static
uint
spider_table_sts_thread_count
;
/*
1-: thread count
...
...
@@ -3012,7 +3005,6 @@ uint spider_param_table_crd_thread_count()
DBUG_ENTER
(
"spider_param_table_crd_thread_count"
);
DBUG_RETURN
(
spider_table_crd_thread_count
);
}
#endif
static
int
spider_slave_trx_isolation
;
/*
...
...
@@ -3189,11 +3181,9 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR
(
quick_page_byte
),
MYSQL_SYSVAR
(
low_mem_read
),
MYSQL_SYSVAR
(
select_column_mode
),
#ifndef WITHOUT_SPIDER_BG_SEARCH
MYSQL_SYSVAR
(
bgs_mode
),
MYSQL_SYSVAR
(
bgs_first_read
),
MYSQL_SYSVAR
(
bgs_second_read
),
#endif
MYSQL_SYSVAR
(
first_read
),
MYSQL_SYSVAR
(
second_read
),
MYSQL_SYSVAR
(
crd_interval
),
...
...
@@ -3205,9 +3195,7 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR
(
load_crd_at_startup
),
MYSQL_SYSVAR
(
crd_type
),
MYSQL_SYSVAR
(
crd_weight
),
#ifndef WITHOUT_SPIDER_BG_SEARCH
MYSQL_SYSVAR
(
crd_bg_mode
),
#endif
MYSQL_SYSVAR
(
sts_interval
),
MYSQL_SYSVAR
(
sts_mode
),
#ifdef WITH_PARTITION_STORAGE_ENGINE
...
...
@@ -3215,9 +3203,7 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
#endif
MYSQL_SYSVAR
(
store_last_sts
),
MYSQL_SYSVAR
(
load_sts_at_startup
),
#ifndef WITHOUT_SPIDER_BG_SEARCH
MYSQL_SYSVAR
(
sts_bg_mode
),
#endif
MYSQL_SYSVAR
(
ping_interval_at_trx_start
),
MYSQL_SYSVAR
(
auto_increment_mode
),
MYSQL_SYSVAR
(
same_server_link
),
...
...
@@ -3266,10 +3252,8 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR
(
bka_table_name_type
),
MYSQL_SYSVAR
(
use_cond_other_than_pk_for_update
),
MYSQL_SYSVAR
(
connect_error_interval
),
#ifndef WITHOUT_SPIDER_BG_SEARCH
MYSQL_SYSVAR
(
table_sts_thread_count
),
MYSQL_SYSVAR
(
table_crd_thread_count
),
#endif
MYSQL_SYSVAR
(
slave_trx_isolation
),
MYSQL_SYSVAR
(
remote_wait_timeout
),
MYSQL_SYSVAR
(
wait_timeout
),
...
...
storage/spider/spd_param.h
View file @
00ae4272
...
...
@@ -182,7 +182,6 @@ int spider_param_select_column_mode(
THD
*
thd
,
int
select_column_mode
);
#ifndef WITHOUT_SPIDER_BG_SEARCH
int
spider_param_bgs_mode
(
THD
*
thd
,
int
bgs_mode
...
...
@@ -195,7 +194,6 @@ longlong spider_param_bgs_second_read(
THD
*
thd
,
longlong
bgs_second_read
);
#endif
longlong
spider_param_first_read
(
THD
*
thd
,
longlong
first_read
...
...
@@ -226,12 +224,10 @@ double spider_param_crd_weight(
THD
*
thd
,
double
crd_weight
);
#ifndef WITHOUT_SPIDER_BG_SEARCH
int
spider_param_crd_bg_mode
(
THD
*
thd
,
int
crd_bg_mode
);
#endif
double
spider_param_sts_interval
(
THD
*
thd
,
double
sts_interval
...
...
@@ -246,12 +242,10 @@ int spider_param_sts_sync(
int
sts_sync
);
#endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
int
spider_param_sts_bg_mode
(
THD
*
thd
,
int
sts_bg_mode
);
#endif
double
spider_param_ping_interval_at_trx_start
(
THD
*
thd
);
...
...
@@ -386,10 +380,8 @@ int spider_param_load_sts_at_startup(
int
spider_param_load_crd_at_startup
(
int
load_crd_at_startup
);
#ifndef WITHOUT_SPIDER_BG_SEARCH
uint
spider_param_table_sts_thread_count
();
uint
spider_param_table_crd_thread_count
();
#endif
int
spider_param_slave_trx_isolation
();
int
spider_param_remote_wait_timeout
(
THD
*
thd
...
...
storage/spider/spd_table.cc
View file @
00ae4272
This diff is collapsed.
Click to expand it.
storage/spider/spd_table.h
View file @
00ae4272
...
...
@@ -759,7 +759,6 @@ int spider_discover_table_structure(
);
#endif
#ifndef WITHOUT_SPIDER_BG_SEARCH
int
spider_create_spider_object_for_share
(
SPIDER_TRX
*
trx
,
SPIDER_SHARE
*
share
,
...
...
@@ -809,7 +808,6 @@ void spider_table_remove_share_from_sts_thread(
void
spider_table_remove_share_from_crd_thread
(
SPIDER_SHARE
*
share
);
#endif
uchar
*
spider_duplicate_char
(
uchar
*
dst
,
uchar
esc
,
...
...
storage/spider/spd_udf.cc
View file @
00ae4272
...
...
@@ -43,7 +43,6 @@ void spider_direct_sql_deinit(
spider_direct_sql_deinit_body
(
initid
);
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
long
long
spider_bg_direct_sql
(
UDF_INIT
*
initid
,
UDF_ARGS
*
args
,
...
...
@@ -83,7 +82,6 @@ void spider_bg_direct_sql_add(
)
{
spider_direct_sql_body
(
initid
,
args
,
is_null
,
error
,
TRUE
);
}
#endif
long
long
spider_ping_table
(
UDF_INIT
*
initid
,
...
...
storage/spider/spd_udf.h
View file @
00ae4272
...
...
@@ -32,7 +32,6 @@ void spider_direct_sql_deinit_body(
UDF_INIT
*
initid
);
#ifndef WITHOUT_SPIDER_BG_SEARCH
void
spider_direct_sql_bg_start
(
UDF_INIT
*
initid
);
...
...
@@ -40,7 +39,6 @@ void spider_direct_sql_bg_start(
long
long
spider_direct_sql_bg_end
(
UDF_INIT
*
initid
);
#endif
long
long
spider_ping_table_body
(
UDF_INIT
*
initid
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment