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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
980ba493
Commit
980ba493
authored
Jul 18, 2011
by
Tor Didriksen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#12368853 FORMAT() CRASHES WITH LARGE NUMBERS AFTER TRUNCATE...
parent
1d0a65aa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
mysql-test/r/type_float.result
mysql-test/r/type_float.result
+6
-0
mysql-test/t/type_float.test
mysql-test/t/type_float.test
+6
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+2
-1
No files found.
mysql-test/r/type_float.result
View file @
980ba493
...
@@ -441,3 +441,9 @@ select least(-1.1111111111111111111111111,
...
@@ -441,3 +441,9 @@ select least(-1.1111111111111111111111111,
select concat((truncate((-1.7976931348623157E+307),(0x1e))),
select concat((truncate((-1.7976931348623157E+307),(0x1e))),
(99999999999999999999999999999999999999999999999999999999999999999)) into @a;
(99999999999999999999999999999999999999999999999999999999999999999)) into @a;
End of 5.0 tests
End of 5.0 tests
#
# Bug#12368853 FORMAT() CRASHES WITH LARGE NUMBERS AFTER TRUNCATE...
#
select format(truncate('1.7976931348623157E+308',-12),1,'fr_BE') as foo;
foo
0
mysql-test/t/type_float.test
View file @
980ba493
...
@@ -325,3 +325,9 @@ eval select concat((truncate((-1.7976931348623157E+307),(0x1e))),
...
@@ -325,3 +325,9 @@ eval select concat((truncate((-1.7976931348623157E+307),(0x1e))),
--
enable_result_log
--
enable_result_log
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
--
echo
#
--
echo
# Bug#12368853 FORMAT() CRASHES WITH LARGE NUMBERS AFTER TRUNCATE...
--
echo
#
select
format
(
truncate
(
'1.7976931348623157E+308'
,
-
12
),
1
,
'fr_BE'
)
as
foo
;
sql/item_strfunc.cc
View file @
980ba493
...
@@ -2316,7 +2316,7 @@ String *Item_func_format::val_str_ascii(String *str)
...
@@ -2316,7 +2316,7 @@ String *Item_func_format::val_str_ascii(String *str)
return
0
;
/* purecov: inspected */
return
0
;
/* purecov: inspected */
nr
=
my_double_round
(
nr
,
(
longlong
)
dec
,
FALSE
,
FALSE
);
nr
=
my_double_round
(
nr
,
(
longlong
)
dec
,
FALSE
,
FALSE
);
str
->
set_real
(
nr
,
dec
,
&
my_charset_numeric
);
str
->
set_real
(
nr
,
dec
,
&
my_charset_numeric
);
if
(
isnan
(
nr
))
if
(
isnan
(
nr
)
||
my_isinf
(
nr
)
)
return
str
;
return
str
;
str_length
=
str
->
length
();
str_length
=
str
->
length
();
}
}
...
@@ -2372,6 +2372,7 @@ String *Item_func_format::val_str_ascii(String *str)
...
@@ -2372,6 +2372,7 @@ String *Item_func_format::val_str_ascii(String *str)
For short values without thousands (<1000)
For short values without thousands (<1000)
replace decimal point to localized value.
replace decimal point to localized value.
*/
*/
DBUG_ASSERT
(
dec_length
<=
str_length
);
((
char
*
)
str
->
ptr
())[
str_length
-
dec_length
]
=
lc
->
decimal_point
;
((
char
*
)
str
->
ptr
())[
str_length
-
dec_length
]
=
lc
->
decimal_point
;
}
}
return
str
;
return
str
;
...
...
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