[Groonga-mysql-commit] mroonga/mroonga [master] [storage] don't normalize key for multiple column index.

Back to archive index

null+****@clear***** null+****@clear*****
2011年 9月 23日 (金) 21:15:01 JST


Kouhei Sutou	2011-09-23 12:15:01 +0000 (Fri, 23 Sep 2011)

  New Revision: 815136fd58db798c3f31c6535f8f6e7237e65aa0

  Log:
    [storage] don't normalize key for multiple column index.

  Modified files:
    ha_mroonga.cc

  Modified: ha_mroonga.cc (+5 -4)
===================================================================
--- ha_mroonga.cc    2011-09-23 11:33:11 +0000 (93e053d)
+++ ha_mroonga.cc    2011-09-23 12:15:01 +0000 (4b931cb)
@@ -1640,6 +1640,7 @@ int ha_mroonga::storage_create(const char *name, TABLE *table,
     KEY key_info = table->s->key_info[i];
 
     int key_parts = key_info.key_parts;
+    grn_obj_flags idx_tbl_flags = GRN_OBJ_PERSISTENT;
     if (key_parts == 1) {
       Field *field = key_info.key_part[0].field;
       const char *column_name = field->field_name;
@@ -1654,6 +1655,7 @@ int ha_mroonga::storage_create(const char *name, TABLE *table,
       int mysql_field_type = field->type();
       grn_builtin_type groonga_type = mrn_get_type(ctx, mysql_field_type);
       index_type = grn_ctx_at(ctx, groonga_type);
+      idx_tbl_flags |= GRN_OBJ_KEY_NORMALIZE;
     } else {
       index_type = grn_ctx_at(ctx, GRN_DB_SHORT_TEXT);
     }
@@ -1664,13 +1666,12 @@ int ha_mroonga::storage_create(const char *name, TABLE *table,
       GRN_OBJ_COLUMN_INDEX | GRN_OBJ_WITH_POSITION | GRN_OBJ_PERSISTENT;
 
     int key_alg = key_info.algorithm;
-    grn_obj_flags idx_tbl_flags;
     if (key_alg == HA_KEY_ALG_FULLTEXT) {
-      idx_tbl_flags = GRN_OBJ_TABLE_PAT_KEY | GRN_OBJ_PERSISTENT | GRN_OBJ_KEY_NORMALIZE;
+      idx_tbl_flags |= GRN_OBJ_TABLE_PAT_KEY;
     } else if (key_alg == HA_KEY_ALG_HASH) {
-      idx_tbl_flags = GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_PERSISTENT | GRN_OBJ_KEY_NORMALIZE;
+      idx_tbl_flags |= GRN_OBJ_TABLE_HASH_KEY;
     } else {
-      idx_tbl_flags = GRN_OBJ_TABLE_PAT_KEY | GRN_OBJ_PERSISTENT | GRN_OBJ_KEY_NORMALIZE;
+      idx_tbl_flags |= GRN_OBJ_TABLE_PAT_KEY;
     }
 
     idx_tbl_obj = grn_table_create(ctx, idx_name, strlen(idx_name), NULL,




Groonga-mysql-commit メーリングリストの案内
Back to archive index