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
9f484b63
Commit
9f484b63
authored
Jun 07, 2017
by
Monty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up replication check in open_temporary_table()
parent
e16425ba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
30 deletions
+16
-30
sql/temporary_tables.cc
sql/temporary_tables.cc
+16
-30
No files found.
sql/temporary_tables.cc
View file @
9f484b63
...
...
@@ -320,16 +320,6 @@ bool THD::open_temporary_table(TABLE_LIST *tl)
TMP_TABLE_SHARE
*
share
;
TABLE
*
table
=
NULL
;
/*
Since temporary tables are not safe for parallel replication, lets
wait for the prior commits in case the table is found to be in use.
*/
if
(
rgi_slave
&&
rgi_slave
->
is_parallel_exec
&&
find_temporary_table
(
tl
)
&&
wait_for_prior_commit
())
DBUG_RETURN
(
true
);
/*
Code in open_table() assumes that TABLE_LIST::table can be non-zero only
for pre-opened temporary tables.
...
...
@@ -350,6 +340,22 @@ bool THD::open_temporary_table(TABLE_LIST *tl)
DBUG_RETURN
(
false
);
}
/*
Temporary tables are not safe for parallel replication. They were
designed to be visible to one thread only, so have no table locking.
Thus there is no protection against two conflicting transactions
committing in parallel and things like that.
So for now, anything that uses temporary tables will be serialised
with anything before it, when using parallel replication.
*/
if
(
rgi_slave
&&
rgi_slave
->
is_parallel_exec
&&
find_temporary_table
(
tl
)
&&
wait_for_prior_commit
())
DBUG_RETURN
(
true
);
/*
First check if there is a reusable open table available in the
open table list.
...
...
@@ -378,26 +384,6 @@ bool THD::open_temporary_table(TABLE_LIST *tl)
DBUG_RETURN
(
false
);
}
/*
Temporary tables are not safe for parallel replication. They were
designed to be visible to one thread only, so have no table locking.
Thus there is no protection against two conflicting transactions
committing in parallel and things like that.
So for now, anything that uses temporary tables will be serialised
with anything before it, when using parallel replication.
TODO: We might be able to introduce a reference count or something
on temp tables, and have slave worker threads wait for it to reach
zero before being allowed to use the temp table. Might not be worth
it though, as statement-based replication using temporary tables is
in any case rather fragile.
*/
if
(
rgi_slave
&&
rgi_slave
->
is_parallel_exec
&&
wait_for_prior_commit
())
DBUG_RETURN
(
true
);
#ifdef WITH_PARTITION_STORAGE_ENGINE
if
(
tl
->
partition_names
)
{
...
...
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