summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-03-12 18:53:59 +0100
committerSergei Golubchik <serg@mariadb.org>2018-03-14 12:40:00 +0100
commitbf1ca14ff3f3faa9f7a018097b25aa0f66d068cd (patch)
tree9399202e713a5a7fd455bd7ce230eeac7926bf4b /sql/item_cmpfunc.h
parentc14733f64e0ec372b255587c0a7726e752c84d16 (diff)
downloadmariadb-git-bf1ca14ff3f3faa9f7a018097b25aa0f66d068cd.tar.gz
cleanup: Item_func_case
reorder items in args[] array. Instead of when1,then1,when2,then2,...[,case][,else] sort them as [case,]when1,when2,...,then1,then2,...[,else] in this case all items used for comparison take a continuous part of the array and can be aggregated directly. and all items that can be returned take a continuous part of the array and can be aggregated directly. Old code had to copy them to a temporary array before aggreation, and then copy back (thd->change_item_tree) everything that was changed.
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 1eb07c5040a..20435b3fa4b 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -1558,12 +1558,11 @@ class Item_func_case :public Item_func_hybrid_field_type
int first_expr_num, else_expr_num;
enum Item_result left_cmp_type;
String tmp_value;
- uint ncases;
+ uint nwhens;
Item_result cmp_type;
DTCollation cmp_collation;
cmp_item *cmp_items[6]; /* For all result types */
cmp_item *case_item;
- Item **arg_buffer;
uint m_found_types;
public:
Item_func_case(THD *thd, List<Item> &list, Item *first_expr_arg,
@@ -1593,7 +1592,6 @@ public:
if (clone)
{
clone->case_item= 0;
- clone->arg_buffer= 0;
bzero(&clone->cmp_items, sizeof(cmp_items));
}
return clone;