summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index d4908ddf48d..900a979ce97 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -1321,7 +1321,7 @@ public:
{
return MY_TEST(compare(collation, base + pos1 * size, base + pos2 * size));
}
- virtual Item_result result_type()= 0;
+ virtual const Type_handler *type_handler() const= 0;
};
class in_string :public in_vector
@@ -1352,7 +1352,7 @@ public:
Item_string_for_in_vector *to= (Item_string_for_in_vector*) item;
to->set_value(str);
}
- Item_result result_type() { return STRING_RESULT; }
+ const Type_handler *type_handler() const { return &type_handler_varchar; }
};
class in_longlong :public in_vector
@@ -1379,7 +1379,7 @@ public:
((Item_int*) item)->unsigned_flag= (bool)
((packed_longlong*) base)[pos].unsigned_flag;
}
- Item_result result_type() { return INT_RESULT; }
+ const Type_handler *type_handler() const { return &type_handler_longlong; }
friend int cmp_longlong(void *cmp_arg, packed_longlong *a,packed_longlong *b);
};
@@ -1405,9 +1405,11 @@ public:
void value_to_item(uint pos, Item *item)
{
packed_longlong *val= reinterpret_cast<packed_longlong*>(base)+pos;
- Item_datetime *dt= reinterpret_cast<Item_datetime*>(item);
- dt->set(val->val);
+ Item_datetime *dt= static_cast<Item_datetime*>(item);
+ dt->set(val->val, type_handler()->mysql_timestamp_type());
}
+ uchar *get_value(Item *item)
+ { return get_value_internal(item, type_handler()->field_type()); }
friend int cmp_longlong(void *cmp_arg, packed_longlong *a,packed_longlong *b);
};
@@ -1419,8 +1421,7 @@ public:
:in_temporal(thd, elements)
{}
void set(uint pos,Item *item);
- uchar *get_value(Item *item)
- { return get_value_internal(item, MYSQL_TYPE_DATETIME); }
+ const Type_handler *type_handler() const { return &type_handler_datetime2; }
};
@@ -1431,8 +1432,7 @@ public:
:in_temporal(thd, elements)
{}
void set(uint pos,Item *item);
- uchar *get_value(Item *item)
- { return get_value_internal(item, MYSQL_TYPE_TIME); }
+ const Type_handler *type_handler() const { return &type_handler_time2; }
};
@@ -1448,7 +1448,7 @@ public:
{
((Item_float*)item)->value= ((double*) base)[pos];
}
- Item_result result_type() { return REAL_RESULT; }
+ const Type_handler *type_handler() const { return &type_handler_double; }
};
@@ -1466,7 +1466,7 @@ public:
Item_decimal *item_dec= (Item_decimal*)item;
item_dec->set_decimal_value(dec);
}
- Item_result result_type() { return DECIMAL_RESULT; }
+ const Type_handler *type_handler() const { return &type_handler_newdecimal; }
};
@@ -2431,7 +2431,7 @@ public:
void set(uint pos,Item *item);
uchar *get_value(Item *item);
friend class Item_func_in;
- Item_result result_type() { return ROW_RESULT; }
+ const Type_handler *type_handler() const { return &type_handler_row; }
cmp_item *get_cmp_item() { return &tmp; }
};