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
4d26c336
Commit
4d26c336
authored
Sep 23, 2010
by
Mats Kindahl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merging into mysql-5.5-bugfixing.
parent
d522f2a5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
mysql-test/r/type_newdecimal.result
mysql-test/r/type_newdecimal.result
+12
-0
mysql-test/t/type_newdecimal.test
mysql-test/t/type_newdecimal.test
+9
-0
sql/field.cc
sql/field.cc
+3
-2
No files found.
mysql-test/r/type_newdecimal.result
View file @
4d26c336
...
...
@@ -1908,4 +1908,16 @@ group by PAY.id + 1;
mult v_net_with_discount v_total
1.0000 27.18 27.180000
DROP TABLE currencies, payments, sub_tasks;
#
# BUG#52171: distinct aggregates on unsigned decimal fields trigger assertions
#
CREATE TABLE t1 (a DECIMAL(4,4) UNSIGNED);
INSERT INTO t1 VALUES (0);
SELECT AVG(DISTINCT a) FROM t1;
AVG(DISTINCT a)
0.00000000
SELECT SUM(DISTINCT a) FROM t1;
SUM(DISTINCT a)
0.0000
DROP TABLE t1;
End of 5.1 tests
mysql-test/t/type_newdecimal.test
View file @
4d26c336
...
...
@@ -1509,5 +1509,14 @@ group by PAY.id + 1;
DROP
TABLE
currencies
,
payments
,
sub_tasks
;
--
echo
#
--
echo
# BUG#52171: distinct aggregates on unsigned decimal fields trigger assertions
--
echo
#
CREATE
TABLE
t1
(
a
DECIMAL
(
4
,
4
)
UNSIGNED
);
INSERT
INTO
t1
VALUES
(
0
);
SELECT
AVG
(
DISTINCT
a
)
FROM
t1
;
SELECT
SUM
(
DISTINCT
a
)
FROM
t1
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
sql/field.cc
View file @
4d26c336
...
...
@@ -9104,7 +9104,7 @@ void Create_field::init_for_tmp_table(enum_field_types sql_type_arg,
case
MYSQL_TYPE_NEWDECIMAL
:
case
MYSQL_TYPE_FLOAT
:
case
MYSQL_TYPE_DOUBLE
:
pack_flag
=
FIELDFLAG_
DECIMAL
|
FIELDFLAG_
NUMBER
|
pack_flag
=
FIELDFLAG_NUMBER
|
(
decimals_arg
&
FIELDFLAG_MAX_DEC
)
<<
FIELDFLAG_DEC_SHIFT
;
break
;
...
...
@@ -9153,12 +9153,13 @@ void Create_field::init_for_tmp_table(enum_field_types sql_type_arg,
(
maybe_null
?
FIELDFLAG_MAYBE_NULL
:
0
)
|
(
is_unsigned
?
0
:
FIELDFLAG_DECIMAL
);
DBUG_PRINT
(
"debug"
,
(
"pack_flag: %s%s%s%s%s, pack_type: %d"
,
DBUG_PRINT
(
"debug"
,
(
"pack_flag: %s%s%s%s%s
%s
, pack_type: %d"
,
FLAGSTR
(
pack_flag
,
FIELDFLAG_BINARY
),
FLAGSTR
(
pack_flag
,
FIELDFLAG_NUMBER
),
FLAGSTR
(
pack_flag
,
FIELDFLAG_INTERVAL
),
FLAGSTR
(
pack_flag
,
FIELDFLAG_GEOM
),
FLAGSTR
(
pack_flag
,
FIELDFLAG_BLOB
),
FLAGSTR
(
pack_flag
,
FIELDFLAG_DECIMAL
),
f_packtype
(
pack_flag
)));
DBUG_VOID_RETURN
;
}
...
...
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