From 73ee5be6455474f098ec60596f21d790958780e5 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Thu, 30 Aug 2012 13:52:06 +0500 Subject: [PATCH] MDEV-495 Table logging does not work in TRANSACTION READ ONLY mode. The flag is now checked for MYSQL_LOCK_LOG_TABLE and similar in open_table(). per-file comments: sql/sql_base.cc MDEV-495 Table logging does not work in TRANSACTION READ ONLY mode. --- sql/sql_base.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 07de4b0d761..1942878d9be 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2911,7 +2911,10 @@ bool open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, Check if we're trying to take a write lock in a read only transaction. */ if (table_list->mdl_request.type >= MDL_SHARED_WRITE && - thd->tx_read_only) + thd->tx_read_only && + !(flags & (MYSQL_OPEN_HAS_MDL_LOCK | + MYSQL_LOCK_LOG_TABLE | + MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY))) { my_error(ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION, MYF(0)); DBUG_RETURN(true);