diff options
author | unknown <bell@sanja.is.com.ua> | 2003-10-17 00:36:01 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2003-10-17 00:36:01 +0300 |
commit | e4b7aaac474885a1520946c6e3dc454cefcb3a56 (patch) | |
tree | 2ebdddfb2ccf3da4a7ef04c84e28d2af0546fecc /sql/item_subselect.h | |
parent | e83a7c2cf7b95247e639d9dc5318edfa91416e79 (diff) | |
download | mariadb-git-e4b7aaac474885a1520946c6e3dc454cefcb3a56.tar.gz |
fixed support of used_tables() and const_item() in subqueries
(BUG#1444)
mysql-test/r/subselect.result:
BUG#1444 test
mysql-test/t/subselect.test:
BUG#1444 test
sql/item.cc:
storing used tables in Item_subselect
sql/item_subselect.cc:
fixed support of used_tables() and const_item() in subqueries
sql/item_subselect.h:
fixed support of used_tables() and const_item() in subqueries
Diffstat (limited to 'sql/item_subselect.h')
-rw-r--r-- | sql/item_subselect.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 312b453a5a2..3a543ff288c 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -41,11 +41,15 @@ protected: /* substitution instead of subselect in case of optimization */ Item *substitution; /* engine that perform execution of subselect (single select or union) */ - subselect_engine *engine; + subselect_engine *engine; + /* cache of used external tables */ + table_map used_tables_cache; /* allowed number of columns (1 for single value subqueries) */ uint max_columns; /* work with 'substitution' */ bool have_to_be_excluded; + /* cache of constante state */ + bool const_item_cache; public: /* changed engine indicator */ @@ -85,6 +89,8 @@ public: bool exec(); virtual void fix_length_and_dec(); table_map used_tables() const; + bool const_item() const; + void update_used_tables(); void print(String *str) { if (name) @@ -101,6 +107,8 @@ public: friend class select_subselect; friend class Item_in_optimizer; + friend bool Item_field::fix_fields(THD *, TABLE_LIST *, Item **); + friend bool Item_ref::fix_fields(THD *, TABLE_LIST *, Item **); }; /* single value subselect */ @@ -264,6 +272,8 @@ public: enum Item_result type() { return res_type; } virtual void exclude()= 0; bool may_be_null() { return maybe_null; }; + virtual table_map upper_select_const_tables()= 0; + static table_map calc_const_tables(TABLE_LIST *); }; @@ -285,6 +295,7 @@ public: bool dependent(); bool uncacheable(); void exclude(); + table_map upper_select_const_tables(); }; @@ -302,6 +313,7 @@ public: bool dependent(); bool uncacheable(); void exclude(); + table_map upper_select_const_tables(); }; @@ -328,6 +340,7 @@ public: bool dependent() { return 1; } bool uncacheable() { return 1; } void exclude(); + table_map upper_select_const_tables() { return 0; } }; |