summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorGleb Shchepa <gshchepa@mysql.com>2009-04-01 16:02:26 +0500
committerGleb Shchepa <gshchepa@mysql.com>2009-04-01 16:02:26 +0500
commit02884a4d986f29c50ff60cefa15464faa26e79bb (patch)
tree6ae1f30b11048b37450792def05c41e1b9d22e8f /sql/item.cc
parent01e647352df15f7c58e8f0848aa7d17dc694efec (diff)
downloadmariadb-git-02884a4d986f29c50ff60cefa15464faa26e79bb.tar.gz
Backport bug #37348 fix 5.1 --> 5.0.
Original commentary: Bug #37348: Crash in or immediately after JOIN::make_sum_func_list The optimizer pulls up aggregate functions which should be aggregated in an outer select. At some point it may substitute such a function for a field in the temporary table. The setup_copy_fields function doesn't take this into account and may overrun the copy_field buffer. Fixed by filtering out the fields referenced through the specialized reference for aggregates (Item_aggregate_ref). Added an assertion to make sure bugs that cause similar discrepancy don't go undetected. mysql-test/r/func_group.result: Backport bug #37348 fix 5.1 --> 5.0. mysql-test/t/func_group.test: Backport bug #37348 fix 5.1 --> 5.0. sql/item.cc: Backport bug #37348 fix 5.1 --> 5.0. sql/item.h: Backport bug #37348 fix 5.1 --> 5.0. sql/sql_select.cc: Backport bug #37348 fix 5.1 --> 5.0.
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 220c72059d1..c284e8b3bf4 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1323,6 +1323,7 @@ public:
else
Item_ident::print(str);
}
+ virtual Ref_Type ref_type() { return AGGREGATE_REF; }
};