[Groonga-commit] groonga/groonga at 8d6cdd9 [master] select: support sort by index column value with filter

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Oct 4 12:51:20 JST 2018


Kouhei Sutou	2018-10-04 12:51:20 +0900 (Thu, 04 Oct 2018)

  Revision: 8d6cdd94b06f8b7d3d07e48669efc456ea15ec27
  https://github.com/groonga/groonga/commit/8d6cdd94b06f8b7d3d07e48669efc456ea15ec27

  Message:
    select: support sort by index column value with filter

  Copied files:
    test/command/suite/select/sort_keys/index/no_search.expected
      (from test/command/suite/select/sort_keys/index.expected)
    test/command/suite/select/sort_keys/index/no_search.test
      (from test/command/suite/select/sort_keys/index.test)
  Modified files:
    lib/db.c
  Renamed files:
    test/command/suite/select/sort_keys/index/search.expected
      (from test/command/suite/select/sort_keys/index.expected)
    test/command/suite/select/sort_keys/index/search.test
      (from test/command/suite/select/sort_keys/index.test)

  Modified: lib/db.c (+17 -1)
===================================================================
--- lib/db.c    2018-09-28 12:29:02 +0900 (2ba5b6494)
+++ lib/db.c    2018-10-04 12:51:20 +0900 (ba3a760a1)
@@ -12919,8 +12919,24 @@ grn_table_sort(grn_ctx *ctx, grn_obj *table, int offset, int limit,
             }
           }
         } else {
-          if (kp->key->header.type == GRN_COLUMN_INDEX) {
+          switch (kp->key->header.type) {
+          case GRN_ACCESSOR :
+            {
+              grn_accessor *accessor = (grn_accessor *)(kp->key);
+              while (accessor->next) {
+                accessor = accessor->next;
+              }
+              if (accessor->action == GRN_ACCESSOR_GET_COLUMN_VALUE &&
+                  accessor->obj->header.type == GRN_COLUMN_INDEX) {
+                have_index_value_get = GRN_TRUE;
+              }
+            }
+            break;
+          case GRN_COLUMN_INDEX :
             have_index_value_get = GRN_TRUE;
+            break;
+          default :
+            break;
           }
           kp->offset = KEY_UINT32;
         }

  Copied: test/command/suite/select/sort_keys/index/no_search.expected (+0 -0) 100%
===================================================================

  Copied: test/command/suite/select/sort_keys/index/no_search.test (+0 -0) 100%
===================================================================

  Renamed: test/command/suite/select/sort_keys/index/search.expected (+1 -1) 96%
===================================================================
--- test/command/suite/select/sort_keys/index.expected    2018-09-28 12:29:02 +0900 (636a1f48c)
+++ test/command/suite/select/sort_keys/index/search.expected    2018-10-04 12:51:20 +0900 (d47e4f943)
@@ -14,7 +14,7 @@ load --table Logs
 ["Error: invalid argument."]
 ]
 [[0,0.0,0.0],3]
-select Terms --sort_keys -index
+select Terms --filter true --sort_keys -index
 [
   [
     0,

  Renamed: test/command/suite/select/sort_keys/index/search.test (+1 -1) 88%
===================================================================
--- test/command/suite/select/sort_keys/index.test    2018-09-28 12:29:02 +0900 (57e0f187f)
+++ test/command/suite/select/sort_keys/index/search.test    2018-10-04 12:51:20 +0900 (b74d09115)
@@ -14,4 +14,4 @@ load --table Logs
 ["Error: invalid argument."]
 ]
 
-select Terms --sort_keys -index
+select Terms --filter true --sort_keys -index
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20181004/aac8afdc/attachment-0001.htm 



More information about the Groonga-commit mailing list
Back to archive index