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
00fcdf8c
Commit
00fcdf8c
authored
Jun 15, 2006
by
gluh@eagle.intranet.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug#19667 group by a decimal expression yields wrong result
parent
94c9e172
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
mysql-test/r/type_newdecimal.result
mysql-test/r/type_newdecimal.result
+11
-0
mysql-test/t/type_newdecimal.test
mysql-test/t/type_newdecimal.test
+9
-0
sql/item_buff.cc
sql/item_buff.cc
+1
-1
No files found.
mysql-test/r/type_newdecimal.result
View file @
00fcdf8c
...
...
@@ -1397,3 +1397,14 @@ c1
9999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999
drop table t1;
create table t1 (i int, j int);
insert into t1 values (1,1), (1,2), (2,3), (2,4);
select i, count(distinct j) from t1 group by i;
i count(distinct j)
1 2
2 2
select i+0.0 as i2, count(distinct j) from t1 group by i2;
i2 count(distinct j)
1.0 2
2.0 2
drop table t1;
mysql-test/t/type_newdecimal.test
View file @
00fcdf8c
...
...
@@ -1095,3 +1095,12 @@ insert into t1 values(
insert
into
t1
values
(
1
e100
);
select
*
from
t1
;
drop
table
t1
;
#
# Bug#19667 group by a decimal expression yields wrong result
#
create
table
t1
(
i
int
,
j
int
);
insert
into
t1
values
(
1
,
1
),
(
1
,
2
),
(
2
,
3
),
(
2
,
4
);
select
i
,
count
(
distinct
j
)
from
t1
group
by
i
;
select
i
+
0.0
as
i2
,
count
(
distinct
j
)
from
t1
group
by
i2
;
drop
table
t1
;
sql/item_buff.cc
View file @
00fcdf8c
...
...
@@ -132,7 +132,7 @@ bool Cached_item_decimal::cmp()
{
my_decimal
tmp
;
my_decimal
*
ptmp
=
item
->
val_decimal
(
&
tmp
);
if
(
null_value
!=
item
->
null_value
||
my_decimal_cmp
(
&
value
,
ptmp
)
==
0
)
if
(
null_value
!=
item
->
null_value
||
my_decimal_cmp
(
&
value
,
ptmp
))
{
null_value
=
item
->
null_value
;
my_decimal2decimal
(
ptmp
,
&
value
);
...
...
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