[Groonga-mysql-commit] mroonga/mroonga [master] disable_keys supports whole table recreate type alter table. refs #1311

Back to archive index

null+****@clear***** null+****@clear*****
2012年 6月 4日 (月) 00:12:15 JST


Kentoku	2012-06-04 00:12:15 +0900 (Mon, 04 Jun 2012)

  New Revision: 7c971599a4f61464880fc1141e43bc4db911b0e1

  Log:
    disable_keys supports whole table recreate type alter table. refs #1311

  Added files:
    lib/mrn_external_lock.cpp
    lib/mrn_external_lock.hpp
  Modified files:
    ha_mroonga.cpp
    ha_mroonga.hpp
    lib/libmrn_need_mysql_sources.am
    mrn_table.cpp
    mrn_table.hpp
    test/sql/suite/mroonga_storage/r/alter_table_disable_enable_keys.result
    test/sql/suite/mroonga_storage/t/alter_table_disable_enable_keys.test
    test/sql/suite/mroonga_wrapper/r/alter_table_disable_enable_keys.result
    test/sql/suite/mroonga_wrapper/t/alter_table_disable_enable_keys.test

  Modified: ha_mroonga.cpp (+132 -23)
===================================================================
--- ha_mroonga.cpp    2012-05-30 10:23:17 +0900 (270e448)
+++ ha_mroonga.cpp    2012-06-04 00:12:15 +0900 (3fc9b66)
@@ -50,6 +50,7 @@
 #include <mrn_index_table_name.hpp>
 #include <mrn_debug_column_access.hpp>
 #include <mrn_auto_increment_value_lock.hpp>
+#include <mrn_external_lock.hpp>
 #include <mrn_match_escalation_threshold_scope.hpp>
 
 #define MRN_SHORT_TEXT_SIZE (1 << 12) //  4Kbytes
@@ -2280,6 +2281,7 @@ int ha_mroonga::wrapper_create_index_fulltext(const char *grn_table_name,
                                               int i,
                                               KEY *key_info,
                                               grn_obj **index_tables,
+                                              grn_obj **index_columns,
                                               MRN_SHARE *tmp_share)
 {
   MRN_DBUG_ENTER_METHOD();
@@ -2348,7 +2350,11 @@ int ha_mroonga::wrapper_create_index_fulltext(const char *grn_table_name,
     my_message(error, ctx->errbuf, MYF(0));
     DBUG_RETURN(error);
   }
-  grn_obj_unlink(ctx, index_column);
+  if (index_columns) {
+    index_columns[i] = index_column;
+  } else {
+    grn_obj_unlink(ctx, index_column);
+  }
 
   DBUG_RETURN(error);
 }
@@ -2357,6 +2363,7 @@ int ha_mroonga::wrapper_create_index_geo(const char *grn_table_name,
                                          int i,
                                          KEY *key_info,
                                          grn_obj **index_tables,
+                                         grn_obj **index_columns,
                                          MRN_SHARE *tmp_share)
 {
   MRN_DBUG_ENTER_METHOD();
@@ -2402,7 +2409,11 @@ int ha_mroonga::wrapper_create_index_geo(const char *grn_table_name,
     my_message(error, ctx->errbuf, MYF(0));
     DBUG_RETURN(error);
   }
-  grn_obj_unlink(ctx, index_column);
+  if (index_columns) {
+    index_columns[i] = index_column;
+  } else {
+    grn_obj_unlink(ctx, index_column);
+  }
 
   DBUG_RETURN(error);
 }
@@ -2445,18 +2456,20 @@ int ha_mroonga::wrapper_create_index(const char *name, TABLE *table,
   uint i;
   uint n_keys = table->s->keys;
   grn_obj *index_tables[n_keys];
-  for (i = 0; i < n_keys; i++) {
-    index_tables[i] = NULL;
+  if (!tmp_share->disable_keys) {
+    for (i = 0; i < n_keys; i++) {
+      index_tables[i] = NULL;
 
-    KEY key_info = table->s->key_info[i];
-    if (key_info.algorithm == HA_KEY_ALG_FULLTEXT) {
-      error = wrapper_create_index_fulltext(grn_table_name,
-                                            i, &key_info,
-                                            index_tables, tmp_share);
-    } else if (mrn_is_geo_key(&key_info)) {
-      error = wrapper_create_index_geo(grn_table_name,
-                                       i, &key_info,
-                                       index_tables, tmp_share);
+      KEY key_info = table->s->key_info[i];
+      if (key_info.algorithm == HA_KEY_ALG_FULLTEXT) {
+        error = wrapper_create_index_fulltext(grn_table_name,
+                                              i, &key_info,
+                                              index_tables, NULL, tmp_share);
+      } else if (mrn_is_geo_key(&key_info)) {
+        error = wrapper_create_index_geo(grn_table_name,
+                                         i, &key_info,
+                                         index_tables, NULL, tmp_share);
+      }
     }
   }
 
@@ -2826,8 +2839,12 @@ int ha_mroonga::storage_create_indexes(TABLE *table, const char *grn_table_name,
     if (i == table->s->primary_key) {
       continue; // pkey is already handled
     }
+    KEY *key_info = &table->s->key_info[i];
+    if (tmp_share->disable_keys && !(key_info->flags & HA_NOSAME)) {
+      continue; // key is disabled
+    }
     if ((error = storage_create_index(table, grn_table_name, grn_table,
-                                      tmp_share, &table->s->key_info[i],
+                                      tmp_share, key_info,
                                       index_tables, NULL, i))) {
       break;
     }
@@ -2972,6 +2989,11 @@ int ha_mroonga::create(const char *name, TABLE *table, HA_CREATE_INFO *info)
   if (!(tmp_share = mrn_get_share(name, table, &error)))
     DBUG_RETURN(error);
 
+  st_mrn_slot_data *slot_data = mrn_get_slot_data(ha_thd(), FALSE);
+  if (slot_data && slot_data->disable_keys_create_info == info) {
+    tmp_share->disable_keys = TRUE;
+  }
+
   if (tmp_share->wrapper_mode)
   {
     error = wrapper_create(name, table, info, tmp_share);
@@ -3745,17 +3767,20 @@ void ha_mroonga::wrapper_set_keys_in_use()
   MRN_DBUG_ENTER_METHOD();
   mrn::AutoIncrementValueLock lock_(table_share);
   table_share->keys_in_use.set_prefix(table_share->keys);
+  share->disable_keys = FALSE;
   for (i = 0; i < table_share->keys; i++) {
     j = share->wrap_key_nr[i];
     if (j < MAX_KEY) {
       if (!share->wrap_table_share->keys_in_use.is_set(j)) {
         /* copy bitmap */
         table_share->keys_in_use.clear_bit(i);
+        share->disable_keys = TRUE;
       }
     } else {
       if (!grn_index_tables[i]) {
         /* disabled */
         table_share->keys_in_use.clear_bit(i);
+        share->disable_keys = TRUE;
       }
     }
   }
@@ -3770,6 +3795,7 @@ void ha_mroonga::storage_set_keys_in_use()
   MRN_DBUG_ENTER_METHOD();
   mrn::AutoIncrementValueLock lock_(table_share);
   table_share->keys_in_use.set_prefix(table_share->keys);
+  share->disable_keys = FALSE;
   for (i = 0; i < table_share->keys; i++) {
     if (i == table_share->primary_key) {
       continue;
@@ -3778,6 +3804,7 @@ void ha_mroonga::storage_set_keys_in_use()
       /* disabled */
       table_share->keys_in_use.clear_bit(i);
       DBUG_PRINT("info", ("mroonga: key %u disabled", i));
+      share->disable_keys = TRUE;
     }
   }
   table_share->keys_for_keyread.set_prefix(table_share->keys);
@@ -3837,6 +3864,12 @@ int ha_mroonga::storage_info(uint flag)
     struct system_variables *variables = &thd->variables;
     ulonglong nb_reserved_values;
     bool next_number_field_is_null = !table->next_number_field;
+    mrn::ExternalLock mrn_external_lock(ha_thd(), this,
+                                        mrn_lock_type == F_UNLCK ?
+                                        F_RDLCK : F_UNLCK);
+    if (mrn_external_lock.error()) {
+      DBUG_RETURN(mrn_external_lock.error());
+    }
     if (next_number_field_is_null) {
       table->next_number_field = table->found_next_number_field;
     }
@@ -10101,6 +10134,9 @@ void ha_mroonga::update_create_info(HA_CREATE_INFO* create_info)
       slot_data->alter_comment = mrn_create_string(
         create_info->comment.str, create_info->comment.length);
     }
+    if (share && share->disable_keys) {
+      slot_data->disable_keys_create_info = create_info;
+    }
   }
   DBUG_VOID_RETURN;
 }
@@ -10546,12 +10582,13 @@ int ha_mroonga::wrapper_enable_indexes(uint mode)
         break;
       }
       index_tables[i] = NULL;
+      index_columns[i] = NULL;
       if (!grn_index_tables[i]) {
         if (
           (key_info[i].flags & HA_FULLTEXT) &&
           (error = wrapper_create_index_fulltext(mapper.table_name(),
-                                                 i,
-                                                 &key_info[i], index_tables,
+                                                 i, &key_info[i],
+                                                 index_tables, index_columns,
                                                  share))
         ) {
           break;
@@ -10559,14 +10596,14 @@ int ha_mroonga::wrapper_enable_indexes(uint mode)
           mrn_is_geo_key(&key_info[i]) &&
           (error = wrapper_create_index_geo(mapper.table_name(),
                                             i, &key_info[i],
-                                            index_tables, share))
+                                            index_tables, index_columns,
+                                            share))
         ) {
           break;
         }
-        index_columns[i] = grn_index_columns[i];
-      } else {
-        index_columns[i] = NULL;
+        grn_index_columns[i] = index_columns[i];
       }
+      mrn_set_bitmap_by_key(table->read_set, &key_info[i]);
     }
     if (!error && i > j)
     {
@@ -10664,6 +10701,7 @@ int ha_mroonga::enable_indexes(uint mode)
 {
   int error = 0;
   MRN_DBUG_ENTER_METHOD();
+  share->disable_keys = FALSE;
   if (share->wrapper_mode)
   {
     error = wrapper_enable_indexes(mode);
@@ -10711,6 +10749,7 @@ int ha_mroonga::wrapper_fill_indexes(THD *thd, KEY *key_info,
   KEY *p_key_info = &table->key_info[table_share->primary_key];
   KEY *tmp_key_info;
   MRN_DBUG_ENTER_METHOD();
+  DBUG_PRINT("info", ("mroonga: n_keys=%u", n_keys));
   if (
     mrn_lock_type != F_UNLCK || !(error = wrapper_external_lock(thd, F_WRLCK))
   ) {
@@ -10858,6 +10897,7 @@ int ha_mroonga::repair(THD* thd, HA_CHECK_OPT* check_opt)
 {
   MRN_DBUG_ENTER_METHOD();
   int error = 0;
+  share->disable_keys = FALSE;
   if (share->wrapper_mode)
   {
     error = wrapper_repair(thd, check_opt);
@@ -11107,6 +11147,9 @@ int ha_mroonga::wrapper_add_index(TABLE *table_arg, KEY *key_info,
       j++;
       continue;
     }
+    if (share->disable_keys) {
+      continue;
+    }
     if ((error = mrn_add_index_param(tmp_share, &key_info[i], i + n_keys)))
     {
       break;
@@ -11116,7 +11159,7 @@ int ha_mroonga::wrapper_add_index(TABLE *table_arg, KEY *key_info,
       (key_info[i].flags & HA_FULLTEXT) &&
       (error = wrapper_create_index_fulltext(mapper.table_name(),
                                              i + n_keys,
-                                             &key_info[i], index_tables,
+                                             &key_info[i], index_tables, NULL,
                                              tmp_share))
     ) {
       break;
@@ -11124,13 +11167,13 @@ int ha_mroonga::wrapper_add_index(TABLE *table_arg, KEY *key_info,
       mrn_is_geo_key(&key_info[i]) &&
       (error = wrapper_create_index_geo(mapper.table_name(),
                                         i + n_keys, &key_info[i],
-                                        index_tables, tmp_share))
+                                        index_tables, NULL, tmp_share))
     ) {
       break;
     }
     mrn_set_bitmap_by_key(table->read_set, &key_info[i]);
   }
-  if (!error && i > j) {
+  if (!error && i > j && !share->disable_keys) {
     for (k = 0; k < num_of_keys; k++) {
       tmp_key_info = &key_info[k];
       if (!(tmp_key_info->flags & HA_FULLTEXT) &&
@@ -11146,6 +11189,7 @@ int ha_mroonga::wrapper_add_index(TABLE *table_arg, KEY *key_info,
                                  num_of_keys);
   }
   bitmap_set_all(table->read_set);
+
   if (!error && j)
   {
     MRN_SET_WRAP_SHARE_KEY(share, table->s);
@@ -11218,6 +11262,9 @@ int ha_mroonga::storage_add_index(TABLE *table_arg, KEY *key_info,
   bitmap_clear_all(table->read_set);
   mrn::PathMapper mapper(share->table_name);
   for (i = 0; i < num_of_keys; i++) {
+    if (share->disable_keys && !(key_info[i].flags & HA_NOSAME)) {
+      continue; // key is disabled
+    }
     index_tables[i + n_keys] = NULL;
     index_columns[i + n_keys] = NULL;
     if ((error = mrn_add_index_param(tmp_share, &key_info[i], i + n_keys)))
@@ -12306,6 +12353,68 @@ bool ha_mroonga::check_written_by_row_based_binlog()
   );
 }
 
+#ifdef MRN_HAVE_HA_REBIND_PSI
+void ha_mroonga::wrapper_unbind_psi()
+{
+  MRN_DBUG_ENTER_METHOD();
+  MRN_SET_WRAP_SHARE_KEY(share, table->s);
+  MRN_SET_WRAP_TABLE_KEY(this, table);
+  wrap_handler->unbind_psi();
+  MRN_SET_BASE_SHARE_KEY(share, table->s);
+  MRN_SET_BASE_TABLE_KEY(this, table);
+  DBUG_VOID_RETURN;
+}
+
+void ha_mroonga::storage_unbind_psi()
+{
+  MRN_DBUG_ENTER_METHOD();
+  DBUG_VOID_RETURN;
+}
+
+void ha_mroonga::unbind_psi()
+{
+  MRN_DBUG_ENTER_METHOD();
+  handler::unbind_psi();
+  if (share->wrapper_mode)
+  {
+    wrapper_unbind_psi();
+  } else {
+    storage_unbind_psi();
+  }
+  DBUG_VOID_RETURN;
+}
+
+void ha_mroonga::wrapper_rebind_psi()
+{
+  MRN_DBUG_ENTER_METHOD();
+  MRN_SET_WRAP_SHARE_KEY(share, table->s);
+  MRN_SET_WRAP_TABLE_KEY(this, table);
+  wrap_handler->rebind_psi();
+  MRN_SET_BASE_SHARE_KEY(share, table->s);
+  MRN_SET_BASE_TABLE_KEY(this, table);
+  DBUG_VOID_RETURN;
+}
+
+void ha_mroonga::storage_rebind_psi()
+{
+  MRN_DBUG_ENTER_METHOD();
+  DBUG_VOID_RETURN;
+}
+
+void ha_mroonga::rebind_psi()
+{
+  MRN_DBUG_ENTER_METHOD();
+  handler::rebind_psi();
+  if (share->wrapper_mode)
+  {
+    wrapper_rebind_psi();
+  } else {
+    storage_rebind_psi();
+  }
+  DBUG_VOID_RETURN;
+}
+#endif
+
 #ifdef __cplusplus
 }
 #endif

  Modified: ha_mroonga.hpp (+16 -0)
===================================================================
--- ha_mroonga.hpp    2012-05-30 10:23:17 +0900 (cbeb428)
+++ ha_mroonga.hpp    2012-06-04 00:12:15 +0900 (b843ede)
@@ -144,6 +144,10 @@ extern "C" {
 #  define MRN_OPTION_BITS_IS_UNDER_VARIABLES
 #endif
 
+#if MYSQL_VERSION_ID >= 50600
+#  define MRN_HAVE_HA_REBIND_PSI
+#endif
+
 class ha_mroonga;
 
 /* structs */
@@ -447,6 +451,10 @@ protected:
   uint referenced_by_foreign_key();
   void init_table_handle_for_HANDLER();
   void free_foreign_key_create_info(char* str);
+#ifdef MRN_HAVE_HA_REBIND_PSI
+  void unbind_psi();
+  void rebind_psi();
+#endif
 
 private:
   void push_warning_unsupported_spatial_index_search(enum ha_rkey_function flag);
@@ -576,11 +584,13 @@ private:
                                     int i,
                                     KEY *key_info,
                                     grn_obj **index_tables,
+                                    grn_obj **index_columns,
                                     MRN_SHARE *tmp_share);
   int wrapper_create_index_geo(const char *grn_table_name,
                                int i,
                                KEY *key_info,
                                grn_obj **index_tables,
+                               grn_obj **index_columns,
                                MRN_SHARE *tmp_share);
   int wrapper_create_index(const char *name, TABLE *table,
                            HA_CREATE_INFO *info, MRN_SHARE *tmp_share,
@@ -948,6 +958,12 @@ private:
   void wrapper_set_keys_in_use();
   void storage_set_keys_in_use();
   bool check_written_by_row_based_binlog();
+#ifdef MRN_HAVE_HA_REBIND_PSI
+  void wrapper_unbind_psi();
+  void storage_unbind_psi();
+  void wrapper_rebind_psi();
+  void storage_rebind_psi();
+#endif
 };
 
 #ifdef __cplusplus

  Modified: lib/libmrn_need_mysql_sources.am (+3 -1)
===================================================================
--- lib/libmrn_need_mysql_sources.am    2012-05-30 10:23:17 +0900 (8eaf981)
+++ lib/libmrn_need_mysql_sources.am    2012-06-04 00:12:15 +0900 (6fe04bf)
@@ -4,4 +4,6 @@ libmrn_need_mysql_la_SOURCES =			\
 	mrn_debug_column_access.cpp		\
 	mrn_debug_column_access.hpp		\
 	mrn_auto_increment_value_lock.cpp	\
-	mrn_auto_increment_value_lock.hpp
+	mrn_auto_increment_value_lock.hpp	\
+	mrn_external_lock.cpp	\
+	mrn_external_lock.hpp

  Added: lib/mrn_external_lock.cpp (+43 -0) 100644
===================================================================
--- /dev/null
+++ lib/mrn_external_lock.cpp    2012-06-04 00:12:15 +0900 (c0c6773)
@@ -0,0 +1,43 @@
+/* -*- c-basic-offset: 2 -*- */
+/*
+  Copyright(C) 2012 Kentoku SHIBA
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+#include "mrn_external_lock.hpp"
+
+namespace mrn {
+  ExternalLock::ExternalLock(THD *thd, handler *handler, int lock_type)
+    : thd_(thd),
+    handler_(handler),
+    lock_type_(lock_type) {
+    if (lock_type_ != F_UNLCK) {
+      error_ = handler_->ha_external_lock(thd_, lock_type);
+    } else {
+      error_ = 0;
+    }
+  }
+
+  ExternalLock::~ExternalLock() {
+    if (lock_type_ != F_UNLCK) {
+      handler_->ha_external_lock(thd_, F_UNLCK);
+    }
+  }
+
+  int ExternalLock::error() {
+    return error_;
+  }
+}

  Added: lib/mrn_external_lock.hpp (+38 -0) 100644
===================================================================
--- /dev/null
+++ lib/mrn_external_lock.hpp    2012-06-04 00:12:15 +0900 (2ef2d25)
@@ -0,0 +1,38 @@
+/* -*- c-basic-offset: 2 -*- */
+/*
+  Copyright(C) 2012 Kentoku SHIBA
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+#ifndef MRN_EXTERNAL_LOCK_HPP_
+#define MRN_EXTERNAL_LOCK_HPP_
+
+#include <mrn_mysql.h>
+
+namespace mrn {
+  class ExternalLock {
+    THD *thd_;
+    handler *handler_;
+    int lock_type_;
+    int error_;
+  public:
+    ExternalLock(THD *thd, handler *handler, int lock_type);
+    ~ExternalLock();
+    int error();
+  };
+}
+
+#endif // MRN_EXTERNAL_LOCK_HPP_

  Modified: mrn_table.cpp (+2 -0)
===================================================================
--- mrn_table.cpp    2012-05-30 10:23:17 +0900 (0983363)
+++ mrn_table.cpp    2012-06-04 00:12:15 +0900 (7981cf3)
@@ -877,6 +877,7 @@ st_mrn_slot_data *mrn_get_slot_data(THD *thd, bool can_create)
     slot_data->last_insert_record_id = GRN_ID_NIL;
     slot_data->first_alter_share = NULL;
     slot_data->alter_create_info = NULL;
+    slot_data->disable_keys_create_info = NULL;
     slot_data->alter_connect_string = NULL;
     slot_data->alter_comment = NULL;
     *thd_ha_data(thd, mrn_hton_ptr) = (void *) slot_data;
@@ -910,6 +911,7 @@ void mrn_clear_alter_share(THD *thd)
       slot_data->first_alter_share = NULL;
     }
     slot_data->alter_create_info = NULL;
+    slot_data->disable_keys_create_info = NULL;
     if (slot_data->alter_connect_string) {
       my_free(slot_data->alter_connect_string, MYF(0));
       slot_data->alter_connect_string = NULL;

  Modified: mrn_table.hpp (+2 -0)
===================================================================
--- mrn_table.hpp    2012-05-30 10:23:17 +0900 (710aced)
+++ mrn_table.hpp    2012-06-04 00:12:15 +0900 (e8ea969)
@@ -47,6 +47,7 @@ typedef struct st_mroonga_share
   uint               wrap_primary_key;
   uint               base_primary_key;
   bool               wrapper_mode;
+  bool               disable_keys;
 } MRN_SHARE;
 
 struct st_mrn_alter_share
@@ -61,6 +62,7 @@ struct st_mrn_slot_data
   grn_id last_insert_record_id;
   st_mrn_alter_share *first_alter_share;
   HA_CREATE_INFO *alter_create_info;
+  HA_CREATE_INFO *disable_keys_create_info;
   char *alter_connect_string;
   char *alter_comment;
 };

  Modified: test/sql/suite/mroonga_storage/r/alter_table_disable_enable_keys.result (+2 -4)
===================================================================
--- test/sql/suite/mroonga_storage/r/alter_table_disable_enable_keys.result    2012-05-30 10:23:17 +0900 (c1f0a7f)
+++ test/sql/suite/mroonga_storage/r/alter_table_disable_enable_keys.result    2012-06-04 00:12:15 +0900 (72db940)
@@ -37,11 +37,9 @@ ERROR HY000: Can't find FULLTEXT index matching the column list
 select * from diaries where match(title) against("富士山");
 ERROR HY000: Can't find FULLTEXT index matching the column list
 explain select * from diaries where match(content) against("富士山");
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	diaries	fulltext	content_index	content_index	0		1	Using where with pushed condition
+ERROR HY000: Can't find FULLTEXT index matching the column list
 select * from diaries where match(content) against("富士山");
-id	title	content	create_dt
-2	天気	明日の富士山の天気について	2012-04-30 23:00:00
+ERROR HY000: Can't find FULLTEXT index matching the column list
 explain select * from diaries where create_dt = "2012-04-30 20:00:00";
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	diaries	ALL	NULL	NULL	NULL	NULL	3	Using where

  Modified: test/sql/suite/mroonga_storage/t/alter_table_disable_enable_keys.test (+2 -0)
===================================================================
--- test/sql/suite/mroonga_storage/t/alter_table_disable_enable_keys.test    2012-05-30 10:23:17 +0900 (998df51)
+++ test/sql/suite/mroonga_storage/t/alter_table_disable_enable_keys.test    2012-06-04 00:12:15 +0900 (2535fa8)
@@ -42,7 +42,9 @@ select * from diaries where id = 2;
 explain select * from diaries where match(title) against("富士山");
 --error 1191
 select * from diaries where match(title) against("富士山");
+--error 1191
 explain select * from diaries where match(content) against("富士山");
+--error 1191
 select * from diaries where match(content) against("富士山");
 explain select * from diaries where create_dt = "2012-04-30 20:00:00";
 select * from diaries where create_dt = "2012-04-30 20:00:00";

  Modified: test/sql/suite/mroonga_wrapper/r/alter_table_disable_enable_keys.result (+3 -4)
===================================================================
--- test/sql/suite/mroonga_wrapper/r/alter_table_disable_enable_keys.result    2012-05-30 10:23:17 +0900 (5d29ed7)
+++ test/sql/suite/mroonga_wrapper/r/alter_table_disable_enable_keys.result    2012-06-04 00:12:15 +0900 (6dd9093)
@@ -37,11 +37,9 @@ ERROR HY000: Can't find FULLTEXT index matching the column list
 select * from diaries where match(title) against("富士山");
 ERROR HY000: Can't find FULLTEXT index matching the column list
 explain select * from diaries where match(content) against("富士山");
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	diaries	fulltext	content_index	content_index	0		1	Using where
+ERROR HY000: Can't find FULLTEXT index matching the column list
 select * from diaries where match(content) against("富士山");
-id	title	content	create_dt
-2	天気	明日の富士山の天気について	2012-04-30 23:00:00
+ERROR HY000: Can't find FULLTEXT index matching the column list
 explain select * from diaries where create_dt = "2012-04-30 20:00:00";
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	diaries	ref	create_dt	create_dt	9	const	1	Using where
@@ -60,6 +58,7 @@ id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	diaries	fulltext	title	title	0		1	Using where
 select * from diaries where match(title) against("富士山");
 id	title	content	create_dt
+3	富士山	今日もきれい。	2012-04-30 19:00:00
 explain select * from diaries where match(content) against("富士山");
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	diaries	fulltext	content_index	content_index	0		1	Using where

  Modified: test/sql/suite/mroonga_wrapper/t/alter_table_disable_enable_keys.test (+2 -2)
===================================================================
--- test/sql/suite/mroonga_wrapper/t/alter_table_disable_enable_keys.test    2012-05-30 10:23:17 +0900 (df413e1)
+++ test/sql/suite/mroonga_wrapper/t/alter_table_disable_enable_keys.test    2012-06-04 00:12:15 +0900 (a358ca1)
@@ -15,8 +15,6 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-skip DISABLE KEYS and ENABLE KEYS is not available for wrapper mode yet;
-
 --source include/have_innodb.inc
 --source include/have_mroonga.inc
 
@@ -46,7 +44,9 @@ select * from diaries where id = 2;
 explain select * from diaries where match(title) against("富士山");
 --error 1191
 select * from diaries where match(title) against("富士山");
+--error 1191
 explain select * from diaries where match(content) against("富士山");
+--error 1191
 select * from diaries where match(content) against("富士山");
 explain select * from diaries where create_dt = "2012-04-30 20:00:00";
 select * from diaries where create_dt = "2012-04-30 20:00:00";




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