summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-08-29 11:38:05 +0300
committerunknown <gkodinov/kgeorge@magare.gmz>2007-08-29 11:38:05 +0300
commit79e87471699778216740757064dda0347cc4291a (patch)
tree87130297b087a6c09815e8dc71083b38a4996d56 /sql/sql_lex.h
parent53daf2e6740de9bab93674511474e71cb69bcc8d (diff)
parent310afbd4a96baeedc7202a3b2cac7860c76d83e2 (diff)
downloadmariadb-git-79e87471699778216740757064dda0347cc4291a.tar.gz
Merge magare.gmz:/home/kgeorge/mysql/work/B30377-5.0-opt
into magare.gmz:/home/kgeorge/mysql/work/B30377-5.1-opt mysql-test/t/status.test: Auto merged mysql-test/r/status.result: merge 5.0->5.1 of the fix for bug 30377 sql/sql_lex.h: merge 5.0->5.1 of the fix for bug 30377 sql/sql_select.cc: merge 5.0->5.1 of the fix for bug 30377
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r--sql/sql_lex.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 057d59d3ccf..d8549be44c7 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -1799,6 +1799,28 @@ typedef struct st_lex : public Query_tables_list
bool table_or_sp_used();
bool is_partition_management() const;
+
+ /**
+ @brief check if the statement is a single-level join
+ @return result of the check
+ @retval TRUE The statement doesn't contain subqueries, unions and
+ stored procedure calls.
+ @retval FALSE There are subqueries, UNIONs or stored procedure calls.
+ */
+ bool is_single_level_stmt()
+ {
+ /*
+ This check exploits the fact that the last added to all_select_list is
+ on its top. So select_lex (as the first added) will be at the tail
+ of the list.
+ */
+ if (&select_lex == all_selects_list && !sroutines.records)
+ {
+ DBUG_ASSERT(!all_selects_list->next_select_in_list());
+ return TRUE;
+ }
+ return FALSE;
+ }
} LEX;
struct st_lex_local: public st_lex