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
ad863d40
Commit
ad863d40
authored
May 06, 2005
by
holyfoot@hf-ibm.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #10004 (Decimal operation crashes server)
parent
0e91a713
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
8 deletions
+20
-8
mysql-test/r/type_newdecimal.result
mysql-test/r/type_newdecimal.result
+3
-0
mysql-test/t/type_newdecimal.test
mysql-test/t/type_newdecimal.test
+5
-0
strings/decimal.c
strings/decimal.c
+12
-8
No files found.
mysql-test/r/type_newdecimal.result
View file @
ad863d40
...
@@ -846,3 +846,6 @@ set sql_mode='';
...
@@ -846,3 +846,6 @@ set sql_mode='';
select 0/0;
select 0/0;
0/0
0/0
NULL
NULL
select 0.190287977636363637 + 0.040372670 * 0 - 0;
0.190287977636363637 + 0.040372670 * 0 - 0
0.190287977636363637
mysql-test/t/type_newdecimal.test
View file @
ad863d40
...
@@ -876,3 +876,8 @@ select 10.3330000000000/12.34500000;
...
@@ -876,3 +876,8 @@ select 10.3330000000000/12.34500000;
set
sql_mode
=
''
;
set
sql_mode
=
''
;
select
0
/
0
;
select
0
/
0
;
#
# Bug #10004
#
select
0.190287977636363637
+
0.040372670
*
0
-
0
;
strings/decimal.c
View file @
ad863d40
...
@@ -1703,19 +1703,23 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to)
...
@@ -1703,19 +1703,23 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to)
carry
=
1
;
carry
=
1
;
else
if
(
intg2
==
intg1
)
else
if
(
intg2
==
intg1
)
{
{
while
(
unlikely
(
stop1
[
frac1
-
1
]
==
0
))
dec1
*
end1
=
stop1
+
(
frac1
-
1
);
frac1
--
;
dec1
*
end2
=
stop2
+
(
frac2
-
1
);
while
(
unlikely
(
stop2
[
frac2
-
1
]
==
0
))
while
(
unlikely
((
buf1
<=
end1
)
&&
(
*
end1
==
0
)))
frac2
--
;
end1
--
;
while
(
buf1
<
stop1
+
frac1
&&
buf2
<
stop2
+
frac2
&&
*
buf1
==
*
buf2
)
while
(
unlikely
((
buf2
<=
end2
)
&&
(
*
end2
==
0
)))
end2
--
;
frac1
=
(
end1
-
stop1
)
+
1
;
frac2
=
(
end2
-
stop2
)
+
1
;
while
(
buf1
<=
end1
&&
buf2
<=
end2
&&
*
buf1
==
*
buf2
)
buf1
++
,
buf2
++
;
buf1
++
,
buf2
++
;
if
(
buf1
<
stop1
+
frac
1
)
if
(
buf1
<
=
end
1
)
if
(
buf2
<
stop2
+
frac
2
)
if
(
buf2
<
=
end
2
)
carry
=
*
buf2
>
*
buf1
;
carry
=
*
buf2
>
*
buf1
;
else
else
carry
=
0
;
carry
=
0
;
else
else
if
(
buf2
<
stop2
+
frac
2
)
if
(
buf2
<
=
end
2
)
carry
=
1
;
carry
=
1
;
else
/* short-circuit everything: from1 == from2 */
else
/* short-circuit everything: from1 == from2 */
{
{
...
...
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