diff options
author | unknown <ramil@mysql.com> | 2006-04-21 11:48:00 +0500 |
---|---|---|
committer | unknown <ramil@mysql.com> | 2006-04-21 11:48:00 +0500 |
commit | 301a24e3a012004eab52a7ae9de4f4f81bb3ff7e (patch) | |
tree | bb8fe84ecfbd518f45b63ab8aacb4879e4ff0b55 /sql/item_cmpfunc.cc | |
parent | f372641876e7a560ce661693bfc5d8e62cc5a19d (diff) | |
download | mariadb-git-301a24e3a012004eab52a7ae9de4f4f81bb3ff7e.tar.gz |
Bug #17896: MIN of CASE WHEN returns non-minimum value!
- after review fixes
sql/item_cmpfunc.cc:
Bug #17896: MIN of CASE WHEN returns non-minimum value!
- after review fixes.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 57a3c9e5623..3c41fb56d89 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -39,19 +39,23 @@ static void agg_result_type(Item_result *type, Item **items, uint nitems) { Item **item, **item_end; - /* Note: NULL items don't affect the result type */ *type= STRING_RESULT; /* Skip beginning NULL items */ for (item= items, item_end= item + nitems; item < item_end; item++) + { if ((*item)->type() != Item::NULL_ITEM) { *type= (*item)->result_type(); item++; break; } + } + /* Combine result types. Note: NULL items don't affect the result */ for (; item < item_end; item++) + { if ((*item)->type() != Item::NULL_ITEM) *type= item_store_type(type[0], (*item)->result_type()); + } } static void agg_cmp_type(Item_result *type, Item **items, uint nitems) |