summaryrefslogtreecommitdiff
path: root/sql/item_func.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_func.h')
-rw-r--r--sql/item_func.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/sql/item_func.h b/sql/item_func.h
index 467b88eda76..ebe3a589aa1 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -590,6 +590,31 @@ public:
};
+/*
+ Objects of this class are used for ROLLUP queries to wrap up
+ each constant item referred to in GROUP BY list.
+*/
+
+class Item_func_rollup_const :public Item_func
+{
+public:
+ Item_func_rollup_const(Item *a) :Item_func(a)
+ { name= a->name; }
+ double val() { return args[0]->val(); }
+ longlong val_int() { return args[0]->val_int(); }
+ String *val_str(String *str) { return args[0]->val_str(str); }
+ const char *func_name() const { return "rollup_const"; }
+ bool const_item() const { return 0; }
+ Item_result result_type() const { return args[0]->result_type(); }
+ void fix_length_and_dec()
+ {
+ collation= args[0]->collation;
+ max_length= args[0]->max_length;
+ decimals=args[0]->decimals;
+ }
+};
+
+
class Item_func_length :public Item_int_func
{
String value;