diff options
author | Alexander Barkov <bar@mariadb.org> | 2014-05-30 15:24:25 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2014-05-30 15:24:25 +0400 |
commit | 1449d1d54fc4ea876e54bded79c29b51eb6be91d (patch) | |
tree | e97bb47ae32df64ab5efc6764a561a9bcf6aab14 /sql/item_inetfunc.h | |
parent | 69742e4ee3e019c20dc2432d69e92fd6b76d2193 (diff) | |
download | mariadb-git-1449d1d54fc4ea876e54bded79c29b51eb6be91d.tar.gz |
Moving implementation of INET_ATON() INET_NTOA() into
separate files item_inetfunc.h and item_inetfunc.cc.
Diffstat (limited to 'sql/item_inetfunc.h')
-rw-r--r-- | sql/item_inetfunc.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/sql/item_inetfunc.h b/sql/item_inetfunc.h new file mode 100644 index 00000000000..cebe36e34eb --- /dev/null +++ b/sql/item_inetfunc.h @@ -0,0 +1,57 @@ +#ifndef ITEM_INETFUNC_INCLUDED +#define ITEM_INETFUNC_INCLUDED + +/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2014 MariaDB Foundation + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + + +#include "item.h" + +/************************************************************************* + Item_func_inet_aton implements INET_ATON() SQL-function. +*************************************************************************/ + +class Item_func_inet_aton : public Item_int_func +{ +public: + Item_func_inet_aton(Item *a) :Item_int_func(a) {} + longlong val_int(); + const char *func_name() const { return "inet_aton"; } + void fix_length_and_dec() { decimals= 0; max_length= 21; maybe_null= 1; unsigned_flag= 1;} +}; + + +/************************************************************************* + Item_func_inet_ntoa implements INET_NTOA() SQL-function. +*************************************************************************/ + +class Item_func_inet_ntoa : public Item_str_func +{ +public: + Item_func_inet_ntoa(Item *a) :Item_str_func(a) + { + } + String* val_str(String* str); + const char *func_name() const { return "inet_ntoa"; } + void fix_length_and_dec() + { + decimals= 0; + fix_length_and_charset(3 * 8 + 7, default_charset()); + maybe_null= 1; + } +}; + +#endif // ITEM_INETFUNC_INCLUDED |