[Groonga-mysql-commit] mroonga/mroonga at ef94a3c [master] Fix alter table with fulltext index which refer to table causes mysqld crash

Back to archive index

Kenji Maruyama null+****@clear*****
Thu Feb 20 15:15:26 JST 2014


Kenji Maruyama	2014-02-20 15:15:26 +0900 (Thu, 20 Feb 2014)

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

  Message:
    Fix alter table with fulltext index which refer to table causes mysqld crash
    
    refs #2327
    
    [groonga-dev,02130]
    
    Reported by Naoya Murakami. Thanks!

  Modified files:
    ha_mroonga.cpp
    mrn_table.cpp

  Modified: ha_mroonga.cpp (+6 -2)
===================================================================
--- ha_mroonga.cpp    2014-02-19 23:28:53 +0900 (6b438e6)
+++ ha_mroonga.cpp    2014-02-20 15:15:26 +0900 (9867f28)
@@ -13190,6 +13190,8 @@ bool ha_mroonga::storage_inplace_alter_table(
   TABLE_SHARE tmp_table_share;
   char **key_parser;
   uint *key_parser_length;
+  char **index_table;
+  uint *index_table_length;
   KEY *p_key_info = &table->key_info[table_share->primary_key];
   bool have_multiple_column_index = false;
   memset(index_tables, 0, sizeof(grn_obj *) * ha_alter_info->key_count);
@@ -13199,6 +13201,8 @@ bool ha_mroonga::storage_inplace_alter_table(
   if (!(tmp_share = (MRN_SHARE *)
     my_multi_malloc(MYF(MY_WME | MY_ZEROFILL),
       &tmp_share, sizeof(*tmp_share),
+      &index_table, sizeof(char *) *(tmp_table_share.keys),
+      &index_table_length, sizeof(uint) *(tmp_table_share.keys),
       &key_parser, sizeof(char *) * (tmp_table_share.keys),
       &key_parser_length, sizeof(uint) * (tmp_table_share.keys),
       NullS))
@@ -13209,8 +13213,8 @@ bool ha_mroonga::storage_inplace_alter_table(
   }
   tmp_share->engine = NULL;
   tmp_share->table_share = &tmp_table_share;
-  tmp_share->index_table = NULL;
-  tmp_share->index_table_length = NULL;
+  tmp_share->index_table = index_table;
+  tmp_share->index_table_length = index_table_length;
   tmp_share->key_parser = key_parser;
   tmp_share->key_parser_length = key_parser_length;
   bitmap_clear_all(table->read_set);

  Modified: mrn_table.cpp (+1 -1)
===================================================================
--- mrn_table.cpp    2014-02-19 23:28:53 +0900 (570020b)
+++ mrn_table.cpp    2014-02-20 15:15:26 +0900 (95fa08a)
@@ -278,7 +278,7 @@ void mrn_get_partition_info(const char *table_name, uint table_name_length,
   if (!strncasecmp(tmp_ptr, title_name, title_length)) \
   { \
     DBUG_PRINT("info", ("mroonga "title_name" start")); \
-    if (!share->param_name[param_pos]) \
+    if (share->param_name && !share->param_name[param_pos]) \
     { \
       if ((share->param_name[param_pos] = mrn_get_string_between_quote( \
         start_ptr))) \
-------------- next part --------------
HTML����������������������������...
Download 



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