[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] fix a bug of mrn_create when auto_drop - column creation failed.

Back to archive index

Tetsuro IKEDA null+****@clear*****
Thu Oct 4 10:28:42 JST 2012


Tetsuro IKEDA	2009-08-18 16:31:23 +0900 (Tue, 18 Aug 2009)

  New Revision: b1f6b52ecafaf3db3814b0ad778b0fc0f8ae43a1
  https://github.com/mroonga/mroonga/commit/b1f6b52ecafaf3db3814b0ad778b0fc0f8ae43a1

  Log:
    fix a bug of mrn_create when auto_drop - column creation failed.

  Modified files:
    driver.c

  Modified: driver.c (+7 -2)
===================================================================
--- driver.c    2009-08-18 16:31:01 +0900 (f77925e)
+++ driver.c    2009-08-18 16:31:23 +0900 (61e4601)
@@ -348,11 +348,16 @@ int mrn_create(grn_ctx *ctx, mrn_info *info)
 
 auto_drop:
   GRN_LOG(ctx, GRN_LOG_ERROR, "auto-drop table/columns");
-  for (; i > 0; --i)
+  while (--i >= 0)
   {
-    grn_obj_remove(ctx, info->columns[i]->obj);
+    grn_obj *col = grn_column_open(ctx, table->obj,
+                                   info->columns[i]->name,
+                                   info->columns[i]->name_size,
+                                   NULL, info->columns[i]->type);
+    grn_obj_remove(ctx, col);
     info->columns[i]->obj = NULL;
   }
+  grn_ctx_get(ctx, info->table->name, info->table->name_size);
   grn_obj_remove(ctx, info->table->obj);
   info->table->obj = NULL;
   return -1;
-------------- next part --------------
HTML����������������������������...
Download 



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