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
ca695888
Commit
ca695888
authored
Nov 07, 2017
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-14116 INET6_NTOA output is set as null to varchar(39) variable
parent
6a524fcf
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
6 deletions
+37
-6
mysql-test/r/func_misc.result
mysql-test/r/func_misc.result
+14
-0
mysql-test/t/func_misc.test
mysql-test/t/func_misc.test
+16
-0
sql/item_inetfunc.cc
sql/item_inetfunc.cc
+4
-3
sql/item_inetfunc.h
sql/item_inetfunc.h
+3
-3
No files found.
mysql-test/r/func_misc.result
View file @
ca695888
...
...
@@ -1407,3 +1407,17 @@ SELECT CONCAT(NAME_CONST('name',15),'오');
CONCAT(NAME_CONST('name',15),'오')
15오
SET NAMES latin1;
#
# MDEV-14116 INET6_NTOA output is set as null to varchar(39) variable
#
CREATE PROCEDURE p1()
BEGIN
DECLARE ip_full_addr varchar(39) DEFAULT "";
SELECT INET6_NTOA(UNHEX('20000000000000000000000000000000')) into ip_full_addr;
SELECT ip_full_addr;
END;
$$
CALL p1();
ip_full_addr
2000::
DROP PROCEDURE p1;
mysql-test/t/func_misc.test
View file @
ca695888
...
...
@@ -1091,3 +1091,19 @@ SELECT COERCIBILITY(NAME_CONST('name',TIME'00:00:00'));
SELECT
COERCIBILITY
(
NAME_CONST
(
'name'
,
15
));
SELECT
CONCAT
(
NAME_CONST
(
'name'
,
15
),
'오'
);
SET
NAMES
latin1
;
--
echo
#
--
echo
# MDEV-14116 INET6_NTOA output is set as null to varchar(39) variable
--
echo
#
DELIMITER
$$
;
CREATE
PROCEDURE
p1
()
BEGIN
DECLARE
ip_full_addr
varchar
(
39
)
DEFAULT
""
;
SELECT
INET6_NTOA
(
UNHEX
(
'20000000000000000000000000000000'
))
into
ip_full_addr
;
SELECT
ip_full_addr
;
END
;
$$
DELIMITER
;
$$
CALL
p1
();
DROP
PROCEDURE
p1
;
sql/item_inetfunc.cc
View file @
ca695888
...
...
@@ -181,7 +181,8 @@ String *Item_func_inet_str_base::val_str_ascii(String *buffer)
return
NULL
;
}
String
*
arg_str
=
args
[
0
]
->
val_str
(
buffer
);
StringBuffer
<
STRING_BUFFER_USUAL_SIZE
>
tmp
;
String
*
arg_str
=
args
[
0
]
->
val_str
(
&
tmp
);
if
(
!
arg_str
)
// Out-of memory happened. The error has been reported.
{
// Or: the underlying field is NULL
null_value
=
true
;
...
...
@@ -679,7 +680,7 @@ static void ipv6_to_str(const in6_addr *ipv6, char *str)
@retval true The string has been converted sucessfully.
*/
bool
Item_func_inet6_aton
::
calc_value
(
String
*
arg
,
String
*
buffer
)
bool
Item_func_inet6_aton
::
calc_value
(
const
String
*
arg
,
String
*
buffer
)
{
// ipv4-string -> varbinary(4)
// ipv6-string -> varbinary(16)
...
...
@@ -719,7 +720,7 @@ bool Item_func_inet6_aton::calc_value(String *arg, String *buffer)
@retval true The string has been converted sucessfully.
*/
bool
Item_func_inet6_ntoa
::
calc_value
(
String
*
arg
,
String
*
buffer
)
bool
Item_func_inet6_ntoa
::
calc_value
(
const
String
*
arg
,
String
*
buffer
)
{
if
(
arg
->
charset
()
!=
&
my_charset_bin
)
return
false
;
...
...
sql/item_inetfunc.h
View file @
ca695888
...
...
@@ -99,7 +99,7 @@ class Item_func_inet_str_base : public Item_str_ascii_func
virtual
String
*
val_str_ascii
(
String
*
buffer
);
protected:
virtual
bool
calc_value
(
String
*
arg
,
String
*
buffer
)
=
0
;
virtual
bool
calc_value
(
const
String
*
arg
,
String
*
buffer
)
=
0
;
};
...
...
@@ -126,7 +126,7 @@ class Item_func_inet6_aton : public Item_func_inet_str_base
}
protected:
virtual
bool
calc_value
(
String
*
arg
,
String
*
buffer
);
virtual
bool
calc_value
(
const
String
*
arg
,
String
*
buffer
);
};
...
...
@@ -158,7 +158,7 @@ class Item_func_inet6_ntoa : public Item_func_inet_str_base
}
protected:
virtual
bool
calc_value
(
String
*
arg
,
String
*
buffer
);
virtual
bool
calc_value
(
const
String
*
arg
,
String
*
buffer
);
};
...
...
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