summaryrefslogtreecommitdiff
path: root/sql/opt_sum.cc
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2006-06-13 22:38:00 -0700
committerunknown <igor@rurik.mysql.com>2006-06-13 22:38:00 -0700
commit5eead315e038d705b69eb1ca354398b38b533441 (patch)
tree37db9296a9908b1d8884b46891ddfc5fea692eac /sql/opt_sum.cc
parent61684e2e7578d98754648899b9595089dc78f3af (diff)
downloadmariadb-git-5eead315e038d705b69eb1ca354398b38b533441.tar.gz
Post-review corrections of the fix for bug #18206.
mysql-test/r/func_group.result: Added another test case for bug #18206. mysql-test/t/func_group.test: Added another test case for bug #18206.
Diffstat (limited to 'sql/opt_sum.cc')
-rw-r--r--sql/opt_sum.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 97e271121d3..21c637f4faf 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -685,8 +685,10 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
if (!(table->file->index_flags(idx, jdx, 0) & HA_READ_ORDER))
return 0;
- /* Check whether the index component is partial */
- if (part->length < table->field[part->fieldnr-1]->pack_length())
+ /* Check whether the index component is partial */
+ Field *part_field= table->field[part->fieldnr-1];
+ if ((part_field->flags & BLOB_FLAG) ||
+ part->length < part_field->key_length())
break;
if (field->eq(part->field))