[Groonga-commit] groonga/groonga at 1c58548 [master] test: require key type for other than TABLE_NO_KEY table

Back to archive index

Susumu Yata null+****@clear*****
Fri Sep 2 15:17:40 JST 2016


Susumu Yata	2016-09-02 15:17:40 +0900 (Fri, 02 Sep 2016)

  New Revision: 1c585481544849553ecf97ad0c13892461ec1a6b
  https://github.com/groonga/groonga/commit/1c585481544849553ecf97ad0c13892461ec1a6b

  Message:
    test: require key type for other than TABLE_NO_KEY table
    
    GitHub: fix #599

  Modified files:
    lib/db.c

  Modified: lib/db.c (+9 -0)
===================================================================
--- lib/db.c    2016-09-02 15:16:42 +0900 (578ba85)
+++ lib/db.c    2016-09-02 15:17:40 +0900 (de30364)
@@ -1011,6 +1011,15 @@ grn_table_create_validate(grn_ctx *ctx, const char *name, unsigned int name_size
     break;
   }
 
+  if (!key_type && table_type != GRN_OBJ_TABLE_NO_KEY &&
+      !(flags & GRN_OBJ_KEY_VAR_SIZE)) {
+    ERR(GRN_INVALID_ARGUMENT,
+        "[table][create] "
+        "key type is required for TABLE_HASH_KEY, TABLE_PAT_KEY or "
+        "TABLE_DAT_KEY: <%.*s> (null)", name_size, name);
+    return ctx->rc;
+  }
+
   if (key_type && table_type == GRN_OBJ_TABLE_NO_KEY) {
     int key_name_size;
     char key_name[GRN_TABLE_MAX_KEY_SIZE];
-------------- next part --------------
HTML����������������������������...
Download 



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