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
3b98955a
Commit
3b98955a
authored
Jan 20, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge vvagin@bk-internal.mysql.com:/home/bk/mysql-4.1
into eagle.mysql.r18.ru:/home/vva/work/BUG_2310/mysql-4.1
parents
d2b54441
7db61ce0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
mysql-test/r/func_misc.result
mysql-test/r/func_misc.result
+10
-1
mysql-test/t/func_misc.test
mysql-test/t/func_misc.test
+4
-0
sql/item_func.cc
sql/item_func.cc
+9
-0
No files found.
mysql-test/r/func_misc.result
View file @
3b98955a
...
...
@@ -6,10 +6,19 @@ inet_ntoa(inet_aton("255.255.255.255.255.255.255.255"))
NULL
select inet_aton("255.255.255.255.255"),inet_aton("255.255.1.255"),inet_aton("0.1.255");
inet_aton("255.255.255.255.255") inet_aton("255.255.1.255") inet_aton("0.1.255")
1099511627775 4294902271
51
1
1099511627775 4294902271
6579
1
select inet_ntoa(1099511627775),inet_ntoa(4294902271),inet_ntoa(511);
inet_ntoa(1099511627775) inet_ntoa(4294902271) inet_ntoa(511)
NULL 255.255.1.255 0.0.1.255
select hex(inet_aton('127'));
hex(inet_aton('127'))
7F
select hex(inet_aton('127.1'));
hex(inet_aton('127.1'))
7F000001
select hex(inet_aton('127.1.1'));
hex(inet_aton('127.1.1'))
7F010001
select length(format('nan', 2)) > 0;
length(format('nan', 2)) > 0
1
...
...
mysql-test/t/func_misc.test
View file @
3b98955a
...
...
@@ -8,6 +8,10 @@ select inet_ntoa(inet_aton("255.255.255.255.255.255.255.255"));
select
inet_aton
(
"255.255.255.255.255"
),
inet_aton
(
"255.255.1.255"
),
inet_aton
(
"0.1.255"
);
select
inet_ntoa
(
1099511627775
),
inet_ntoa
(
4294902271
),
inet_ntoa
(
511
);
select
hex
(
inet_aton
(
'127'
));
select
hex
(
inet_aton
(
'127.1'
));
select
hex
(
inet_aton
(
'127.1.1'
));
#
# Test for core dump with nan
#
...
...
sql/item_func.cc
View file @
3b98955a
...
...
@@ -2618,6 +2618,7 @@ longlong Item_func_inet_aton::val_int()
const
char
*
p
,
*
end
;
char
c
=
'.'
;
// we mark c to indicate invalid IP in case length is 0
char
buff
[
36
];
int
dot_count
=
0
;
String
*
s
,
tmp
(
buff
,
sizeof
(
buff
),
&
my_charset_bin
);
if
(
!
(
s
=
args
[
0
]
->
val_str
(
&
tmp
)))
// If null value
...
...
@@ -2636,6 +2637,7 @@ longlong Item_func_inet_aton::val_int()
}
else
if
(
c
==
'.'
)
{
dot_count
++
;
result
=
(
result
<<
8
)
+
(
ulonglong
)
byte_result
;
byte_result
=
0
;
}
...
...
@@ -2643,7 +2645,14 @@ longlong Item_func_inet_aton::val_int()
goto
err
;
// Invalid character
}
if
(
c
!=
'.'
)
// IP number can't end on '.'
{
switch
(
dot_count
)
{
case
1
:
result
<<=
8
;
case
2
:
result
<<=
8
;
}
return
(
result
<<
8
)
+
(
ulonglong
)
byte_result
;
}
err:
null_value
=
1
;
...
...
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