Navigation Menu

Skip to content

Commit

Permalink
[storage] fix read_range_first for no multicolumn index is broken.
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Sep 23, 2011
1 parent 28bb8fd commit 464c215
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ha_mroonga.cc
Expand Up @@ -4054,7 +4054,7 @@ int ha_mroonga::storage_index_first(uchar *buf)
}
bool is_multiple_column_index = table->key_info[active_index].key_parts > 1;
uint pkey_nr = table->s->primary_key;
if (is_multiple_column_index) { // primary index
if (is_multiple_column_index) { // multiple column index
DBUG_PRINT("info", ("mroonga use multiple column key"));
cur = grn_table_cursor_open(ctx, grn_index_tables[active_index],
NULL, 0, NULL, 0,
Expand Down Expand Up @@ -4312,6 +4312,9 @@ int ha_mroonga::storage_read_range_first(const key_range *start_key,
const char *col_name = field->field_name;
int col_name_size = strlen(col_name);
if (start_key) {
mrn_set_key_buf(ctx, field, start_key->key, key_min[active_index],
&size_min);
val_min = key_min[active_index];
if (start_key->flag == HA_READ_KEY_EXACT) {
// for _id
if (strncmp(MRN_ID_COL_NAME, col_name, col_name_size) == 0) {
Expand All @@ -4328,10 +4331,6 @@ int ha_mroonga::storage_read_range_first(const key_range *start_key,
record_id = GRN_ID_NIL;
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
} else {
mrn_set_key_buf(ctx, field, start_key->key, key_min[active_index],
&size_min);
val_min = key_min[active_index];
}
}
}
Expand Down

0 comments on commit 464c215

Please sign in to comment.