diff options
author | Igor Babaev <igor@askmonty.org> | 2016-07-26 22:58:33 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2016-07-26 22:58:33 -0700 |
commit | f982d1074a3bc880462ab2372803b278af8dc4dd (patch) | |
tree | e20df01a7f0378e045811b2d7e44585ef8b8c389 /sql/sql_cte.h | |
parent | 8c6a9aa30f9e74388aaf923ac8e3b19ca0f86188 (diff) | |
download | mariadb-git-f982d1074a3bc880462ab2372803b278af8dc4dd.tar.gz |
Fixed the following problem:
Temporary tables created for recursive CTE
were instantiated at the prepare phase. As
a result these temporary tables missed
indexes for look-ups and optimizer could not
use them.
Diffstat (limited to 'sql/sql_cte.h')
-rw-r--r-- | sql/sql_cte.h | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/sql/sql_cte.h b/sql/sql_cte.h index 8b81644e838..52b2b8f4f77 100644 --- a/sql/sql_cte.h +++ b/sql/sql_cte.h @@ -6,15 +6,15 @@ class select_union; struct st_unit_ctxt_elem; -/** - @class With_clause - @brief Set of with_elements - It has a reference to the first with element from this with clause. - This reference allows to navigate through all the elements of the with clause. - It contains a reference to the unit to which this with clause is attached. - It also contains a flag saying whether this with clause was specified as recursive. -*/ +/** + @class With_element + @brief Definition of a CTE table + + It contains a reference to the name of the table introduced by this with element, + and a reference to the unit that specificies this table. Also it contains + a reference to the with clause to which this element belongs to. +*/ class With_element : public Sql_alloc { @@ -184,18 +184,20 @@ public: void set_result_table(TABLE *tab) { result_table= tab; } + bool instantiate_tmp_tables(); + friend class With_clause; }; - /** - @class With_element - @brief Definition of a CTE table - - It contains a reference to the name of the table introduced by this with element, - and a reference to the unit that specificies this table. Also it contains - a reference to the with clause to which this element belongs to. -*/ + @class With_clause + @brief Set of with_elements + + It has a reference to the first with element from this with clause. + This reference allows to navigate through all the elements of the with clause. + It contains a reference to the unit to which this with clause is attached. + It also contains a flag saying whether this with clause was specified as recursive. +*/ class With_clause : public Sql_alloc { |