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
4d980a47
Commit
4d980a47
authored
10 years ago
by
Kentoku SHIBA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete all rows type
parent
d1ceb97a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
0 deletions
+46
-0
storage/spider/ha_spider.cc
storage/spider/ha_spider.cc
+2
-0
storage/spider/spd_include.h
storage/spider/spd_include.h
+1
-0
storage/spider/spd_param.cc
storage/spider/spd_param.cc
+27
-0
storage/spider/spd_param.h
storage/spider/spd_param.h
+4
-0
storage/spider/spd_table.cc
storage/spider/spd_table.cc
+12
-0
No files found.
storage/spider/ha_spider.cc
View file @
4d980a47
...
...
@@ -9994,6 +9994,8 @@ int ha_spider::delete_all_rows()
backup_error_status
();
DBUG_ENTER
(
"ha_spider::delete_all_rows"
);
DBUG_PRINT
(
"info"
,(
"spider this=%p"
,
this
));
if
(
spider_param_delete_all_rows_type
(
thd
,
share
->
delete_all_rows_type
))
DBUG_RETURN
(
HA_ERR_WRONG_COMMAND
);
if
(
spider_param_read_only_mode
(
thd
,
share
->
read_only_mode
))
{
my_printf_error
(
ER_SPIDER_READ_ONLY_NUM
,
ER_SPIDER_READ_ONLY_STR
,
MYF
(
0
),
...
...
This diff is collapsed.
Click to expand it.
storage/spider/spd_include.h
View file @
4d980a47
...
...
@@ -759,6 +759,7 @@ typedef struct st_spider_share
int
force_bulk_delete
;
#endif
int
casual_read
;
int
delete_all_rows_type
;
int
bka_mode
;
char
*
bka_engine
;
...
...
This diff is collapsed.
Click to expand it.
storage/spider/spd_param.cc
View file @
4d980a47
...
...
@@ -2934,6 +2934,32 @@ my_bool spider_param_dry_access()
DBUG_RETURN
(
spider_dry_access
);
}
/*
-1 :use table parameter
0 :fast
1 :correct delete row number
*/
static
MYSQL_THDVAR_INT
(
delete_all_rows_type
,
/* name */
PLUGIN_VAR_RQCMDARG
,
/* opt */
"The type of delete_all_rows"
,
/* comment */
NULL
,
/* check */
NULL
,
/* update */
-
1
,
/* def */
-
1
,
/* min */
1
,
/* max */
0
/* blk */
);
int
spider_param_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
));
}
static
struct
st_mysql_storage_engine
spider_storage_engine
=
{
MYSQL_HANDLERTON_INTERFACE_VERSION
};
...
...
@@ -3066,6 +3092,7 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR
(
internal_xa_id_type
),
MYSQL_SYSVAR
(
casual_read
),
MYSQL_SYSVAR
(
dry_access
),
MYSQL_SYSVAR
(
delete_all_rows_type
),
NULL
};
...
...
This diff is collapsed.
Click to expand it.
storage/spider/spd_param.h
View file @
4d980a47
...
...
@@ -379,3 +379,7 @@ int spider_param_casual_read(
int
casual_read
);
my_bool
spider_param_dry_access
();
int
spider_param_delete_all_rows_type
(
THD
*
thd
,
int
delete_all_rows_type
);
This diff is collapsed.
Click to expand it.
storage/spider/spd_table.cc
View file @
4d980a47
...
...
@@ -1793,6 +1793,7 @@ int spider_parse_connect_info(
share
->
force_bulk_delete
=
-
1
;
#endif
share
->
casual_read
=
-
1
;
share
->
delete_all_rows_type
=
-
1
;
#ifdef WITH_PARTITION_STORAGE_ENGINE
for
(
roop_count
=
4
;
roop_count
>
0
;
roop_count
--
)
...
...
@@ -1930,6 +1931,7 @@ int spider_parse_connect_info(
2147483647
);
SPIDER_PARAM_INT_WITH_MAX
(
"ctp"
,
crd_type
,
0
,
2
);
SPIDER_PARAM_DOUBLE
(
"cwg"
,
crd_weight
,
1
);
SPIDER_PARAM_INT_WITH_MAX
(
"dat"
,
delete_all_rows_type
,
0
,
1
);
SPIDER_PARAM_INT_WITH_MAX
(
"ddi"
,
direct_dup_insert
,
0
,
1
);
SPIDER_PARAM_STR_LIST
(
"dff"
,
tgt_default_files
);
SPIDER_PARAM_STR_LIST
(
"dfg"
,
tgt_default_groups
);
...
...
@@ -2262,6 +2264,8 @@ int spider_parse_connect_info(
case
20
:
SPIDER_PARAM_LONGLONG_LIST_WITH_MAX
(
"monitoring_server_id"
,
monitoring_sid
,
0
,
4294967295LL
);
SPIDER_PARAM_INT_WITH_MAX
(
"delete_all_rows_type"
,
delete_all_rows_type
,
0
,
1
);
error_num
=
ER_SPIDER_INVALID_CONNECT_INFO_NUM
;
my_printf_error
(
error_num
,
ER_SPIDER_INVALID_CONNECT_INFO_STR
,
MYF
(
0
),
tmp_ptr
);
...
...
@@ -3441,6 +3445,14 @@ int spider_set_connect_info_default(
#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
)
...
...
This diff is collapsed.
Click to expand it.
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