diff options
author | kaa@kaamos.(none) <> | 2008-02-22 11:34:18 +0300 |
---|---|---|
committer | kaa@kaamos.(none) <> | 2008-02-22 11:34:18 +0300 |
commit | 0a29b8b08520070950186ae64ff058b3fba3c1cb (patch) | |
tree | 083d0b2d329bd84d153bfe6bc799c20d2251015f /sql/item_sum.cc | |
parent | f41a5edfc7ed037245fac59ebe7185bb047dc150 (diff) | |
download | mariadb-git-0a29b8b08520070950186ae64ff058b3fba3c1cb.tar.gz |
Fix for bug #33049: Assert while running test-as3ap test(mysql-bench
suite)
Under some circumstances a combination of aggregate functions and
GROUP BY in a SELECT query over a VIEW could lead to incorrect
calculation of the result type of the aggregate function. This in
turn could result in incorrect results, or assertion failures on debug
builds.
Fixed by changing the logic in Item_sum_hybrid::fix_fields() so that
the argument's item is dereferenced before calling its type() method.
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 3d261dc2c36..47a7073c2e7 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -597,6 +597,7 @@ Item_sum_hybrid::fix_fields(THD *thd, Item **ref) result_field=0; null_value=1; fix_length_and_dec(); + item= item->real_item(); if (item->type() == Item::FIELD_ITEM) hybrid_field_type= ((Item_field*) item)->field->type(); else |