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
d6ed8398
Commit
d6ed8398
authored
Feb 02, 2011
by
Tor Didriksen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport of fix for Bug#52123
parent
1d6261c5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
16 deletions
+38
-16
mysql-test/r/func_group.result
mysql-test/r/func_group.result
+10
-0
mysql-test/t/func_group.test
mysql-test/t/func_group.test
+11
-0
sql/item_sum.cc
sql/item_sum.cc
+12
-9
sql/item_sum.h
sql/item_sum.h
+5
-7
No files found.
mysql-test/r/func_group.result
View file @
d6ed8398
...
...
@@ -1739,6 +1739,16 @@ SELECT RELEASE_LOCK('aaaaaaaaaaaaaaaaa');
#
End of 5.1 tests
#
# Bug#52123 Assertion failed: aggregator == aggr->Aggrtype(),
# file .\item_sum.cc, line 587
#
CREATE TABLE t1(a int, KEY(a));
INSERT INTO t1 VALUES (1), (2);
SELECT 1 FROM t1 ORDER BY AVG(DISTINCT a);
1
1
DROP TABLE t1;
#
# Bug#55648: Server crash on MIN/MAX on maximum time value
#
CREATE TABLE t1(c1 TIME NOT NULL);
...
...
mysql-test/t/func_group.test
View file @
d6ed8398
...
...
@@ -1120,6 +1120,17 @@ SELECT RELEASE_LOCK('aaaaaaaaaaaaaaaaa');
--
echo
#
--
echo
End
of
5.1
tests
###
--
echo
#
--
echo
# Bug#52123 Assertion failed: aggregator == aggr->Aggrtype(),
--
echo
# file .\item_sum.cc, line 587
--
echo
#
CREATE
TABLE
t1
(
a
int
,
KEY
(
a
));
INSERT
INTO
t1
VALUES
(
1
),
(
2
);
SELECT
1
FROM
t1
ORDER
BY
AVG
(
DISTINCT
a
);
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug#55648: Server crash on MIN/MAX on maximum time value
--
echo
#
...
...
sql/item_sum.cc
View file @
d6ed8398
...
...
@@ -556,24 +556,27 @@ Item *Item_sum::set_arg(uint i, THD *thd, Item *new_val)
int
Item_sum
::
set_aggregator
(
Aggregator
::
Aggregator_type
aggregator
)
{
if
(
aggr
)
{
/*
Dependent subselects may be executed multiple times, making
set_aggregator to be called multiple times. The aggregator type
will be the same, but it needs to be reset so that it is
reevaluated with the new dependent data.
This function may also be called multiple times during query optimization.
In this case, the type may change, so we delete the old aggregator,
and create a new one.
*/
DBUG_ASSERT
(
aggregator
==
aggr
->
Aggrtype
());
if
(
aggr
&&
aggregator
==
aggr
->
Aggrtype
())
{
aggr
->
clear
();
return
FALSE
;
}
delete
aggr
;
switch
(
aggregator
)
{
case
Aggregator
:
:
DISTINCT_AGGREGATOR
:
aggr
=
new
Aggregator_distinct
(
this
);
break
;
case
Aggregator
:
:
SIMPLE_AGGREGATOR
:
aggr
=
new
Aggregator_simple
(
this
);
break
;
...
...
sql/item_sum.h
View file @
d6ed8398
...
...
@@ -461,7 +461,6 @@ class Item_sum :public Item_result_field
*/
virtual
void
no_rows_in_result
()
{
if
(
!
aggr
)
set_aggregator
(
with_distinct
?
Aggregator
::
DISTINCT_AGGREGATOR
:
Aggregator
::
SIMPLE_AGGREGATOR
);
...
...
@@ -515,11 +514,10 @@ class Item_sum :public Item_result_field
quick_group
=
with_distinct
?
0
:
1
;
}
/*
*
/*
Set the type of aggregation : DISTINCT or not.
Called when the final determination is done about the aggregation
type and the object is about to be used.
May be called multiple times.
*/
int
set_aggregator
(
Aggregator
::
Aggregator_type
aggregator
);
...
...
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