diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2008-09-29 10:53:40 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2008-09-29 10:53:40 -0300 |
commit | 35ffaf10e341e27b1361afbcb76a861f35cfa3c3 (patch) | |
tree | 02f99999115e60b4d66c4d6b46fb4b770b53a3ff /sql/lock.cc | |
parent | 7388a9f54a6ad363afa82da463efe6d3510868dc (diff) | |
download | mariadb-git-35ffaf10e341e27b1361afbcb76a861f35cfa3c3.tar.gz |
Bug#34306: Can't make copy of log tables when server binary log is enabled
The problem is that when statement-based replication was enabled,
statements such as INSERT INTO .. SELECT FROM .. and CREATE TABLE
.. SELECT FROM need to grab a read lock on the source table that
does not permit concurrent inserts, which would in turn be denied
if the source table is a log table because log tables can't be
locked exclusively.
The solution is to not take such a lock when the source table is
a log table as it is unsafe to replicate log tables under statement
based replication. Furthermore, the read lock that does not permits
concurrent inserts is now only taken if statement-based replication
is enabled and if the source table is not a log table.
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index 675b94c2175..faddb8c586c 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -854,7 +854,7 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, if ((table=table_ptr[i])->s->tmp_table == NON_TRANSACTIONAL_TMP_TABLE) continue; lock_type= table->reginfo.lock_type; - DBUG_ASSERT (lock_type != TL_WRITE_DEFAULT); + DBUG_ASSERT(lock_type != TL_WRITE_DEFAULT && lock_type != TL_READ_DEFAULT); if (lock_type >= TL_WRITE_ALLOW_WRITE) { *write_lock_used=table; |