summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index fa484abf0be..4203a556e65 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -5081,8 +5081,8 @@ static bool check_lock_and_start_stmt(THD *thd,
else
lock_type= table_list->lock_type;
- if ((int) lock_type >= (int) TL_WRITE_ALLOW_READ &&
- (int) table_list->table->reginfo.lock_type < (int) TL_WRITE_ALLOW_READ)
+ if ((int) lock_type > (int) TL_WRITE_ALLOW_WRITE &&
+ (int) table_list->table->reginfo.lock_type <= (int) TL_WRITE_ALLOW_WRITE)
{
my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0), table_list->alias);
DBUG_RETURN(1);