[Groonga-commit] groonga/groonga [master] fixed applying inappropriate index in grn_table_sort()

Back to archive index

null+****@clear***** null+****@clear*****
2011年 11月 9日 (水) 20:08:30 JST


Daijiro MORI	2011-11-09 11:08:30 +0000 (Wed, 09 Nov 2011)

  New Revision: 87f5da4546f34e16085867cf5905457a39ad1ede

  Log:
    fixed applying inappropriate index in grn_table_sort()

  Modified files:
    lib/db.c

  Modified: lib/db.c (+2 -1)
===================================================================
--- lib/db.c    2011-11-09 09:16:54 +0000 (f02d102)
+++ lib/db.c    2011-11-09 11:08:30 +0000 (31001fe)
@@ -7271,7 +7271,8 @@ grn_table_sort(grn_ctx *ctx, grn_obj *table, int offset, int limit,
     i = grn_geo_table_sort(ctx, table, offset, limit, result, keys, n_keys);
     goto exit;
   }
-  if (n_keys == 1 && grn_column_index(ctx, keys->key, GRN_OP_LESS, &index, 1, NULL)) {
+  if (n_keys == 1 && !GRN_ACCESSORP(keys->key) &&
+      grn_column_index(ctx, keys->key, GRN_OP_LESS, &index, 1, NULL)) {
     grn_id tid;
     grn_pat *lexicon = (grn_pat *)grn_ctx_at(ctx, index->header.domain);
     grn_pat_cursor *pc = grn_pat_cursor_open(ctx, lexicon, NULL, 0, NULL, 0,




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