[Groonga-commit] groonga/groonga at 650a88a [master] db: validate key_type existance when table type is not TABLE_NO_KEY

Back to archive index

Naoya Murakami null+****@clear*****
Tue Jun 28 15:05:11 JST 2016


Naoya Murakami	2016-06-28 15:05:11 +0900 (Tue, 28 Jun 2016)

  New Revision: 650a88ac068b02e123e7baecbfb519f9040dd211
  https://github.com/groonga/groonga/commit/650a88ac068b02e123e7baecbfb519f9040dd211

  Merged 3874b30: Merge pull request #570 from naoa/table-create-validate-no-key-type-for-non-no-key

  Message:
    db: validate key_type existance when table type is not TABLE_NO_KEY

  Modified files:
    lib/db.c

  Modified: lib/db.c (+8 -0)
===================================================================
--- lib/db.c    2016-06-28 13:55:00 +0900 (02ff9a7)
+++ lib/db.c    2016-06-28 15:05:11 +0900 (6a7b7b4)
@@ -1011,6 +1011,14 @@ grn_table_create_validate(grn_ctx *ctx, const char *name, unsigned int name_size
     return ctx->rc;
   }
 
+  if (!key_type && table_type != GRN_OBJ_TABLE_NO_KEY) {
+    ERR(GRN_INVALID_ARGUMENT,
+        "[table][create] "
+        "key is necessary for %s table: <%.*s>",
+        table_type_name, name_size, name);
+    return ctx->rc;
+  }
+
   if ((flags & GRN_OBJ_KEY_WITH_SIS) &&
       table_type != GRN_OBJ_TABLE_PAT_KEY) {
     ERR(GRN_INVALID_ARGUMENT,
-------------- next part --------------
HTML����������������������������...
Download 



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