diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-05-29 22:17:00 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-05-29 22:17:00 +0300 |
commit | f98bb23168ee9bc0da8aa7111f35cf2539986387 (patch) | |
tree | b7e9c3dc28e9d1fd82eebea077f3ca0aac640218 /sql/temporary_tables.cc | |
parent | e35676f5557d68c7b51ba47aa73dcdf72eafa436 (diff) | |
parent | e99ed820d790617a029b03d9c4ab437c246c956a (diff) | |
download | mariadb-git-f98bb23168ee9bc0da8aa7111f35cf2539986387.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'sql/temporary_tables.cc')
-rw-r--r-- | sql/temporary_tables.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sql/temporary_tables.cc b/sql/temporary_tables.cc index 89f40b55f86..eca5dd2a7d5 100644 --- a/sql/temporary_tables.cc +++ b/sql/temporary_tables.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2016 MariaDB Corporation + Copyright (c) 2016, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -377,6 +377,19 @@ bool THD::open_temporary_table(TABLE_LIST *tl) if (!table && (share= find_tmp_table_share(tl))) { table= open_temporary_table(share, tl->get_table_name()); + /* + 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 (table && rgi_slave && + rgi_slave->is_parallel_exec && + wait_for_prior_commit()) + DBUG_RETURN(true); } if (!table) |