1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

MDEV-9215 Detect cmp_type() and result_type() from field_type()

(A dependency task for MDEV-4912 Add a plugin to field types)
This commit is contained in:
Alexander Barkov
2015-12-01 13:13:23 +04:00
parent e3fed3b9b4
commit 607ef786fc
11 changed files with 50 additions and 49 deletions

View File

@@ -69,6 +69,7 @@ public:
decimals=dec; max_length=float_length(dec);
}
enum Item_result result_type () const { return REAL_RESULT; }
enum Item_result cmp_type () const { return REAL_RESULT; }
enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; }
void set(double nr) { value=nr; }
void set(longlong nr) { value=(double) nr; }
@@ -96,6 +97,7 @@ public:
Item_proc_int(THD *thd, const char *name_par): Item_proc(thd, name_par)
{ max_length=11; }
enum Item_result result_type () const { return INT_RESULT; }
enum Item_result cmp_type () const { return INT_RESULT; }
enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; }
void set(double nr) { value=(longlong) nr; }
void set(longlong nr) { value=nr; }
@@ -115,6 +117,7 @@ public:
Item_proc_string(THD *thd, const char *name_par, uint length):
Item_proc(thd, name_par) { this->max_length=length; }
enum Item_result result_type () const { return STRING_RESULT; }
enum Item_result cmp_type () const { return STRING_RESULT; }
enum_field_types field_type() const { return MYSQL_TYPE_VARCHAR; }
void set(double nr) { str_value.set_real(nr, 2, default_charset()); }
void set(longlong nr) { str_value.set(nr, default_charset()); }