[Groonga-commit] groonga/groonga at 255576e [master] dump: fix a bug that no column table isn't dumped

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Apr 3 16:45:18 JST 2015


Kouhei Sutou	2015-04-03 16:45:18 +0900 (Fri, 03 Apr 2015)

  New Revision: 255576ec9d8c126a2569f100c7e5ba8ecc871ebb
  https://github.com/groonga/groonga/commit/255576ec9d8c126a2569f100c7e5ba8ecc871ebb

  Message:
    dump: fix a bug that no column table isn't dumped

  Modified files:
    lib/proc.c

  Modified: lib/proc.c (+5 -3)
===================================================================
--- lib/proc.c    2015-04-03 15:44:21 +0900 (507a359)
+++ lib/proc.c    2015-04-03 16:45:18 +0900 (10ce09f)
@@ -2940,7 +2940,8 @@ dump_records(grn_ctx *ctx, grn_obj *outbuf, grn_obj *table)
   grn_table_cursor *cursor;
   int i, ncolumns, n_use_columns;
   grn_obj columnbuf, delete_commands, use_columns, column_name;
-  grn_bool have_only_index_column = GRN_TRUE;
+  grn_bool have_index_column = GRN_FALSE;
+  grn_bool have_data_column = GRN_FALSE;
 
   switch (table->header.type) {
   case GRN_TABLE_HASH_KEY:
@@ -2965,11 +2966,12 @@ dump_records(grn_ctx *ctx, grn_obj *outbuf, grn_obj *table)
   GRN_TEXT_INIT(&column_name, 0);
   for (i = 0; i < ncolumns; i++) {
     if (GRN_OBJ_INDEX_COLUMNP(columns[i])) {
+      have_index_column = GRN_TRUE;
       continue;
     }
 
     if (columns[i]->header.type != GRN_ACCESSOR) {
-      have_only_index_column = GRN_FALSE;
+      have_data_column = GRN_TRUE;
     }
 
     GRN_BULK_REWIND(&column_name);
@@ -2993,7 +2995,7 @@ dump_records(grn_ctx *ctx, grn_obj *outbuf, grn_obj *table)
     GRN_PTR_PUT(ctx, &use_columns, columns[i]);
   }
 
-  if (have_only_index_column) {
+  if (have_index_column && !have_data_column) {
     goto exit;
   }
 
-------------- next part --------------
HTML����������������������������...
Descargar 



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