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
4bd8c634
Commit
4bd8c634
authored
Apr 08, 2020
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: don't repeat common code
parent
364e7a9a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
49 deletions
+41
-49
sql/sql_base.cc
sql/sql_base.cc
+41
-49
No files found.
sql/sql_base.cc
View file @
4bd8c634
...
@@ -3103,11 +3103,10 @@ Open_table_context::recover_from_failed_open()
...
@@ -3103,11 +3103,10 @@ Open_table_context::recover_from_failed_open()
switch
(
m_action
)
switch
(
m_action
)
{
{
case
OT_BACKOFF_AND_RETRY
:
case
OT_BACKOFF_AND_RETRY
:
break
;
case
OT_REOPEN_TABLES
:
case
OT_REOPEN_TABLES
:
break
;
break
;
case
OT_DISCOVER
:
case
OT_DISCOVER
:
{
case
OT_REPAIR
:
if
((
result
=
lock_table_names
(
m_thd
,
m_thd
->
lex
->
create_info
,
if
((
result
=
lock_table_names
(
m_thd
,
m_thd
->
lex
->
create_info
,
m_failed_table
,
NULL
,
m_failed_table
,
NULL
,
get_timeout
(),
0
)))
get_timeout
(),
0
)))
...
@@ -3116,6 +3115,10 @@ Open_table_context::recover_from_failed_open()
...
@@ -3116,6 +3115,10 @@ Open_table_context::recover_from_failed_open()
tdc_remove_table
(
m_thd
,
m_failed_table
->
db
.
str
,
tdc_remove_table
(
m_thd
,
m_failed_table
->
db
.
str
,
m_failed_table
->
table_name
.
str
);
m_failed_table
->
table_name
.
str
);
switch
(
m_action
)
{
case
OT_DISCOVER
:
{
m_thd
->
get_stmt_da
()
->
clear_warning_info
(
m_thd
->
query_id
);
m_thd
->
get_stmt_da
()
->
clear_warning_info
(
m_thd
->
query_id
);
m_thd
->
clear_error
();
// Clear error message
m_thd
->
clear_error
();
// Clear error message
...
@@ -3133,26 +3136,16 @@ Open_table_context::recover_from_failed_open()
...
@@ -3133,26 +3136,16 @@ Open_table_context::recover_from_failed_open()
if
(
result
&&
no_such_table_handler
.
safely_trapped_errors
())
if
(
result
&&
no_such_table_handler
.
safely_trapped_errors
())
result
=
FALSE
;
result
=
FALSE
;
}
}
/*
Rollback to start of the current statement to release exclusive lock
on table which was discovered but preserve locks from previous statements
in current transaction.
*/
m_thd
->
mdl_context
.
rollback_to_savepoint
(
start_of_statement_svp
());
break
;
break
;
}
}
case
OT_REPAIR
:
case
OT_REPAIR
:
{
if
((
result
=
lock_table_names
(
m_thd
,
m_thd
->
lex
->
create_info
,
m_failed_table
,
NULL
,
get_timeout
(),
0
)))
break
;
tdc_remove_table
(
m_thd
,
m_failed_table
->
db
.
str
,
m_failed_table
->
table_name
.
str
);
result
=
auto_repair_table
(
m_thd
,
m_failed_table
);
result
=
auto_repair_table
(
m_thd
,
m_failed_table
);
break
;
case
OT_BACKOFF_AND_RETRY
:
case
OT_REOPEN_TABLES
:
case
OT_NO_ACTION
:
DBUG_ASSERT
(
0
);
}
/*
/*
Rollback to start of the current statement to release exclusive lock
Rollback to start of the current statement to release exclusive lock
on table which was discovered but preserve locks from previous statements
on table which was discovered but preserve locks from previous statements
...
@@ -3160,8 +3153,7 @@ Open_table_context::recover_from_failed_open()
...
@@ -3160,8 +3153,7 @@ Open_table_context::recover_from_failed_open()
*/
*/
m_thd
->
mdl_context
.
rollback_to_savepoint
(
start_of_statement_svp
());
m_thd
->
mdl_context
.
rollback_to_savepoint
(
start_of_statement_svp
());
break
;
break
;
}
case
OT_NO_ACTION
:
default:
DBUG_ASSERT
(
0
);
DBUG_ASSERT
(
0
);
}
}
m_thd
->
pop_internal_handler
();
m_thd
->
pop_internal_handler
();
...
...
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