summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 25ead88ac53..58f5ffc5235 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -5892,6 +5892,11 @@ mysql_new_select(LEX *lex, bool move_down)
select_lex->init_query();
select_lex->init_select();
lex->nest_level++;
+ if (lex->nest_level > (int) MAX_SELECT_NESTING)
+ {
+ my_error(ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT,MYF(0),MAX_SELECT_NESTING);
+ DBUG_RETURN(1);
+ }
select_lex->nest_level= lex->nest_level;
/*
Don't evaluate this subquery during statement prepare even if