summaryrefslogtreecommitdiff
path: root/sql/opt_sum.cc
diff options
context:
space:
mode:
authorgkodinov/kgeorge@magare.gmz <>2007-10-24 11:50:09 +0300
committergkodinov/kgeorge@magare.gmz <>2007-10-24 11:50:09 +0300
commite8e01beee82d02a84f921c22ce62fcdcce9c32f8 (patch)
tree4acc70703363e4a6f03dc72000fe43ee6428288f /sql/opt_sum.cc
parent97e0180b2bf3f1c92d3a6ef03d5910774360482d (diff)
parent1cda34d30c2da877297ffe89782b473c16bd44bd (diff)
downloadmariadb-git-e8e01beee82d02a84f921c22ce62fcdcce9c32f8.tar.gz
Merge magare.gmz:/home/kgeorge/mysql/work/B30715-merged-5.0-opt
into magare.gmz:/home/kgeorge/mysql/work/B30715-merged-5.1-opt
Diffstat (limited to 'sql/opt_sum.cc')
-rw-r--r--sql/opt_sum.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 6836c53db4e..12ad504d738 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -295,14 +295,15 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
Check if case 1 from above holds. If it does, we should read
the skipped tuple.
*/
- if (ref.key_buff[prefix_len] == 1 &&
- /*
+ if (item_field->field->real_maybe_null() &&
+ ref.key_buff[prefix_len] == 1 &&
+ /*
Last keypart (i.e. the argument to MIN) is set to NULL by
find_key_for_maxmin only if all other keyparts are bound
to constants in a conjunction of equalities. Hence, we
can detect this by checking only if the last keypart is
NULL.
- */
+ */
(error == HA_ERR_KEY_NOT_FOUND ||
key_cmp_if_same(table, ref.key_buff, ref.key, prefix_len)))
{