[Groonga-commit] ranguba/rroonga at 6b3bc4a [master] Accept :order_by => :key for double array trie

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Sep 2 18:36:53 JST 2015


Kouhei Sutou	2015-09-02 18:36:53 +0900 (Wed, 02 Sep 2015)

  New Revision: 6b3bc4af6854517ea77b35932ca59a0eab1d33f0
  https://github.com/ranguba/rroonga/commit/6b3bc4af6854517ea77b35932ca59a0eab1d33f0

  Message:
    Accept :order_by => :key for double array trie

  Modified files:
    ext/groonga/rb-grn-table-cursor.c

  Modified: ext/groonga/rb-grn-table-cursor.c (+8 -3)
===================================================================
--- ext/groonga/rb-grn-table-cursor.c    2015-09-02 18:36:26 +0900 (cdf2ae8)
+++ ext/groonga/rb-grn-table-cursor.c    2015-09-02 18:36:53 +0900 (30f421c)
@@ -107,11 +107,16 @@ rb_grn_table_cursor_order_by_to_flag (unsigned char table_type,
     } else if (rb_grn_equal_option(rb_order_by, "id")) {
         flag |= GRN_CURSOR_BY_ID;
     } else if (rb_grn_equal_option(rb_order_by, "key")) {
-        if (table_type != GRN_TABLE_PAT_KEY) {
+        switch (table_type) {
+        case GRN_TABLE_PAT_KEY:
+        case GRN_TABLE_DAT_KEY:
+            break;
+        default:
             rb_raise(rb_eArgError,
-                     "order_by => :key is available "
-                     "only for Groonga::PatriciaTrie: %s",
+                     "order_by => :key is available only for "
+                     "Groonga::PatriciaTrie and Groonga::DoubleArrayTrie: %s",
                      rb_grn_inspect(rb_table));
+            break;
         }
         flag |= GRN_CURSOR_BY_KEY;
     } else {
-------------- next part --------------
HTML����������������������������...
下载 



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