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
198af54b
Commit
198af54b
authored
Apr 03, 2020
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-20494 Fix wrongly ignored error status
parent
76063c2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
25 deletions
+15
-25
sql/sql_partition.cc
sql/sql_partition.cc
+15
-25
No files found.
sql/sql_partition.cc
View file @
198af54b
...
...
@@ -6848,9 +6848,9 @@ static void release_log_entries(partition_info *part_info)
alter_partition_lock_handling()
lpt Struct carrying parameters
RETURN VALUES
NONE
true on error
*/
static
void
alter_partition_lock_handling
(
ALTER_PARTITION_PARAM_TYPE
*
lpt
)
static
bool
alter_partition_lock_handling
(
ALTER_PARTITION_PARAM_TYPE
*
lpt
)
{
THD
*
thd
=
lpt
->
thd
;
...
...
@@ -6864,24 +6864,9 @@ static void alter_partition_lock_handling(ALTER_PARTITION_PARAM_TYPE *lpt)
lpt
->
table
=
0
;
lpt
->
table_list
->
table
=
0
;
if
(
thd
->
locked_tables_mode
)
{
Diagnostics_area
*
stmt_da
=
NULL
;
Diagnostics_area
tmp_stmt_da
(
true
);
if
(
unlikely
(
thd
->
is_error
()))
{
/* reopen might fail if we have a previous error, use a temporary da. */
stmt_da
=
thd
->
get_stmt_da
();
thd
->
set_stmt_da
(
&
tmp_stmt_da
);
}
return
thd
->
locked_tables_list
.
reopen_tables
(
thd
,
false
);
// TODO: why error status of reopen_tables() is ignored?
if
(
unlikely
(
thd
->
locked_tables_list
.
reopen_tables
(
thd
,
false
)))
sql_print_warning
(
"We failed to reacquire LOCKs in ALTER TABLE"
);
if
(
stmt_da
)
thd
->
set_stmt_da
(
stmt_da
);
}
return
false
;
}
...
...
@@ -7082,6 +7067,8 @@ void handle_alter_part_error(ALTER_PARTITION_PARAM_TYPE *lpt,
thd
->
set_stmt_da
(
&
tmp_stmt_da
);
}
/* NB: error status is not needed here, the statement fails with
the original error. */
if
(
unlikely
(
thd
->
locked_tables_list
.
reopen_tables
(
thd
,
false
)))
sql_print_warning
(
"We failed to reacquire LOCKs in ALTER TABLE"
);
...
...
@@ -7305,13 +7292,14 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
ERROR_INJECT_ERROR
(
"fail_drop_partition_8"
)
||
(
write_log_completed
(
lpt
,
FALSE
),
FALSE
)
||
ERROR_INJECT_CRASH
(
"crash_drop_partition_9"
)
||
ERROR_INJECT_ERROR
(
"fail_drop_partition_9"
)
||
(
alter_partition_lock_handling
(
lpt
),
FALSE
))
ERROR_INJECT_ERROR
(
"fail_drop_partition_9"
))
{
handle_alter_part_error
(
lpt
,
action_completed
,
TRUE
,
frm_install
,
close_table_on_failure
);
goto
err
;
}
if
(
alter_partition_lock_handling
(
lpt
))
goto
err
;
}
else
if
((
alter_info
->
partition_flags
&
ALTER_PARTITION_ADD
)
&&
(
part_info
->
part_type
==
RANGE_PARTITION
||
...
...
@@ -7382,13 +7370,14 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
ERROR_INJECT_ERROR
(
"fail_add_partition_9"
)
||
(
write_log_completed
(
lpt
,
FALSE
),
FALSE
)
||
ERROR_INJECT_CRASH
(
"crash_add_partition_10"
)
||
ERROR_INJECT_ERROR
(
"fail_add_partition_10"
)
||
(
alter_partition_lock_handling
(
lpt
),
FALSE
))
ERROR_INJECT_ERROR
(
"fail_add_partition_10"
))
{
handle_alter_part_error
(
lpt
,
action_completed
,
FALSE
,
frm_install
,
close_table_on_failure
);
goto
err
;
}
if
(
alter_partition_lock_handling
(
lpt
))
goto
err
;
}
else
{
...
...
@@ -7487,13 +7476,14 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
ERROR_INJECT_ERROR
(
"fail_change_partition_11"
)
||
(
write_log_completed
(
lpt
,
FALSE
),
FALSE
)
||
ERROR_INJECT_CRASH
(
"crash_change_partition_12"
)
||
ERROR_INJECT_ERROR
(
"fail_change_partition_12"
)
||
(
alter_partition_lock_handling
(
lpt
),
FALSE
))
ERROR_INJECT_ERROR
(
"fail_change_partition_12"
))
{
handle_alter_part_error
(
lpt
,
action_completed
,
FALSE
,
frm_install
,
close_table_on_failure
);
goto
err
;
}
if
(
alter_partition_lock_handling
(
lpt
))
goto
err
;
}
downgrade_mdl_if_lock_tables_mode
(
thd
,
mdl_ticket
,
MDL_SHARED_NO_READ_WRITE
);
/*
...
...
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