summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorMySQL Build Team <build@mysql.com>2009-11-25 17:45:33 +0100
committerMySQL Build Team <build@mysql.com>2009-11-25 17:45:33 +0100
commit4b93aa6a8244a43dddcd53538bba45e9a5b94ee4 (patch)
treebb720b85e5594cdbd1376f1ab3dc98ec03dd444c /extra
parentc14bf1ca586a6e77ee7614a3044d86cc2b8e0132 (diff)
downloadmariadb-git-4b93aa6a8244a43dddcd53538bba45e9a5b94ee4.tar.gz
Backport into build-200911241145-5.1.40sp1
> ------------------------------------------------------------ > revno: 1810.3964.1 > revision-id: alexey.kopytov@sun.com-20091030155453-0vlfwki805h9os62 > parent: joerg@mysql.com-20091016122941-rf6z0keqvmlgjfto > committer: Alexey Kopytov <Alexey.Kopytov@Sun.com> > branch nick: my50-bug48131 > timestamp: Fri 2009-10-30 18:54:53 +0300 > message: > Bug #48131: crash group by with rollup, distinct, filesort, > with temporary tables > > There were two problems the test case from this bug was > triggering: > > 1. JOIN::rollup_init() was supposed to wrap all constant Items > into another object for queries with the WITH ROLLUP modifier > to ensure they are never considered as constants and therefore > are written into temporary tables if the optimizer chooses to > employ them for DISTINCT/GROUP BY handling. > > However, JOIN::rollup_init() was called before > make_join_statistics(), so Items corresponding to fields in > const tables could not be handled as intended, which was > causing all kinds of problems later in the query execution. In > particular, create_tmp_table() assumed all constant items > except "hidden" ones to be removed earlier by remove_const() > which led to improperly initialized Field objects for the > temporary table being created. This is what was causing crashes > and valgrind errors in storage engines. > > 2. Even when the above problem had been fixed, the query from > the test case produced incorrect results due to some > DISTINCT/GROUP BY optimizations being performed by the > optimizer that are inapplicable in the WITH ROLLUP case. > > Fixed by disabling inapplicable DISTINCT/GROUP BY optimizations > when the WITH ROLLUP modifier is present, and splitting the > const-wrapping part of JOIN::rollup_init() into a separate > method which is now invoked after make_join_statistics() when > the const tables are already known.
Diffstat (limited to 'extra')
0 files changed, 0 insertions, 0 deletions