summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index a921cd43048..afea08ecab3 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -10889,7 +10889,8 @@ int safe_index_read(JOIN_TAB *tab)
TABLE *table= tab->table;
if ((error=table->file->index_read(table->record[0],
tab->ref.key_buff,
- tab->ref.key_length, HA_READ_KEY_EXACT)))
+ tab_to_keypart_map(tab),
+ HA_READ_KEY_EXACT)))
return report_error(table, error);
return 0;
}
@@ -11027,7 +11028,8 @@ join_read_const(JOIN_TAB *tab)
{
error=table->file->index_read_idx(table->record[0],tab->ref.key,
(byte*) tab->ref.key_buff,
- tab->ref.key_length,HA_READ_KEY_EXACT);
+ tab_to_keypart_map(tab),
+ HA_READ_KEY_EXACT);
}
if (error)
{
@@ -11070,7 +11072,8 @@ join_read_key(JOIN_TAB *tab)
}
error=table->file->index_read(table->record[0],
tab->ref.key_buff,
- tab->ref.key_length,HA_READ_KEY_EXACT);
+ tab_to_keypart_map(tab),
+ HA_READ_KEY_EXACT);
if (error && error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
return report_error(table, error);
}
@@ -11098,7 +11101,8 @@ join_read_always_key(JOIN_TAB *tab)
return -1;
if ((error=table->file->index_read(table->record[0],
tab->ref.key_buff,
- tab->ref.key_length,HA_READ_KEY_EXACT)))
+ tab_to_keypart_map(tab),
+ HA_READ_KEY_EXACT)))
{
if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
return report_error(table, error);
@@ -11125,7 +11129,7 @@ join_read_last_key(JOIN_TAB *tab)
return -1;
if ((error=table->file->index_read_last(table->record[0],
tab->ref.key_buff,
- tab->ref.key_length)))
+ tab_to_keypart_map(tab))))
{
if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
return report_error(table, error);
@@ -11666,7 +11670,7 @@ end_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
group->buff[-1]= (char) group->field->is_null();
}
if (!table->file->index_read(table->record[1],
- join->tmp_table_param.group_buff,0,
+ join->tmp_table_param.group_buff, ~(ulonglong)0,
HA_READ_KEY_EXACT))
{ /* Update old record */
restore_record(table,record[1]);