null+****@clear*****
null+****@clear*****
2012年 2月 23日 (木) 00:27:32 JST
Kouhei Sutou 2012-02-23 00:27:32 +0900 (Thu, 23 Feb 2012) New Revision: 30afd4c7feae6a13dd74c446b6c9feac72fa6663 Log: Support "-" as index table name separator refs #1284 Modified files: ha_mroonga.cc mrn_sys.c Modified: ha_mroonga.cc (+1 -10) =================================================================== --- ha_mroonga.cc 2012-02-22 22:55:01 +0900 (881c9f2) +++ ha_mroonga.cc 2012-02-23 00:27:32 +0900 (24fd3ed) @@ -6580,19 +6580,10 @@ FT_INFO *ha_mroonga::generic_ft_init_ext(uint flags, uint key_nr, String *key) info->primary_key_info = &(table->key_info[table_share->primary_key]); grn_obj *index_column = grn_index_columns[key_nr]; - char index_column_name[GRN_TABLE_MAX_KEY_SIZE]; - int index_column_name_length; - index_column_name_length = grn_obj_name(info->ctx, - index_column, - index_column_name, - GRN_TABLE_MAX_KEY_SIZE); grn_obj *match_columns, *match_columns_variable; GRN_EXPR_CREATE_FOR_QUERY(info->ctx, info->table, match_columns, match_columns_variable); - grn_expr_parse(info->ctx, match_columns, - index_column_name, index_column_name_length, - NULL, GRN_OP_MATCH, GRN_OP_AND, - GRN_EXPR_SYNTAX_SCRIPT); + grn_expr_append_obj(info->ctx, match_columns, index_column, GRN_OP_PUSH, 1); grn_obj *expression, *expression_variable; GRN_EXPR_CREATE_FOR_QUERY(info->ctx, info->table, Modified: mrn_sys.c (+2 -2) =================================================================== --- mrn_sys.c 2012-02-22 22:55:01 +0900 (47e193c) +++ mrn_sys.c 2012-02-23 00:27:32 +0900 (f234e10) @@ -165,12 +165,12 @@ char *mrn_table_name_gen_for_mysql(const char *arg, char *dest) } /** - * "${table}" ==> "${table}#${index_name}" + * "${table}" ==> "${table}-${index_name}" */ char *mrn_index_table_name_gen(const char *table_name, const char *index_name, char *dest) { - snprintf(dest, MRN_MAX_PATH_SIZE, "%s#%s", table_name, index_name); + snprintf(dest, MRN_MAX_PATH_SIZE, "%s-%s", table_name, index_name); return dest; }