Navigation Menu

Skip to content

Commit

Permalink
fix a bug of table name.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikdttr committed Jul 21, 2009
1 parent 0ebd600 commit 0e83f1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/ha_groonga.cc
Expand Up @@ -248,7 +248,7 @@ int ha_groonga::create(const char *name, TABLE *form, HA_CREATE_INFO *info)
{
int res;
mrn_info *minfo;
convert_info(this->table_share, &minfo);
convert_info(name, this->table_share, &minfo);
res = mrn_create(ctx, minfo);
mrn_deinit_obj_info(ctx, minfo);
return res;
Expand Down Expand Up @@ -327,7 +327,7 @@ int ha_groonga::open(const char *name, int mode, uint test_if_locked)
else
{
mrn_info *minfo;
convert_info(this->table_share, &minfo);
convert_info(name, this->table_share, &minfo);
if (mrn_open(ctx, minfo) == 0)
{
mrn_hash_put(ctx, minfo->table->name, minfo);
Expand Down Expand Up @@ -818,12 +818,12 @@ int ha_groonga::ft_read(uchar *buf)
}
#endif

int ha_groonga::convert_info(TABLE_SHARE *share, mrn_info **_minfo)
int ha_groonga::convert_info(const char *name, TABLE_SHARE *share, mrn_info **_minfo)
{
uint n_columns = share->fields, i;
mrn_info *minfo = mrn_init_obj_info(ctx, n_columns);
minfo->table->name = share->table_name.str;
minfo->table->name_size = share->table_name.length;
minfo->table->name = MRN_TABLE_NAME(name);
minfo->table->name_size = strlen(MRN_TABLE_NAME(name));
minfo->table->flags |= GRN_OBJ_TABLE_NO_KEY;

for (i=0; i < n_columns; i++)
Expand Down
2 changes: 1 addition & 1 deletion src/ha_groonga.h
Expand Up @@ -64,7 +64,7 @@ class ha_groonga: public handler
int ft_read(uchar *buf);

// additional functions
int convert_info(TABLE_SHARE *share, mrn_info **minfo);
int convert_info(const char *name, TABLE_SHARE *share, mrn_info **minfo);
};

#endif /* _ha_groonga_h */

0 comments on commit 0e83f1b

Please sign in to comment.