[Groonga-mysql-commit] mroonga/mroonga at e17d863 [master] wrapper: fix a bug that CHECK TABLE FOR UPGRADE drops other tables

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Nov 29 00:06:20 JST 2015


Kouhei Sutou	2015-11-29 00:06:20 +0900 (Sun, 29 Nov 2015)

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

  Message:
    wrapper: fix a bug that CHECK TABLE FOR UPGRADE drops other tables
    
    [groonga-dev,03699]
    
    Reported by Tomohiro KATO. Thanks!!!

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+5 -15)
===================================================================
--- ha_mroonga.cpp    2015-11-28 23:51:58 +0900 (20d0a14)
+++ ha_mroonga.cpp    2015-11-29 00:06:20 +0900 (2eede66)
@@ -4013,21 +4013,11 @@ int ha_mroonga::wrapper_open(const char *name, int mode, uint open_options)
   MRN_DBUG_ENTER_METHOD();
 
   mrn::Database *db = NULL;
-  if (open_options & HA_OPEN_FOR_REPAIR) {
-    error = ensure_database_remove(name);
-    if (error)
-      DBUG_RETURN(error);
-    error = ensure_database_open(name);
-    if (error)
-      DBUG_RETURN(error);
-    grn_table = NULL;
-    grn_index_tables = NULL;
-    grn_index_columns = NULL;
-  } else {
-    error = ensure_database_open(name, &db);
-    if (error)
-      DBUG_RETURN(error);
+  error = ensure_database_open(name, &db);
+  if (error)
+    DBUG_RETURN(error);
 
+  if (!(open_options & HA_OPEN_FOR_REPAIR)) {
     error = open_table(name);
     if (error)
       DBUG_RETURN(error);
@@ -4096,7 +4086,7 @@ int ha_mroonga::wrapper_open(const char *name, int mode, uint open_options)
   if (!error) {
     if (open_options & HA_OPEN_FOR_REPAIR) {
       // TODO: How to check whether is DISABLE KEYS used or not?
-      error = wrapper_create_index(name, table, share);
+      error = wrapper_recreate_indexes(ha_thd());
     } else if (db) {
       mrn::Lock lock(&mrn_operations_mutex);
       mrn::PathMapper mapper(name);
-------------- next part --------------
HTML����������������������������...
Download 



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