[Groonga-mysql-commit] mroonga/mroonga [master] mariadb523: follow auto_repair() signature change

Back to archive index

null+****@clear***** null+****@clear*****
2012年 4月 16日 (月) 10:00:38 JST


Kouhei Sutou	2012-04-16 10:00:38 +0900 (Mon, 16 Apr 2012)

  New Revision: 138ccf83ada8bdff5d1e6716bf03168b745752f9

  Log:
    mariadb523: follow auto_repair() signature change
    
    fixes #1339
    
    Reported by Kazuhiko Shiozaki. Thanks!!!

  Modified files:
    ha_mroonga.cpp
    ha_mroonga.hpp

  Modified: ha_mroonga.cpp (+23 -7)
===================================================================
--- ha_mroonga.cpp    2012-04-16 09:52:52 +0900 (6335267)
+++ ha_mroonga.cpp    2012-04-16 10:00:38 +0900 (aaeb4d2)
@@ -10217,38 +10217,54 @@ bool ha_mroonga::is_crashed() const
   DBUG_RETURN(crashed);
 }
 
-bool ha_mroonga::wrapper_auto_repair() const
+bool ha_mroonga::wrapper_auto_repair(int error) const
 {
   bool crashed;
   MRN_DBUG_ENTER_METHOD();
   MRN_SET_WRAP_SHARE_KEY(share, table->s);
   MRN_SET_WRAP_TABLE_KEY(this, table);
-  crashed = wrap_handler->auto_repair();
+#ifdef MRN_HANDLER_AUTO_REPAIR_HAVE_ERROR
+  crashed = wrap_handler->auto_repair(error);
+#else
+  crashed = wrap_handler->auto_repair(error);
+#endif
   MRN_SET_BASE_SHARE_KEY(share, table->s);
   MRN_SET_BASE_TABLE_KEY(this, table);
   DBUG_RETURN(crashed);
 }
 
-bool ha_mroonga::storage_auto_repair() const
+bool ha_mroonga::storage_auto_repair(int error) const
 {
   MRN_DBUG_ENTER_METHOD();
-  bool crashed = handler::auto_repair();
+  bool crashed;
+#ifdef MRN_HANDLER_AUTO_REPAIR_HAVE_ERROR
+  crashed = handler::auto_repair(error);
+#else
+  crashed = handler::auto_repair();
+#endif
   DBUG_RETURN(crashed);
 }
 
-bool ha_mroonga::auto_repair() const
+bool ha_mroonga::auto_repair(int error) const
 {
   MRN_DBUG_ENTER_METHOD();
   bool crashed;
   if (share->wrapper_mode)
   {
-    crashed = wrapper_auto_repair();
+    crashed = wrapper_auto_repair(error);
   } else {
-    crashed = storage_auto_repair();
+    crashed = storage_auto_repair(error);
   }
   DBUG_RETURN(crashed);
 }
 
+bool ha_mroonga::auto_repair() const
+{
+  MRN_DBUG_ENTER_METHOD();
+  bool crashed = auto_repair(HA_ERR_CRASHED_ON_USAGE);
+  DBUG_RETURN(crashed);
+}
+
 int ha_mroonga::wrapper_disable_indexes(uint mode)
 {
   int error = 0;

  Modified: ha_mroonga.hpp (+7 -2)
===================================================================
--- ha_mroonga.hpp    2012-04-16 09:52:52 +0900 (7fbb3d8)
+++ ha_mroonga.hpp    2012-04-16 10:00:38 +0900 (cf791af)
@@ -129,6 +129,10 @@ extern "C" {
 #  define MRN_HAVE_TL_WRITE_ALLOW_READ
 #endif
 
+#if (defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 50523)
+#  define MRN_HANDLER_AUTO_REPAIR_HAVE_ERROR
+#endif
+
 class ha_mroonga;
 
 /* structs */
@@ -362,6 +366,7 @@ public:
   void update_create_info(HA_CREATE_INFO* create_info);
   int rename_table(const char *from, const char *to);
   bool is_crashed() const;
+  bool auto_repair(int error) const;
   bool auto_repair() const;
   int disable_indexes(uint mode);
   int enable_indexes(uint mode);
@@ -822,8 +827,8 @@ private:
                            const char *to_table_name);
   bool wrapper_is_crashed() const;
   bool storage_is_crashed() const;
-  bool wrapper_auto_repair() const;
-  bool storage_auto_repair() const;
+  bool wrapper_auto_repair(int error) const;
+  bool storage_auto_repair(int error) const;
   int wrapper_disable_indexes(uint mode);
   int storage_disable_indexes(uint mode);
   int wrapper_enable_indexes(uint mode);




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