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
01c3fb8e
Commit
01c3fb8e
authored
Mar 07, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merging
parents
77174b3a
34ff8fbd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
0 deletions
+52
-0
mysql-test/r/func_group.result
mysql-test/r/func_group.result
+24
-0
mysql-test/t/func_group.test
mysql-test/t/func_group.test
+25
-0
strings/decimal.c
strings/decimal.c
+3
-0
No files found.
mysql-test/r/func_group.result
View file @
01c3fb8e
...
...
@@ -832,6 +832,30 @@ id stddev_pop(value1) var_pop(value1) stddev_samp(value1) var_samp(value1)
1 0.816497 0.666667 1.000000 1.000000
2 1.118034 1.250000 1.290994 1.666667
DROP TABLE t1;
CREATE TABLE t1 (col1 decimal(16,12));
INSERT INTO t1 VALUES (-5.00000000001),(-5.00000000002),(-5.00000000003),(-5.00000000000),(-5.00000000001),(-5.00000000002);
insert into t1 select * from t1;
select col1,count(col1),sum(col1),avg(col1) from t1 group by col1;
col1 count(col1) sum(col1) avg(col1)
-5.000000000030 2 -10.000000000060 -5.0000000000300000
-5.000000000020 4 -20.000000000080 -5.0000000000200000
-5.000000000010 4 -20.000000000040 -5.0000000000100000
-5.000000000000 2 -10.000000000000 -5.0000000000000000
DROP TABLE t1;
create table t1 (col1 decimal(16,12));
insert into t1 values (-5.00000000001);
insert into t1 values (-5.00000000001);
select col1,sum(col1),max(col1),min(col1) from t1 group by col1;
col1 sum(col1) max(col1) min(col1)
-5.000000000010 -10.000000000020 -5.000000000010 -5.000000000010
delete from t1;
insert into t1 values (5.00000000001);
insert into t1 values (5.00000000001);
select col1,sum(col1),max(col1),min(col1) from t1 group by col1;
col1 sum(col1) max(col1) min(col1)
5.000000000010 10.000000000020 5.000000000010 5.000000000010
DROP TABLE t1;
CREATE TABLE t1(
id int PRIMARY KEY,
a int,
...
...
mysql-test/t/func_group.test
View file @
01c3fb8e
...
...
@@ -537,6 +537,31 @@ CREATE TABLE t1 (id int(11),value1 float(10,2));
INSERT
INTO
t1
VALUES
(
1
,
0.00
),(
1
,
1.00
),
(
1
,
2.00
),
(
2
,
10.00
),
(
2
,
11.00
),
(
2
,
12.00
),
(
2
,
13.00
);
select
id
,
stddev_pop
(
value1
),
var_pop
(
value1
),
stddev_samp
(
value1
),
var_samp
(
value1
)
from
t1
group
by
id
;
DROP
TABLE
t1
;
#
# BUG#8464 decimal AVG returns incorrect result
#
CREATE
TABLE
t1
(
col1
decimal
(
16
,
12
));
INSERT
INTO
t1
VALUES
(
-
5.00000000001
),(
-
5.00000000002
),(
-
5.00000000003
),(
-
5.00000000000
),(
-
5.00000000001
),(
-
5.00000000002
);
insert
into
t1
select
*
from
t1
;
select
col1
,
count
(
col1
),
sum
(
col1
),
avg
(
col1
)
from
t1
group
by
col1
;
DROP
TABLE
t1
;
#
# BUG#8465 decimal MIN and MAX return incorrect result
#
create
table
t1
(
col1
decimal
(
16
,
12
));
insert
into
t1
values
(
-
5.00000000001
);
insert
into
t1
values
(
-
5.00000000001
);
select
col1
,
sum
(
col1
),
max
(
col1
),
min
(
col1
)
from
t1
group
by
col1
;
delete
from
t1
;
insert
into
t1
values
(
5.00000000001
);
insert
into
t1
values
(
5.00000000001
);
select
col1
,
sum
(
col1
),
max
(
col1
),
min
(
col1
)
from
t1
group
by
col1
;
DROP
TABLE
t1
;
#
# Bug 8893: wrong result for min/max optimization with 2 indexes
#
...
...
strings/decimal.c
View file @
01c3fb8e
...
...
@@ -1199,7 +1199,10 @@ int decimal2bin(decimal *from, char *to, int precision, int frac)
else
if
(
fsize0
>
fsize1
&&
frac1x
)
{
if
(
frac0
==
frac1
)
{
frac1x
=
frac0x
;
fsize0
=
fsize1
;
}
else
{
frac1
++
;
...
...
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