Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
375256ba
Commit
375256ba
authored
Dec 14, 2018
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-18010 Add classes Inet4 and Inet6
parent
3b8c868a
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
325 additions
and
261 deletions
+325
-261
sql/item_inetfunc.cc
sql/item_inetfunc.cc
+319
-226
sql/item_inetfunc.h
sql/item_inetfunc.h
+4
-27
sql/sql_type.h
sql/sql_type.h
+2
-8
No files found.
sql/item_inetfunc.cc
View file @
375256ba
This diff is collapsed.
Click to expand it.
sql/item_inetfunc.h
View file @
375256ba
...
...
@@ -81,13 +81,7 @@ class Item_func_inet_bool_base : public Item_bool_func
{
null_value
=
false
;
}
public:
virtual
longlong
val_int
();
bool
need_parentheses_in_default
()
{
return
false
;
}
protected:
virtual
bool
calc_value
(
const
String
*
arg
)
=
0
;
};
...
...
@@ -117,9 +111,6 @@ class Item_func_inet6_aton : public Item_str_func
{
return
get_item_copy
<
Item_func_inet6_aton
>
(
thd
,
this
);
}
String
*
val_str
(
String
*
to
);
protected:
bool
calc_value
(
const
String
*
arg
,
String
*
buffer
);
};
...
...
@@ -153,9 +144,6 @@ class Item_func_inet6_ntoa : public Item_str_ascii_func
String
*
val_str_ascii
(
String
*
to
);
Item
*
get_copy
(
THD
*
thd
)
{
return
get_item_copy
<
Item_func_inet6_ntoa
>
(
thd
,
this
);
}
protected:
bool
calc_value
(
const
Binary_string
*
arg
,
String
*
buffer
);
};
...
...
@@ -176,8 +164,7 @@ class Item_func_is_ipv4 : public Item_func_inet_bool_base
Item
*
get_copy
(
THD
*
thd
)
{
return
get_item_copy
<
Item_func_is_ipv4
>
(
thd
,
this
);
}
protected:
virtual
bool
calc_value
(
const
String
*
arg
);
longlong
val_int
();
};
...
...
@@ -192,14 +179,12 @@ class Item_func_is_ipv6 : public Item_func_inet_bool_base
Item_func_inet_bool_base
(
thd
,
ip_addr
)
{
}
public:
virtual
const
char
*
func_name
()
const
{
return
"is_ipv6"
;
}
Item
*
get_copy
(
THD
*
thd
)
{
return
get_item_copy
<
Item_func_is_ipv6
>
(
thd
,
this
);
}
protected:
virtual
bool
calc_value
(
const
String
*
arg
);
longlong
val_int
();
};
...
...
@@ -213,15 +198,11 @@ class Item_func_is_ipv4_compat : public Item_func_inet_bool_base
inline
Item_func_is_ipv4_compat
(
THD
*
thd
,
Item
*
ip_addr
)
:
Item_func_inet_bool_base
(
thd
,
ip_addr
)
{
}
public:
virtual
const
char
*
func_name
()
const
{
return
"is_ipv4_compat"
;
}
Item
*
get_copy
(
THD
*
thd
)
{
return
get_item_copy
<
Item_func_is_ipv4_compat
>
(
thd
,
this
);
}
protected:
virtual
bool
calc_value
(
const
String
*
arg
);
longlong
val_int
();
};
...
...
@@ -235,15 +216,11 @@ class Item_func_is_ipv4_mapped : public Item_func_inet_bool_base
inline
Item_func_is_ipv4_mapped
(
THD
*
thd
,
Item
*
ip_addr
)
:
Item_func_inet_bool_base
(
thd
,
ip_addr
)
{
}
public:
virtual
const
char
*
func_name
()
const
{
return
"is_ipv4_mapped"
;
}
Item
*
get_copy
(
THD
*
thd
)
{
return
get_item_copy
<
Item_func_is_ipv4_mapped
>
(
thd
,
this
);
}
protected:
virtual
bool
calc_value
(
const
String
*
arg
);
longlong
val_int
();
};
#endif // ITEM_INETFUNC_INCLUDED
sql/sql_type.h
View file @
375256ba
...
...
@@ -119,16 +119,10 @@ class String_ptr
:
m_string_ptr
(
str
)
{
}
String_ptr
(
Item
*
item
,
String
*
buffer
);
const
String
*
string
()
const
{
return
m_string_ptr
;
}
const
char
*
ptr
()
const
const
String
*
string
()
const
{
DBUG_ASSERT
(
m_string_ptr
);
return
m_string_ptr
->
ptr
();
}
uint32
length
()
const
{
DBUG_ASSERT
(
m_string_ptr
);
return
m_string_ptr
->
length
();
return
m_string_ptr
;
}
bool
is_null
()
const
{
return
m_string_ptr
==
NULL
;
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment