summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2009-04-03 16:46:00 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2009-04-03 16:46:00 -0300
commitec762cbd8220a5b7c1e1a8c9f1f8dbffac7e64ef (patch)
tree043456df5b0aad4de66f579a537690947263e592 /sql/sql_yacc.yy
parent48f435316d4ea7fbf344c01d6dcfd3d5d6d4c908 (diff)
parentaebaf079d1611532767dd0c9b183ca73a07b6ac9 (diff)
downloadmariadb-git-ec762cbd8220a5b7c1e1a8c9f1f8dbffac7e64ef.tar.gz
Merge Bug#43230 into mysql-5.1-bugteam
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index e56ff7c6ad7..7752ccce73d 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -6538,6 +6538,7 @@ select_lock_type:
lex->current_select->set_lock_for_tables(TL_WRITE);
lex->current_select->lock_option= TL_WRITE;
lex->safe_to_cache_query=0;
+ lex->protect_against_global_read_lock= TRUE;
}
| LOCK_SYM IN_SYM SHARE_SYM MODE_SYM
{
@@ -12182,8 +12183,12 @@ table_lock_list:
table_lock:
table_ident opt_table_alias lock_option
{
- if (!Select->add_table_to_list(YYTHD, $1, $2, 0, (thr_lock_type) $3))
+ thr_lock_type lock_type= (thr_lock_type) $3;
+ if (!Select->add_table_to_list(YYTHD, $1, $2, 0, lock_type))
MYSQL_YYABORT;
+ /* If table is to be write locked, protect from a impending GRL. */
+ if (lock_type >= TL_WRITE_ALLOW_WRITE)
+ Lex->protect_against_global_read_lock= TRUE;
}
;