1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge remote-tracking branch 'shagalla/10.3-mdev12172' into 10.3

As a result of this merge the code for the following tasks appears in 10.3:
- MDEV-12172 Implement tables specified by table value constructors
- MDEV-12176 Transform [NOT] IN predicate with long list of values INTO
             [NOT] IN subquery.
This commit is contained in:
Igor Babaev
2017-11-01 21:42:26 -07:00
51 changed files with 5311 additions and 156 deletions

View File

@ -30,7 +30,7 @@
#include "sql_window.h"
#include "sql_trigger.h"
#include "sp.h" // enum stored_procedure_type
#include "sql_tvc.h"
/* YACC and LEX Definitions */
@ -881,6 +881,17 @@ public:
those converted to jtbm nests. The list is emptied when conversion is done.
*/
List<Item_in_subselect> sj_subselects;
/*
List of IN-predicates in this st_select_lex that
can be transformed into IN-subselect defined with TVC.
*/
List<Item_func_in> in_funcs;
/*
Number of current derived table made with TVC during the
transformation of IN-predicate into IN-subquery for this
st_select_lex.
*/
uint curr_tvc_name;
/*
Needed to correctly generate 'PRIMARY' or 'SIMPLE' for select_type column
@ -1017,6 +1028,9 @@ public:
/* it is for correct printing SELECT options */
thr_lock_type lock_type;
table_value_constr *tvc;
bool in_tvc;
void init_query();
void init_select();
@ -1232,7 +1246,7 @@ public:
ORDER *find_common_window_func_partition_fields(THD *thd);
bool cond_pushdown_is_allowed() const
{ return !olap && !explicit_limit; }
{ return !olap && !explicit_limit && !tvc; }
private:
bool m_non_agg_field_used;
@ -1256,7 +1270,12 @@ typedef class st_select_lex SELECT_LEX;
inline bool st_select_lex_unit::is_unit_op ()
{
if (!first_select()->next_select())
return 0;
{
if (first_select()->tvc)
return 1;
else
return 0;
}
enum sub_select_type linkage= first_select()->next_select()->linkage;
return linkage == UNION_TYPE || linkage == INTERSECT_TYPE ||