[Groonga-commit] groonga/groonga at f209838 [master] Accept LongText source type and ShortText lexicon key type

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Aug 24 17:49:59 JST 2016


Kouhei Sutou	2016-08-24 17:49:59 +0900 (Wed, 24 Aug 2016)

  New Revision: f2098385180e9ac6358e6e618ffa7e34fb99f87b
  https://github.com/groonga/groonga/commit/f2098385180e9ac6358e6e618ffa7e34fb99f87b

  Message:
    Accept LongText source type and ShortText lexicon key type

  Added files:
    test/command/suite/column_create/index/source/text_family.expected
    test/command/suite/column_create/index/source/text_family.test
  Modified files:
    lib/db.c

  Modified: lib/db.c (+3 -1)
===================================================================
--- lib/db.c    2016-08-24 17:34:50 +0900 (289756e)
+++ lib/db.c    2016-08-24 17:49:59 +0900 (20c8055)
@@ -8491,7 +8491,9 @@ grn_obj_set_info_source_validate(grn_ctx *ctx, grn_obj *obj, grn_obj *value)
             source);
         }
       } else {
-        if (lexicon_domain_id != source_type_id) {
+        if (!(lexicon_domain_id == source_type_id ||
+              (grn_type_id_is_text_family(ctx, lexicon_domain_id) &&
+               grn_type_id_is_text_family(ctx, source_type_id)))) {
           grn_obj_set_info_source_invalid_lexicon_error(
             ctx,
             "index table's key must equal source type",

  Added: test/command/suite/column_create/index/source/text_family.expected (+8 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/column_create/index/source/text_family.expected    2016-08-24 17:49:59 +0900 (9e678ca)
@@ -0,0 +1,8 @@
+table_create Notes TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Notes title COLUMN_SCALAR LongText
+[[0,0.0,0.0],true]
+table_create Titles TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+column_create Titles notes_title COLUMN_INDEX Notes title
+[[0,0.0,0.0],true]

  Added: test/command/suite/column_create/index/source/text_family.test (+5 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/column_create/index/source/text_family.test    2016-08-24 17:49:59 +0900 (b887e4f)
@@ -0,0 +1,5 @@
+table_create Notes TABLE_NO_KEY
+column_create Notes title COLUMN_SCALAR LongText
+
+table_create Titles TABLE_PAT_KEY ShortText
+column_create Titles notes_title COLUMN_INDEX Notes title
-------------- next part --------------
HTML����������������������������...
Download 



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