diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-05-06 19:12:59 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-05-06 19:12:59 +0400 |
commit | 46239f29c6e624da3b516a25433b5dfb97fe12ea (patch) | |
tree | ef896007e3aed74bb7345fe0a5fb2b8322adb5c8 /sql/procedure.h | |
parent | 5a644e177f152af6904160259b5e0afac2307747 (diff) | |
download | mariadb-git-46239f29c6e624da3b516a25433b5dfb97fe12ea.tar.gz |
MDEV-12713 Define virtual type_handler() for all Item classes
Diffstat (limited to 'sql/procedure.h')
-rw-r--r-- | sql/procedure.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/procedure.h b/sql/procedure.h index 4c087bfb3b2..0791a78a49b 100644 --- a/sql/procedure.h +++ b/sql/procedure.h @@ -48,6 +48,7 @@ public: virtual void set(const char *str,uint length,CHARSET_INFO *cs)=0; virtual void set(longlong nr)=0; virtual enum_field_types field_type() const=0; + const Type_handler *type_handler() const=0; void set(const char *str) { set(str,(uint) strlen(str), default_charset()); } void make_field(THD *thd, Send_field *tmp_field) { @@ -74,6 +75,7 @@ public: 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; } + const Type_handler *type_handler() const { return &type_handler_double; } void set(double nr) { value=nr; } void set(longlong nr) { value=(double) nr; } void set(const char *str,uint length,CHARSET_INFO *cs) @@ -102,6 +104,7 @@ public: 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; } + const Type_handler *type_handler() const { return &type_handler_longlong; } void set(double nr) { value=(longlong) nr; } void set(longlong nr) { value=nr; } void set(const char *str,uint length, CHARSET_INFO *cs) @@ -122,6 +125,7 @@ public: 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; } + const Type_handler *type_handler() const { return &type_handler_varchar; } void set(double nr) { str_value.set_real(nr, 2, default_charset()); } void set(longlong nr) { str_value.set(nr, default_charset()); } void set(const char *str, uint length, CHARSET_INFO *cs) |