[Groonga-commit] groonga/groonga [master] Fixed a bug in buffer_new() wrong key was used.

Back to archive index

null+****@clear***** null+****@clear*****
2010年 7月 2日 (金) 21:23:20 JST


Daijiro MORI	2010-07-02 12:23:20 +0000 (Fri, 02 Jul 2010)

  New Revision: 94306d4fde04043b5be2f37ca1de5e5b25b2052d

  Log:
    Fixed a bug in buffer_new() wrong key was used.

  Modified files:
    lib/ii.c

  Modified: lib/ii.c (+4 -2)
===================================================================
--- lib/ii.c    2010-07-02 08:58:20 +0000 (869363e)
+++ lib/ii.c    2010-07-02 12:23:20 +0000 (14187ec)
@@ -3172,8 +3172,10 @@ buffer_new(grn_ctx *ctx, grn_ii *ii, int size, uint32_t *pos,
   buffer *b = NULL;
   grn_id tid;
   uint16_t offset;
-  unsigned key_size;
-  const char *key = _grn_table_key(ctx, ii->lexicon, id, &key_size);
+  char key[GRN_TABLE_MAX_KEY_SIZE];
+  // unsigned key_size;
+  // const char *key = _grn_table_key(ctx, ii->lexicon, id, &key_size);
+  int key_size = grn_table_get_key(ctx, ii->lexicon, id, key, GRN_TABLE_MAX_KEY_SIZE);
   uint32_t *a, lseg = NOT_ASSIGNED, pseg = NOT_ASSIGNED;
   grn_table_cursor *tc = (ii->lexicon->header.type == GRN_TABLE_PAT_KEY)
     ? grn_table_cursor_open(ctx, ii->lexicon, key, key_size, NULL, 0, 0, -1,




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