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
0a169c4c
Commit
0a169c4c
authored
Jul 06, 2006
by
gkodinov@rakia.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into rakia.(none):/home/kgeorge/mysql/autopush/test
parents
ae0a3e0d
732b175c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
mysql-test/r/select.result
mysql-test/r/select.result
+3
-0
mysql-test/t/select.test
mysql-test/t/select.test
+5
-0
strings/decimal.c
strings/decimal.c
+10
-3
No files found.
mysql-test/r/select.result
View file @
0a169c4c
...
@@ -3395,3 +3395,6 @@ a t1.b + 0 t1.c + 0 a t2.b + 0 c d
...
@@ -3395,3 +3395,6 @@ a t1.b + 0 t1.c + 0 a t2.b + 0 c d
1 0 1 1 0 1 NULL
1 0 1 1 0 1 NULL
2 0 1 NULL NULL NULL NULL
2 0 1 NULL NULL NULL NULL
drop table t1,t2;
drop table t1,t2;
SELECT 0.9888889889 * 1.011111411911;
0.9888889889 * 1.011111411911
0.9998769417899202067879
mysql-test/t/select.test
View file @
0a169c4c
...
@@ -2901,3 +2901,8 @@ from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1
...
@@ -2901,3 +2901,8 @@ from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1
where
t1
.
b
<>
1
order
by
t1
.
a
;
where
t1
.
b
<>
1
order
by
t1
.
a
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# Bug #20569: Garbage in DECIMAL results from some mathematical functions
#
SELECT
0.9888889889
*
1.011111411911
;
strings/decimal.c
View file @
0a169c4c
...
@@ -170,6 +170,7 @@ static const dec1 frac_max[DIG_PER_DEC1-1]={
...
@@ -170,6 +170,7 @@ static const dec1 frac_max[DIG_PER_DEC1-1]={
#define ADD(to, from1, from2, carry)
/* assume carry <= 1 */
\
#define ADD(to, from1, from2, carry)
/* assume carry <= 1 */
\
do \
do \
{ \
{ \
DBUG_ASSERT((carry) <= 1); \
dec1 a=(from1)+(from2)+(carry); \
dec1 a=(from1)+(from2)+(carry); \
if (((carry)= a >= DIG_BASE))
/* no division here! */
\
if (((carry)= a >= DIG_BASE))
/* no division here! */
\
a-=DIG_BASE; \
a-=DIG_BASE; \
...
@@ -179,7 +180,7 @@ static const dec1 frac_max[DIG_PER_DEC1-1]={
...
@@ -179,7 +180,7 @@ static const dec1 frac_max[DIG_PER_DEC1-1]={
#define ADD2(to, from1, from2, carry) \
#define ADD2(to, from1, from2, carry) \
do \
do \
{ \
{ \
dec
1 a=(from1)+(from2)+(carry);
\
dec
2 a=((dec2)(from1))+(from2)+(carry);
\
if (((carry)= a >= DIG_BASE)) \
if (((carry)= a >= DIG_BASE)) \
a-=DIG_BASE; \
a-=DIG_BASE; \
if (unlikely(a >= DIG_BASE)) \
if (unlikely(a >= DIG_BASE)) \
...
@@ -187,7 +188,7 @@ static const dec1 frac_max[DIG_PER_DEC1-1]={
...
@@ -187,7 +188,7 @@ static const dec1 frac_max[DIG_PER_DEC1-1]={
a-=DIG_BASE; \
a-=DIG_BASE; \
carry++; \
carry++; \
} \
} \
(to)=
a;
\
(to)=
(dec1) a;
\
} while(0)
} while(0)
#define SUB(to, from1, from2, carry)
/* to=from1-from2 */
\
#define SUB(to, from1, from2, carry)
/* to=from1-from2 */
\
...
@@ -1998,7 +1999,13 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to)
...
@@ -1998,7 +1999,13 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to)
ADD2
(
*
buf0
,
*
buf0
,
lo
,
carry
);
ADD2
(
*
buf0
,
*
buf0
,
lo
,
carry
);
carry
+=
hi
;
carry
+=
hi
;
}
}
for
(;
carry
;
buf0
--
)
if
(
carry
)
{
if
(
buf0
<
to
->
buf
)
return
E_DEC_OVERFLOW
;
ADD2
(
*
buf0
,
*
buf0
,
0
,
carry
);
}
for
(
buf0
--
;
carry
;
buf0
--
)
{
{
if
(
buf0
<
to
->
buf
)
if
(
buf0
<
to
->
buf
)
return
E_DEC_OVERFLOW
;
return
E_DEC_OVERFLOW
;
...
...
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