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
57d5ffe1
Commit
57d5ffe1
authored
May 21, 2007
by
holyfoot/hf@mysql.com/hfmain.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk@192.168.21.1:mysql-5.0-opt
into mysql.com:/home/hf/work/27984/my50-27984
parents
7750ac07
84a572aa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
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
+2
-1
No files found.
mysql-test/r/type_newdecimal.result
View file @
57d5ffe1
...
@@ -1468,4 +1468,7 @@ Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at r
...
@@ -1468,4 +1468,7 @@ Error 1264 Out of range value adjusted for column 'cast(a as DECIMAL(3,2))' at r
create table t1 (s varchar(100));
create table t1 (s varchar(100));
insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875);
insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875);
drop table t1;
drop table t1;
SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b;
a b
0.9999999999999800000000000000 0.9999999999999800000000000000
End of 5.0 tests
End of 5.0 tests
mysql-test/t/type_newdecimal.test
View file @
57d5ffe1
...
@@ -1157,4 +1157,9 @@ create table t1 (s varchar(100));
...
@@ -1157,4 +1157,9 @@ create table t1 (s varchar(100));
insert
into
t1
values
(
0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875
);
insert
into
t1
values
(
0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875
);
drop
table
t1
;
drop
table
t1
;
#
# Bug #27984 Long Decimal Maths produces truncated results
#
SELECT
1.000000000000
*
99.999999999998
/
100
a
,
1.000000000000
*
(
99.999999999998
/
100
)
b
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
strings/decimal.c
View file @
57d5ffe1
...
@@ -1517,9 +1517,10 @@ decimal_round(decimal_t *from, decimal_t *to, int scale,
...
@@ -1517,9 +1517,10 @@ decimal_round(decimal_t *from, decimal_t *to, int scale,
dec1
*
p0
=
buf0
+
intg0
+
max
(
frac1
,
frac0
);
dec1
*
p0
=
buf0
+
intg0
+
max
(
frac1
,
frac0
);
dec1
*
p1
=
buf1
+
intg1
+
max
(
frac1
,
frac0
);
dec1
*
p1
=
buf1
+
intg1
+
max
(
frac1
,
frac0
);
to
->
buf
[
0
]
=
0
;
while
(
buf0
<
p0
)
while
(
buf0
<
p0
)
*
(
--
p1
)
=
*
(
--
p0
);
*
(
--
p1
)
=
*
(
--
p0
);
if
(
unlikely
(
intg1
>
intg0
))
to
->
buf
[
0
]
=
0
;
intg0
=
intg1
;
intg0
=
intg1
;
buf0
=
to
->
buf
;
buf0
=
to
->
buf
;
...
...
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