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
a7e3cab0
Commit
a7e3cab0
authored
Apr 14, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for a NAN problem in FORMAT(...) string function ..
parent
9754639c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletion
+5
-1
mysql-test/r/func_misc.result
mysql-test/r/func_misc.result
+3
-0
mysql-test/t/func_misc.test
mysql-test/t/func_misc.test
+1
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+1
-1
No files found.
mysql-test/r/func_misc.result
View file @
a7e3cab0
...
@@ -10,3 +10,6 @@ inet_aton("255.255.255.255.255") inet_aton("255.255.1.255") inet_aton("0.1.255")
...
@@ -10,3 +10,6 @@ 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 inet_ntoa(1099511627775),inet_ntoa(4294902271),inet_ntoa(511);
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
NULL 255.255.1.255 0.0.1.255
select format("nan",2);
format("nan",2)
nan
mysql-test/t/func_misc.test
View file @
a7e3cab0
...
@@ -7,3 +7,4 @@ select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.5555
...
@@ -7,3 +7,4 @@ select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.5555
select
inet_ntoa
(
inet_aton
(
"255.255.255.255.255.255.255.255"
));
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_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
inet_ntoa
(
1099511627775
),
inet_ntoa
(
4294902271
),
inet_ntoa
(
511
);
select
format
(
"nan"
,
2
);
sql/item_strfunc.cc
View file @
a7e3cab0
...
@@ -1477,7 +1477,7 @@ String *Item_func_format::val_str(String *str)
...
@@ -1477,7 +1477,7 @@ String *Item_func_format::val_str(String *str)
if
(
nr
<
0
)
if
(
nr
<
0
)
str_length
--
;
// Don't count sign
str_length
--
;
// Don't count sign
length
=
str
->
length
()
+
(
diff
=
(
str_length
-
dec
-
1
)
/
3
);
length
=
str
->
length
()
+
(
diff
=
(
str_length
-
dec
-
1
)
/
3
);
if
(
diff
)
if
(
diff
&&
diff
<
330
)
// size of buff ...
{
{
char
*
tmp
,
*
pos
;
char
*
tmp
,
*
pos
;
str
=
copy_if_not_alloced
(
&
tmp_str
,
str
,
length
);
str
=
copy_if_not_alloced
(
&
tmp_str
,
str
,
length
);
...
...
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