diff options
author | Alexander Barkov <bar@mariadb.com> | 2019-05-21 14:22:49 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-05-21 14:22:49 +0400 |
commit | 8164bd24a611ee2682ff0ba922fd0da526f75f14 (patch) | |
tree | cfe7ae117353778c867729e16323fb564dbe81c3 /sql | |
parent | ed39181a27ed95e1de63661bdeb6cfc21c3c6c03 (diff) | |
download | mariadb-git-8164bd24a611ee2682ff0ba922fd0da526f75f14.tar.gz |
MDEV-19535 sql_mode=ORACLE: 'SELECT INTO @var FOR UPDATE' does not lock the table
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_lex.cc | 6 | ||||
-rw-r--r-- | sql/sql_lex.h | 1 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 8 | ||||
-rw-r--r-- | sql/sql_yacc_ora.yy | 4 |
4 files changed, 11 insertions, 8 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index adc9c6c752b..67bc8b31a98 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -9470,6 +9470,12 @@ bool LEX::select_finalize(st_select_lex_unit *expr) } +bool LEX::select_finalize(st_select_lex_unit *expr, Lex_select_lock l) +{ + return expr->set_lock_to_the_last_select(l) || + select_finalize(expr); +} + /* "IN" and "EXISTS" subselect can appear in two statement types: diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 7a56ce55297..b205207f64d 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -4452,6 +4452,7 @@ public: LEX_CSTRING *alias); bool parsed_create_view(SELECT_LEX_UNIT *unit, int check); bool select_finalize(st_select_lex_unit *expr); + bool select_finalize(st_select_lex_unit *expr, Lex_select_lock l); void relink_hack(st_select_lex *select_lex); bool stmt_install_plugin(const DDL_options_st &opt, diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 08f9c4b4117..54ec7e95906 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -9122,9 +9122,7 @@ select: opt_procedure_or_into { Lex->pop_select(); - if ($1->set_lock_to_the_last_select($3)) - MYSQL_YYABORT; - if (Lex->select_finalize($1)) + if (Lex->select_finalize($1, $3)) MYSQL_YYABORT; } | with_clause query_expression_body @@ -9139,9 +9137,7 @@ select: Lex->pop_select(); $2->set_with_clause($1); $1->attach_to($2->first_select()); - if ($2->set_lock_to_the_last_select($4)) - MYSQL_YYABORT; - if (Lex->select_finalize($2)) + if (Lex->select_finalize($2, $4)) MYSQL_YYABORT; } ; diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index 1537adaaaf3..89538884d2b 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -9239,7 +9239,7 @@ select: opt_procedure_or_into { Lex->pop_select(); - if (Lex->select_finalize($1)) + if (Lex->select_finalize($1, $3)) MYSQL_YYABORT; } | with_clause query_expression_body @@ -9254,7 +9254,7 @@ select: Lex->pop_select(); $2->set_with_clause($1); $1->attach_to($2->first_select()); - if (Lex->select_finalize($2)) + if (Lex->select_finalize($2, $4)) MYSQL_YYABORT; } ; |