Navigation Menu

Skip to content

Commit

Permalink
added pkey const search tryal implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikdttr committed Apr 14, 2009
1 parent 5fe55e9 commit eeee7ff
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
24 changes: 21 additions & 3 deletions src/ha_groonga.cc
Expand Up @@ -294,9 +294,7 @@ int ha_groonga::info(uint flag)
mrn_ctx_init();
MRN_TRACE;

if (flag & HA_STATUS_VARIABLE) {
stats.records = (ha_rows) grn_table_size(mrn_ctx_tls, share->obj);
}
stats.records = (ha_rows) grn_table_size(mrn_ctx_tls, share->obj);

return 0;
}
Expand Down Expand Up @@ -465,6 +463,26 @@ int ha_groonga::write_row(uchar *buf)
return 0;
}

int ha_groonga::index_read(uchar *buf, const uchar *key,
uint key_len, enum ha_rkey_function find_flag)
{
MRN_TRACE;
Field *key_field= table->key_info[active_index].key_part->field;
uint rc= 0;
if (key_field->field_index == table->s->primary_key)
{
key_field->set_key_image(key, key_len);
key_field->set_notnull();
}
return rc;
}

int ha_groonga::index_next(uchar *buf)
{
MRN_TRACE;
return HA_ERR_END_OF_FILE;
}

/* additional functions */
static bool mrn_flush_logs(handlerton *hton)
{
Expand Down
10 changes: 9 additions & 1 deletion src/ha_groonga.h
Expand Up @@ -63,7 +63,15 @@ class ha_groonga: public handler

int delete_table(const char *name);
int write_row(uchar *buf);
uint max_supported_keys() const { return MAX_KEY; }

uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; }
uint max_supported_keys() const { return 1; }
uint max_supported_key_parts() const { return 1; }
uint max_supported_key_length() const { return MAX_KEY_LENGTH; }

int index_read(uchar *buf, const uchar *key, uint key_len,
enum ha_rkey_function find_flag);
int index_next(uchar *buf);
};

#endif /* _ha_groonga_h */

0 comments on commit eeee7ff

Please sign in to comment.