[Groonga-commit] groonga/groonga [master] Exit load command when an uncontinuable error occurred.

Back to archive index

null+****@clear***** null+****@clear*****
2012年 7月 5日 (木) 13:19:10 JST


Daijiro MORI	2012-07-05 13:19:10 +0900 (Thu, 05 Jul 2012)

  New Revision: 423caeaf88091e3eb7d580d09463333e4316b126
  https://github.com/groonga/groonga/commit/423caeaf88091e3eb7d580d09463333e4316b126

  Log:
    Exit load command when an uncontinuable error occurred.

  Modified files:
    lib/db.c

  Modified: lib/db.c (+7 -0)
===================================================================
--- lib/db.c    2012-07-05 12:35:42 +0900 (0cdff21)
+++ lib/db.c    2012-07-05 13:19:10 +0900 (898f831)
@@ -9388,11 +9388,13 @@ grn_load_(grn_ctx *ctx, grn_content_type input_type,
     loader->input_type = input_type;
     if (grn_db_check_name(ctx, table, table_len)) {
       GRN_DB_CHECK_NAME_ERR("[table][load]", table, table_len);
+      loader->stat = GRN_LOADER_END;
       return;
     }
     loader->table = grn_ctx_get(ctx, table, table_len);
     if (!loader->table) {
       ERR(GRN_INVALID_ARGUMENT, "nonexistent table: <%.*s>", table_len, table);
+      loader->stat = GRN_LOADER_END;
       return;
     }
     if (loader->table && columns && columns_len) {
@@ -9437,6 +9439,11 @@ grn_load_(grn_ctx *ctx, grn_content_type input_type,
       }
     }
   } else {
+    if (!loader->table) {
+      ERR(GRN_INVALID_ARGUMENT, "mandatory \"table\" parameter is absent");
+      loader->stat = GRN_LOADER_END;
+      return;
+    }
     input_type = loader->input_type;
   }
   switch (input_type) {
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
下載 



Groonga-commit メーリングリストの案内
Back to archive index