summaryrefslogtreecommitdiff
path: root/sql/opt_sum.cc
diff options
context:
space:
mode:
authorigor@rurik.mysql.com <>2006-06-13 22:38:00 -0700
committerigor@rurik.mysql.com <>2006-06-13 22:38:00 -0700
commit5cdd1eb62dd7ab1466a6405e0821ad74a387f92a (patch)
tree37db9296a9908b1d8884b46891ddfc5fea692eac /sql/opt_sum.cc
parentfc46017c2d35d1d48a1ad288eb78cbedeeff1470 (diff)
downloadmariadb-git-5cdd1eb62dd7ab1466a6405e0821ad74a387f92a.tar.gz
Post-review corrections of the fix 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))