diff options
author | unknown <gshchepa/uchum@gleb.loc> | 2007-08-03 02:05:10 +0500 |
---|---|---|
committer | unknown <gshchepa/uchum@gleb.loc> | 2007-08-03 02:05:10 +0500 |
commit | cf145f8f425d8cf1fe86ceae7cb049ef5d01b2ea (patch) | |
tree | 64c5c9fec317a59272368b3d43539101875b80b4 /sql | |
parent | 8277581b8952d0c3cde2069de1afbc8afbb9e3f2 (diff) | |
parent | 30f63c14d1ad10286d47d60322a4db1b5decfad1 (diff) | |
download | mariadb-git-cf145f8f425d8cf1fe86ceae7cb049ef5d01b2ea.tar.gz |
Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into gleb.loc:/home/uchum/work/bk/5.0-opt
Diffstat (limited to 'sql')
-rw-r--r-- | sql/share/errmsg.txt | 2 | ||||
-rw-r--r-- | sql/sql_parse.cc | 5 | ||||
-rw-r--r-- | sql/unireg.h | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index a52ffa8216c..6d4ca33ccc7 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5635,3 +5635,5 @@ ER_NON_INSERTABLE_TABLE eng "The target table %-.100s of the %s is not insertable-into" ER_ADMIN_WRONG_MRG_TABLE eng "Table '%-.64s' is differently defined or of non-MyISAM type or doesn't exist" +ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT + eng "Too high level of nesting for select" diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 7d723d3cd5b..a0f834afe60 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5891,6 +5891,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 diff --git a/sql/unireg.h b/sql/unireg.h index 81ca18c1d32..d8301060cc4 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -81,6 +81,8 @@ RAND_TABLE_BIT) #define MAX_FIELDS 4096 /* Limit in the .frm file */ +#define MAX_SELECT_NESTING (sizeof(nesting_map)*8-1) + #define MAX_SORT_MEMORY (2048*1024-MALLOC_OVERHEAD) #define MIN_SORT_MEMORY (32*1024-MALLOC_OVERHEAD) |