mirror of
https://github.com/MariaDB/server.git
synced 2025-11-24 06:01:25 +03:00
Moving implementation of INET_ATON() INET_NTOA() into
separate files item_inetfunc.h and item_inetfunc.cc.
This commit is contained in:
57
sql/item_inetfunc.h
Normal file
57
sql/item_inetfunc.h
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user