diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-09-29 22:44:07 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-09-29 22:44:07 +0400 |
commit | ca38b93e354baa5bbcaea00543dc1a99940072e4 (patch) | |
tree | e63f26bf9fcdd6da150dca779f2e109c90611728 /sql/item.cc | |
parent | dc41bc14e05dc7b8fa55e7f47e7930f3d28e27f8 (diff) | |
download | mariadb-git-ca38b93e354baa5bbcaea00543dc1a99940072e4.tar.gz |
MDEV-13965 Parameter data type control for Item_longlong_func
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc index ce9f258612e..840ab12a7ce 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1080,6 +1080,28 @@ bool Item::check_type_can_return_real(const char *opname) const } +bool Item::check_type_can_return_date(const char *opname) const +{ + const Type_handler *handler= type_handler(); + if (handler->can_return_date()) + return false; + my_error(ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION, MYF(0), + handler->name().ptr(), opname); + return true; +} + + +bool Item::check_type_can_return_str_ascii(const char *opname) const +{ + const Type_handler *handler= type_handler(); + if (handler->can_return_str_ascii()) + return false; + my_error(ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION, MYF(0), + handler->name().ptr(), opname); + return true; +} + + bool Item::check_type_scalar(const char *opname) const { const Type_handler *handler= type_handler(); |