summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2022-04-28 16:59:50 +0200
committerSergei Golubchik <serg@mariadb.org>2022-04-29 17:05:12 +0200
commitbc9102eb811cc39a76b04cab316bbdcceaa16026 (patch)
treea11025c053676d82bbd869cf7177d105f1d23589 /sql
parent7215b0035435c15362bd94d169943eaad851d7dc (diff)
downloadmariadb-git-bc9102eb811cc39a76b04cab316bbdcceaa16026.tar.gz
cleanup: (*order->item) -> item
and minor style fixes
Diffstat (limited to 'sql')
-rw-r--r--sql/item.cc6
-rw-r--r--sql/sql_base.cc2
-rw-r--r--sql/sql_select.cc20
3 files changed, 12 insertions, 16 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 8b336334cc0..4c699bb974d 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -7874,8 +7874,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
else if (!ref || ref == not_found_item)
{
DBUG_ASSERT(reference_trough_name != 0);
- if (!(ref= resolve_ref_in_select_and_group(thd, this,
- context->select_lex)))
+ if (!(ref= resolve_ref_in_select_and_group(thd, this, context->select_lex)))
goto error; /* Some error occurred (e.g. ambiguous names). */
if (ref == not_found_item) /* This reference was not resolved. */
@@ -7888,8 +7887,7 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
if (unlikely(!outer_context))
{
/* The current reference cannot be resolved in this query. */
- my_error(ER_BAD_FIELD_ERROR,MYF(0),
- this->full_name(), thd->where);
+ my_error(ER_BAD_FIELD_ERROR,MYF(0), full_name(), thd->where);
goto error;
}
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 3ca18bd007d..14b97b43660 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -8453,7 +8453,7 @@ int setup_conds(THD *thd, TABLE_LIST *tables, List<TABLE_LIST> &leaves,
select_lex->where= *conds;
}
thd->lex->current_select->is_item_list_lookup= save_is_item_list_lookup;
- DBUG_RETURN(MY_TEST(thd->is_error()));
+ DBUG_RETURN(thd->is_error());
err_no_arena:
select_lex->is_item_list_lookup= save_is_item_list_lookup;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index d0377838ef0..2b0977aca9f 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -24528,8 +24528,8 @@ int setup_order(THD *thd, Ref_ptr_array ref_pointer_array, TABLE_LIST *tables,
if (find_order_in_list(thd, ref_pointer_array, tables, order, fields,
all_fields, false, true, from_window_spec))
return 1;
- if ((*order->item)->with_window_func &&
- context_analysis_place != IN_ORDER_BY)
+ Item * const item= *order->item;
+ if (item->with_window_func && context_analysis_place != IN_ORDER_BY)
{
my_error(ER_WINDOW_FUNCTION_IN_WINDOW_SPEC, MYF(0));
return 1;
@@ -24540,20 +24540,18 @@ int setup_order(THD *thd, Ref_ptr_array ref_pointer_array, TABLE_LIST *tables,
an ORDER BY clause
*/
- if (for_union &&
- ((*order->item)->with_sum_func() ||
- (*order->item)->with_window_func))
+ if (for_union && (item->with_sum_func() || item->with_window_func))
{
my_error(ER_AGGREGATE_ORDER_FOR_UNION, MYF(0), number);
return 1;
}
- if (!(*order->item)->with_sum_func())
- continue;
-
- if (from_window_spec && (*order->item)->type() != Item::SUM_FUNC_ITEM)
- (*order->item)->split_sum_func(thd, ref_pointer_array,
- all_fields, SPLIT_SUM_SELECT);
+ if (from_window_spec && item->with_sum_func() &&
+ item->type() != Item::SUM_FUNC_ITEM)
+ {
+ item->split_sum_func(thd, ref_pointer_array,
+ all_fields, SPLIT_SUM_SELECT);
+ }
}
return 0;
}