summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-08-18 12:29:06 -0700
committerIgor Babaev <igor@askmonty.org>2013-08-18 12:29:06 -0700
commit7c85205d193dc8ecd8b2ce2796e271536f3b42b1 (patch)
treebec34ce98144ce63affeca27477ee934c41207a9 /sql/sql_lex.cc
parentf0deff867a154879971560f83f62d96bb85140c0 (diff)
downloadmariadb-git-7c85205d193dc8ecd8b2ce2796e271536f3b42b1.tar.gz
Fixed bug mdev-4918.
The function SELECT_LEX::mark_const_derived() must take into account that in DELETE ... RETURNING join == NULL.
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index fd18d2f6c52..18908abbfcd 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -4085,7 +4085,8 @@ void SELECT_LEX::increase_derived_records(ha_rows records)
void SELECT_LEX::mark_const_derived(bool empty)
{
TABLE_LIST *derived= master_unit()->derived;
- if (!join->thd->lex->describe && derived)
+ /* join == NULL in DELETE ... RETURNING */
+ if (!(join && join->thd->lex->describe) && derived)
{
if (!empty)
increase_derived_records(1);