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.h37
1 files changed, 4 insertions, 33 deletions
diff --git a/sql/item_func.h b/sql/item_func.h
index 77b78495214..736616b016a 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -122,6 +122,7 @@ public:
bool is_null() { (void) val_int(); return null_value; }
friend class udf_handler;
unsigned int size_of() { return sizeof(*this);}
+ Field *tmp_table_field(TABLE *t_arg);
};
@@ -136,14 +137,10 @@ public:
longlong val_int() { return (longlong) val(); }
enum Item_result result_type () const { return REAL_RESULT; }
void fix_length_and_dec() { decimals=NOT_FIXED_DEC; max_length=float_length(decimals); }
- Field *tmp_table_field(TABLE *t_arg)
- {
- if (!t_arg) return result_field;
- return new Field_double(max_length, maybe_null, name,t_arg,decimals);
- }
unsigned int size_of() { return sizeof(*this);}
};
+
class Item_num_func :public Item_func
{
protected:
@@ -172,24 +169,6 @@ class Item_num_op :public Item_func
void fix_length_and_dec() { fix_num_length_and_dec(); find_num_type(); }
void find_num_type(void);
bool is_null() { (void) val(); return null_value; }
- Field *tmp_table_field(TABLE *t_arg)
- {
- Field *res;
- if (!t_arg)
- return result_field;
- if (args[0]->result_type() == INT_RESULT)
- {
- if (max_length > 11)
- res= new Field_longlong(max_length, maybe_null, name, t_arg,
- unsigned_flag);
- else
- res= new Field_long(max_length, maybe_null, name, t_arg,
- unsigned_flag);
- }
- else
- res= new Field_double(max_length, maybe_null, name, t_arg, decimals);
- return res;
- }
unsigned int size_of() { return sizeof(*this);}
};
@@ -206,18 +185,9 @@ public:
String *val_str(String*str);
enum Item_result result_type () const { return INT_RESULT; }
void fix_length_and_dec() {}
- Field *tmp_table_field(TABLE *t_arg)
- {
- if (!t_arg)
- return result_field;
- return ((max_length > 11) ?
- (Field *)new Field_longlong(max_length, maybe_null, name, t_arg,
- unsigned_flag) :
- (Field *)new Field_long(max_length, maybe_null, name, t_arg,
- unsigned_flag));
- }
};
+
class Item_func_signed :public Item_int_func
{
public:
@@ -228,6 +198,7 @@ public:
{ max_length=args[0]->max_length; unsigned_flag=0; }
};
+
class Item_func_unsigned :public Item_int_func
{
public: