summaryrefslogtreecommitdiff
path: root/sql/ha_innodb.cc
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2003-06-22 16:20:06 +0300
committerunknown <heikki@hundin.mysql.fi>2003-06-22 16:20:06 +0300
commite0be1a89304afb756b9df8118612dc79cc13912e (patch)
tree1a135d13bab7894d25062ffd291711e2075c27ef /sql/ha_innodb.cc
parentf403da4bf2dba7f21c1076d986c73ef5d1ce2025 (diff)
downloadmariadb-git-e0be1a89304afb756b9df8118612dc79cc13912e.tar.gz
dict0dict.h, dict0dict.c, ha_innodb.cc:
In ORDER BY MySQL seems to set the key read flag also in the case where the primary key contains only a prefix of a column - not the whole column; to prevent potential bugs retrieve the whole column if the index contains a prefix of it sql/ha_innodb.cc: In ORDER BY MySQL seems to set the key read flag also in the case where the primary key contains only a prefix of a column - not the whole column; to prevent potential bugs retrieve the whole column if the index contains a prefix of it innobase/dict/dict0dict.c: In ORDER BY MySQL seems to set the key read flag also in the case where the primary key contains only a prefix of a column - not the whole column; to prevent potential bugs retrieve the whole column if the index contains a prefix of it innobase/include/dict0dict.h: In ORDER BY MySQL seems to set the key read flag also in the case where the primary key contains only a prefix of a column - not the whole column; to prevent potential bugs retrieve the whole column if the index contains a prefix of it
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r--sql/ha_innodb.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 795cffc0776..a6528209b3e 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -1863,7 +1863,11 @@ build_template(
if (prebuilt->read_just_key) {
/* MySQL has instructed us that it is enough to
- fetch the columns in the key */
+ fetch the columns in the key; looks like MySQL
+ can set this flag also when there is only a
+ prefix of the column in the key: in that case we
+ retrieve the whole column from the clustered
+ index */
fetch_all_in_key = TRUE;
} else {
@@ -1924,9 +1928,8 @@ build_template(
field = table->field[i];
if (templ_type == ROW_MYSQL_REC_FIELDS
- && !(fetch_all_in_key &&
- ULINT_UNDEFINED != dict_index_get_nth_col_pos(
- index, i))
+ && !(fetch_all_in_key
+ && dict_index_contains_col_or_prefix(index, i))
&& thd->query_id != field->query_id
&& thd->query_id != (field->query_id ^ MAX_ULONG_BIT)
&& thd->query_id !=