mirror of
https://github.com/MariaDB/server.git
synced 2026-05-02 05:05:33 +02:00
Trivial cleanups, no logic changes
- Fold long comment rows and updated comments - Moved one private function in class Item_func_rand among other private functions
This commit is contained in:
parent
3d56bea3ef
commit
c8992fc35b
4 changed files with 43 additions and 36 deletions
|
|
@ -1962,6 +1962,7 @@ class Item_func_rand :public Item_real_func
|
||||||
bool first_eval; // TRUE if val_real() is called 1st time
|
bool first_eval; // TRUE if val_real() is called 1st time
|
||||||
bool check_arguments() const
|
bool check_arguments() const
|
||||||
{ return check_argument_types_can_return_int(0, arg_count); }
|
{ return check_argument_types_can_return_int(0, arg_count); }
|
||||||
|
void seed_random (Item * val);
|
||||||
public:
|
public:
|
||||||
Item_func_rand(THD *thd, Item *a):
|
Item_func_rand(THD *thd, Item *a):
|
||||||
Item_real_func(thd, a), rand(0), first_eval(TRUE) {}
|
Item_real_func(thd, a), rand(0), first_eval(TRUE) {}
|
||||||
|
|
@ -1974,12 +1975,11 @@ public:
|
||||||
void cleanup() { first_eval= TRUE; Item_real_func::cleanup(); }
|
void cleanup() { first_eval= TRUE; Item_real_func::cleanup(); }
|
||||||
bool check_vcol_func_processor(void *arg)
|
bool check_vcol_func_processor(void *arg)
|
||||||
{
|
{
|
||||||
return mark_unsupported_function(func_name(), "()", arg, VCOL_NON_DETERMINISTIC);
|
return mark_unsupported_function(func_name(), "()", arg,
|
||||||
|
VCOL_NON_DETERMINISTIC);
|
||||||
}
|
}
|
||||||
Item *get_copy(THD *thd)
|
Item *get_copy(THD *thd)
|
||||||
{ return get_item_copy<Item_func_rand>(thd, this); }
|
{ return get_item_copy<Item_func_rand>(thd, this); }
|
||||||
private:
|
|
||||||
void seed_random (Item * val);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10279,7 +10279,7 @@ bool LEX::sp_proc_stmt_statement_finalize(THD *thd, bool no_lookahead)
|
||||||
It is done by transformer.
|
It is done by transformer.
|
||||||
|
|
||||||
The extracted condition is saved in cond_pushed_into_where of this select.
|
The extracted condition is saved in cond_pushed_into_where of this select.
|
||||||
cond can remain un empty after the extraction of the condition that can be
|
COND can remain not empty after the extraction of the conditions that can be
|
||||||
pushed into WHERE. It is saved in remaining_cond.
|
pushed into WHERE. It is saved in remaining_cond.
|
||||||
|
|
||||||
@note
|
@note
|
||||||
|
|
|
||||||
|
|
@ -1113,7 +1113,7 @@ public:
|
||||||
*/
|
*/
|
||||||
LEX *parent_lex;
|
LEX *parent_lex;
|
||||||
enum olap_type olap;
|
enum olap_type olap;
|
||||||
/* FROM clause - points to the beginning of the TABLE_LIST::next_local list. */
|
/* FROM clause - points to the beginning of the TABLE_LIST::next_local list */
|
||||||
SQL_I_List<TABLE_LIST> table_list;
|
SQL_I_List<TABLE_LIST> table_list;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -1129,8 +1129,8 @@ public:
|
||||||
List<Item> pre_fix; /* above list before fix_fields */
|
List<Item> pre_fix; /* above list before fix_fields */
|
||||||
bool is_item_list_lookup;
|
bool is_item_list_lookup;
|
||||||
/*
|
/*
|
||||||
Usualy it is pointer to ftfunc_list_alloc, but in union used to create fake
|
Usually it is pointer to ftfunc_list_alloc, but in union used to create
|
||||||
select_lex for calling mysql_select under results of union
|
fake select_lex for calling mysql_select under results of union
|
||||||
*/
|
*/
|
||||||
List<Item_func_match> *ftfunc_list;
|
List<Item_func_match> *ftfunc_list;
|
||||||
List<Item_func_match> ftfunc_list_alloc;
|
List<Item_func_match> ftfunc_list_alloc;
|
||||||
|
|
|
||||||
|
|
@ -3747,14 +3747,16 @@ JOIN::create_postjoin_aggr_table(JOIN_TAB *tab, List<Item> *table_fields,
|
||||||
tab->tmp_table_param->skip_create_table= true;
|
tab->tmp_table_param->skip_create_table= true;
|
||||||
TABLE* table= create_tmp_table(thd, tab->tmp_table_param, *table_fields,
|
TABLE* table= create_tmp_table(thd, tab->tmp_table_param, *table_fields,
|
||||||
table_group, distinct,
|
table_group, distinct,
|
||||||
save_sum_fields, select_options, table_rows_limit,
|
save_sum_fields, select_options,
|
||||||
|
table_rows_limit,
|
||||||
&empty_clex_str, true, keep_row_order);
|
&empty_clex_str, true, keep_row_order);
|
||||||
if (!table)
|
if (!table)
|
||||||
DBUG_RETURN(true);
|
DBUG_RETURN(true);
|
||||||
tmp_table_param.using_outer_summary_function=
|
tmp_table_param.using_outer_summary_function=
|
||||||
tab->tmp_table_param->using_outer_summary_function;
|
tab->tmp_table_param->using_outer_summary_function;
|
||||||
tab->join= this;
|
tab->join= this;
|
||||||
DBUG_ASSERT(tab > tab->join->join_tab || !top_join_tab_count || !tables_list);
|
DBUG_ASSERT(tab > tab->join->join_tab || !top_join_tab_count ||
|
||||||
|
!tables_list);
|
||||||
if (tab > join_tab)
|
if (tab > join_tab)
|
||||||
(tab - 1)->next_select= sub_select_postjoin_aggr;
|
(tab - 1)->next_select= sub_select_postjoin_aggr;
|
||||||
if (!(tab->aggr= new (thd->mem_root) AGGR_OP(tab)))
|
if (!(tab->aggr= new (thd->mem_root) AGGR_OP(tab)))
|
||||||
|
|
@ -4260,8 +4262,9 @@ void JOIN::exec_inner()
|
||||||
/*
|
/*
|
||||||
Enable LIMIT ROWS EXAMINED during query execution if:
|
Enable LIMIT ROWS EXAMINED during query execution if:
|
||||||
(1) This JOIN is the outermost query (not a subquery or derived table)
|
(1) This JOIN is the outermost query (not a subquery or derived table)
|
||||||
This ensures that the limit is enabled when actual execution begins, and
|
This ensures that the limit is enabled when actual execution begins,
|
||||||
not if a subquery is evaluated during optimization of the outer query.
|
and not if a subquery is evaluated during optimization of the outer
|
||||||
|
query.
|
||||||
(2) This JOIN is not the result of a UNION. In this case do not apply the
|
(2) This JOIN is not the result of a UNION. In this case do not apply the
|
||||||
limit in order to produce the partial query result stored in the
|
limit in order to produce the partial query result stored in the
|
||||||
UNION temp table.
|
UNION temp table.
|
||||||
|
|
@ -14091,7 +14094,7 @@ static void update_depend_map_for_order(JOIN *join, ORDER *order)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Remove all constants and check if ORDER only contains simple
|
Remove all constants from ORDER and check if ORDER only contains simple
|
||||||
expressions.
|
expressions.
|
||||||
|
|
||||||
We also remove all duplicate expressions, keeping only the first one.
|
We also remove all duplicate expressions, keeping only the first one.
|
||||||
|
|
@ -16665,13 +16668,13 @@ static uint reset_nj_counters(JOIN *join, List<TABLE_LIST> *join_list)
|
||||||
@verbatim
|
@verbatim
|
||||||
IMPLEMENTATION
|
IMPLEMENTATION
|
||||||
LIMITATIONS ON JOIN ORDER
|
LIMITATIONS ON JOIN ORDER
|
||||||
The nested [outer] joins executioner algorithm imposes these limitations
|
The nested [outer] joins executioner algorithm imposes these
|
||||||
on join order:
|
limitations on join order:
|
||||||
1. "Outer tables first" - any "outer" table must be before any
|
1. "Outer tables first" - any "outer" table must be before any
|
||||||
corresponding "inner" table.
|
corresponding "inner" table.
|
||||||
2. "No interleaving" - tables inside a nested join must form a continuous
|
2. "No interleaving" - tables inside a nested join must form a
|
||||||
sequence in join order (i.e. the sequence must not be interrupted by
|
continuous sequence in join order (i.e. the sequence must not be
|
||||||
tables that are outside of this nested join).
|
interrupted by tables that are outside of this nested join).
|
||||||
|
|
||||||
#1 is checked elsewhere, this function checks #2 provided that #1 has
|
#1 is checked elsewhere, this function checks #2 provided that #1 has
|
||||||
been already checked.
|
been already checked.
|
||||||
|
|
@ -16683,34 +16686,36 @@ static uint reset_nj_counters(JOIN *join, List<TABLE_LIST> *join_list)
|
||||||
|
|
||||||
The join order "t1 t2 t0 t3" is invalid:
|
The join order "t1 t2 t0 t3" is invalid:
|
||||||
|
|
||||||
table t0 is outside of the nested join, so WHERE condition for t0 is
|
table t0 is outside of the nested join, so WHERE condition
|
||||||
attached directly to t0 (without triggers, and it may be used to access
|
for t0 is attached directly to t0 (without triggers, and it
|
||||||
t0). Applying WHERE(t0) to (t2,t0,t3) record is invalid as we may miss
|
may be used to access t0). Applying WHERE(t0) to (t2,t0,t3)
|
||||||
combinations of (t1, t2, t3) that satisfy condition cond1, and produce a
|
record is invalid as we may miss combinations of (t1, t2, t3)
|
||||||
null-complemented (t1, t2.NULLs, t3.NULLs) row, which should not have
|
that satisfy condition cond1, and produce a null-complemented
|
||||||
been produced.
|
(t1, t2.NULLs, t3.NULLs) row, which should not have been
|
||||||
|
produced.
|
||||||
|
|
||||||
If table t0 is not between t2 and t3, the problem doesn't exist:
|
If table t0 is not between t2 and t3, the problem doesn't exist:
|
||||||
If t0 is located after (t2,t3), WHERE(t0) is applied after nested join
|
If t0 is located after (t2,t3), WHERE(t0) is applied after nested
|
||||||
processing has finished.
|
join processing has finished.
|
||||||
If t0 is located before (t2,t3), predicates like WHERE_cond(t0, t2) are
|
If t0 is located before (t2,t3), predicates like WHERE_cond(t0, t2)
|
||||||
wrapped into condition triggers, which takes care of correct nested
|
are wrapped into condition triggers, which takes care of correct
|
||||||
join processing.
|
nested join processing.
|
||||||
|
|
||||||
HOW IT IS IMPLEMENTED
|
HOW IT IS IMPLEMENTED
|
||||||
The limitations on join order can be rephrased as follows: for valid
|
The limitations on join order can be rephrased as follows: for valid
|
||||||
join order one must be able to:
|
join order one must be able to:
|
||||||
1. write down the used tables in the join order on one line.
|
1. write down the used tables in the join order on one line.
|
||||||
2. for each nested join, put one '(' and one ')' on the said line
|
2. for each nested join, put one '(' and one ')' on the said line
|
||||||
3. write "LEFT JOIN" and "ON (...)" where appropriate
|
3. write "LEFT JOIN" and "ON (...)" where appropriate
|
||||||
4. get a query equivalent to the query we're trying to execute.
|
4. get a query equivalent to the query we're trying to execute.
|
||||||
|
|
||||||
Calls to check_interleaving_with_nj() are equivalent to writing the
|
Calls to check_interleaving_with_nj() are equivalent to writing the
|
||||||
above described line from left to right.
|
above described line from left to right.
|
||||||
A single check_interleaving_with_nj(A,B) call is equivalent to writing
|
|
||||||
table B and appropriate brackets on condition that table A and
|
A single check_interleaving_with_nj(A,B) call is equivalent
|
||||||
appropriate brackets is the last what was written. Graphically the
|
to writing table B and appropriate brackets on condition that
|
||||||
transition is as follows:
|
table A and appropriate brackets is the last what was
|
||||||
|
written. Graphically the transition is as follows:
|
||||||
|
|
||||||
+---- current position
|
+---- current position
|
||||||
|
|
|
|
||||||
|
|
@ -21896,8 +21901,8 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@brief
|
@brief
|
||||||
Perform a GROUP BY operation over a stream of rows ordered by their group. The
|
Perform a GROUP BY operation over a stream of rows ordered by their group.
|
||||||
result is sent into join->result.
|
The result is sent into join->result.
|
||||||
|
|
||||||
@detail
|
@detail
|
||||||
Also applies HAVING, etc.
|
Also applies HAVING, etc.
|
||||||
|
|
@ -22177,7 +22182,9 @@ end:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Like end_update, but this is done with unique constraints instead of keys. */
|
/**
|
||||||
|
Like end_update, but this is done with unique constraints instead of keys.
|
||||||
|
*/
|
||||||
|
|
||||||
static enum_nested_loop_state
|
static enum_nested_loop_state
|
||||||
end_unique_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
|
end_unique_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue