List:Commits« Previous MessageNext Message »
From:Guilhem Bichot Date:November 4 2010 4:08pm
Subject:bzr commit into mysql-next-mr-bugfixing branch (guilhem:3330)
View as plain text  
#At file:///home/mysql_src/bzrrepos_new/mysql-next-mr-bugfixing2/ based on revid:guilhem@stripped

 3330 Guilhem Bichot	2010-11-04
      Code cleanup: change parameter "uchar *element" of insert_dynamic()
      and set_dynamic() to "const void *": to show that it does not change
      the element, and to eliminate many casts.
     @ include/my_sys.h
        insert_dynamic() and set_dynamic() treat "element" as bytes and use it as
        the source of memcpy(). As memcpy() accepts void* it sounds natural to
        use void* as type for "element". It then avoids casts in calling code.
        Before the change, we had to write:
        insert_dynamic(array, (uchar*)keyuse);
        because conversion from KEYUSE* to uchar* requires an explicit cast.
        After the change we can write
        insert_dynamic(array, keyuse);
        because conversion from KEYUSE* to void* is always allowed.
     @ mysys/array.c
        void* is more natural.

    modified:
      client/mysqlbinlog.cc
      client/mysqlcheck.c
      client/mysqltest.cc
      extra/comp_err.c
      extra/resolve_stack_dump.c
      include/my_sys.h
      mysys/array.c
      mysys/default.c
      mysys/mf_tempdir.c
      sql-common/client.c
      sql/item_func.cc
      sql/mysqld.cc
      sql/opt_range.cc
      sql/rpl_filter.cc
      sql/rpl_handler.cc
      sql/rpl_slave.cc
      sql/set_var.h
      sql/sp_head.cc
      sql/sp_pcontext.cc
      sql/sp_pcontext.h
      sql/sql_array.h
      sql/sql_audit.cc
      sql/sql_plugin.cc
      sql/sql_select.cc
      sql/sql_show.cc
      sql/uniques.cc
      storage/federated/ha_federated.cc
=== modified file 'client/mysqlbinlog.cc'
--- a/client/mysqlbinlog.cc	2010-09-01 02:51:08 +0000
+++ b/client/mysqlbinlog.cc	2010-11-04 16:08:12 +0000
@@ -460,7 +460,7 @@ Exit_status Load_log_processor::process_
      after Execute_load_query_log_event or Execute_load_log_event
      will have been processed, otherwise in Load_log_processor::destroy()
   */
-  if (set_dynamic(&file_names, (uchar*)&rec, file_id))
+  if (set_dynamic(&file_names, &rec, file_id))
   {
     error("Out of memory.");
     my_free(fname);

=== modified file 'client/mysqlcheck.c'
--- a/client/mysqlcheck.c	2010-07-15 13:47:50 +0000
+++ b/client/mysqlcheck.c	2010-11-04 16:08:12 +0000
@@ -744,7 +744,7 @@ static void print_result()
       */
       if (found_error && opt_auto_repair && what_to_do != DO_REPAIR &&
 	  strcmp(row[3],"OK"))
-	insert_dynamic(&tables4repair, (uchar*) prev);
+	insert_dynamic(&tables4repair, prev);
       found_error=0;
       if (opt_silent)
 	continue;
@@ -764,7 +764,7 @@ static void print_result()
   }
   /* add the last table to be repaired to the list */
   if (found_error && opt_auto_repair && what_to_do != DO_REPAIR)
-    insert_dynamic(&tables4repair, (uchar*) prev);
+    insert_dynamic(&tables4repair, prev);
   mysql_free_result(res);
 }
 

=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2010-10-06 11:44:39 +0000
+++ b/client/mysqltest.cc	2010-11-04 16:08:12 +0000
@@ -5995,7 +5995,7 @@ int read_command(struct st_command** com
   if (!(*command_ptr= command=
         (struct st_command*) my_malloc(sizeof(*command),
                                        MYF(MY_WME|MY_ZEROFILL))) ||
-      insert_dynamic(&q_lines, (uchar*) &command))
+      insert_dynamic(&q_lines, &command))
     die("Out of memory");
   command->type= Q_UNKNOWN;
 
@@ -6492,7 +6492,7 @@ void init_win_path_patterns()
       continue;
     }
 
-    if (insert_dynamic(&patterns, (uchar*) &p))
+    if (insert_dynamic(&patterns, &p))
       die("Out of memory");
 
     DBUG_PRINT("info", ("p: %s", p));
@@ -9000,7 +9000,7 @@ struct st_replace_regex* init_replace_re
       reg.icase= 1;
 
     /* done parsing the statement, now place it in regex_arr */
-    if (insert_dynamic(&res->regex_arr,(uchar*) &reg))
+    if (insert_dynamic(&res->regex_arr, &reg))
       die("Out of memory");
   }
   res->odd_buf_len= res->even_buf_len= 8192;
@@ -10016,7 +10016,7 @@ void dynstr_append_sorted(DYNAMIC_STRING
     *line_end= 0;
 
     /* Insert pointer to the line in array */
-    if (insert_dynamic(&lines, (uchar*) &start))
+    if (insert_dynamic(&lines, &start))
       die("Out of memory inserting lines to sort");
 
     start= line_end+1;

=== modified file 'extra/comp_err.c'
--- a/extra/comp_err.c	2010-07-20 19:30:10 +0000
+++ b/extra/comp_err.c	2010-11-04 16:08:12 +0000
@@ -496,7 +496,7 @@ static int parse_input_file(const char *
 		current_error->er_name, current_message.lang_short_name);
 	DBUG_RETURN(0);
       }
-      if (insert_dynamic(&current_error->msg, (uchar *) & current_message))
+      if (insert_dynamic(&current_error->msg, &current_message))
 	DBUG_RETURN(0);
       continue;
     }

=== modified file 'extra/resolve_stack_dump.c'
--- a/extra/resolve_stack_dump.c	2010-07-23 20:15:07 +0000
+++ b/extra/resolve_stack_dump.c	2010-11-04 16:08:12 +0000
@@ -230,7 +230,7 @@ static void init_sym_table()
     SYM_ENTRY se;
     if (init_sym_entry(&se, buf))
       continue;
-    if (insert_dynamic(&sym_table, (uchar*)&se))
+    if (insert_dynamic(&sym_table, &se))
       die("insert_dynamic() failed - looks like we are out of memory");
   }
 

=== modified file 'include/my_sys.h'
--- a/include/my_sys.h	2010-08-06 08:54:01 +0000
+++ b/include/my_sys.h	2010-11-04 16:08:12 +0000
@@ -778,10 +778,11 @@ extern my_bool init_dynamic_array2(DYNAM
 /* init_dynamic_array() function is deprecated */
 extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size,
                                   uint init_alloc, uint alloc_increment);
-extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,uchar * element);
+extern my_bool insert_dynamic(DYNAMIC_ARRAY *array, const void *element);
 extern uchar *alloc_dynamic(DYNAMIC_ARRAY *array);
 extern uchar *pop_dynamic(DYNAMIC_ARRAY*);
-extern my_bool set_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_index);
+extern my_bool set_dynamic(DYNAMIC_ARRAY *array, const void *element,
+                           uint array_index);
 extern my_bool allocate_dynamic(DYNAMIC_ARRAY *array, uint max_elements);
 extern void get_dynamic(DYNAMIC_ARRAY *array,uchar * element,uint array_index);
 extern void delete_dynamic(DYNAMIC_ARRAY *array);

=== modified file 'mysys/array.c'
--- a/mysys/array.c	2010-07-08 21:20:08 +0000
+++ b/mysys/array.c	2010-11-04 16:08:12 +0000
@@ -92,7 +92,7 @@ my_bool init_dynamic_array(DYNAMIC_ARRAY
     FALSE	Ok
 */
 
-my_bool insert_dynamic(DYNAMIC_ARRAY *array, uchar* element)
+my_bool insert_dynamic(DYNAMIC_ARRAY *array, const void *element)
 {
   uchar* buffer;
   if (array->elements == array->max_element)
@@ -196,7 +196,7 @@ uchar *pop_dynamic(DYNAMIC_ARRAY *array)
     FALSE	Ok
 */
 
-my_bool set_dynamic(DYNAMIC_ARRAY *array, uchar* element, uint idx)
+my_bool set_dynamic(DYNAMIC_ARRAY *array, const void *element, uint idx)
 {
   if (idx >= array->elements)
   {

=== modified file 'mysys/default.c'
--- a/mysys/default.c	2010-07-23 20:59:42 +0000
+++ b/mysys/default.c	2010-11-04 16:08:12 +0000
@@ -321,7 +321,7 @@ static int handle_default_option(void *i
   {
     if (!(tmp= alloc_root(ctx->alloc, strlen(option) + 1)))
       return 1;
-    if (insert_dynamic(ctx->args, (uchar*) &tmp))
+    if (insert_dynamic(ctx->args, &tmp))
       return 1;
     strmov(tmp, option);
   }

=== modified file 'mysys/mf_tempdir.c'
--- a/mysys/mf_tempdir.c	2010-07-15 11:13:30 +0000
+++ b/mysys/mf_tempdir.c	2010-11-04 16:08:12 +0000
@@ -52,7 +52,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, c
     strmake(buff, pathlist, (uint) (end-pathlist));
     length= cleanup_dirname(buff, buff);
     if (!(copy= my_strndup(buff, length, MYF(MY_WME))) ||
-        insert_dynamic(&tmpdir->full_list, (uchar*) &copy))
+        insert_dynamic(&tmpdir->full_list, &copy))
       DBUG_RETURN(TRUE);
     pathlist=end+1;
   }

=== modified file 'sql-common/client.c'
--- a/sql-common/client.c	2010-07-15 11:41:37 +0000
+++ b/sql-common/client.c	2010-11-04 16:08:12 +0000
@@ -1169,7 +1169,7 @@ static int add_init_command(struct st_my
   }
 
   if (!(tmp= my_strdup(cmd,MYF(MY_WME))) ||
-      insert_dynamic(options->init_commands, (uchar*)&tmp))
+      insert_dynamic(options->init_commands, &tmp))
   {
     my_free(tmp);
     return 1;

=== modified file 'sql/item_func.cc'
--- a/sql/item_func.cc	2010-08-30 08:40:42 +0000
+++ b/sql/item_func.cc	2010-11-04 16:08:12 +0000
@@ -4977,7 +4977,7 @@ int get_var_with_binlog(THD *thd, enum_s
   }
   /* Mark that this variable has been used by this query */
   var_entry->used_query_id= thd->query_id;
-  if (insert_dynamic(&thd->user_var_events, (uchar*) &user_var_event))
+  if (insert_dynamic(&thd->user_var_events, &user_var_event))
     goto err;
 
   *out_entry= var_entry;

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2010-10-13 23:16:09 +0000
+++ b/sql/mysqld.cc	2010-11-04 16:08:12 +0000
@@ -6710,7 +6710,7 @@ SHOW_VAR status_vars[]= {
 bool add_terminator(DYNAMIC_ARRAY *options)
 {
   my_option empty_element= {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0};
-  return insert_dynamic(options, (uchar *)&empty_element);
+  return insert_dynamic(options, &empty_element);
 }
 
 #ifndef EMBEDDED_LIBRARY
@@ -7380,7 +7380,7 @@ static int get_options(int *argc_ptr, ch
   for (my_option *opt= my_long_options;
        opt < my_long_options + array_elements(my_long_options) - 1;
        opt++)
-    insert_dynamic(&all_options, (uchar*) opt);
+    insert_dynamic(&all_options, opt);
   sys_var_add_options(&all_options, sys_var::PARSE_NORMAL);
   add_terminator(&all_options);
 

=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2010-09-28 15:17:29 +0000
+++ b/sql/opt_range.cc	2010-11-04 16:08:12 +0000
@@ -8132,7 +8132,7 @@ get_quick_keys(PARAM *param,QUICK_RANGE_
   set_if_bigger(quick->max_used_key_length, range->min_length);
   set_if_bigger(quick->max_used_key_length, range->max_length);
   set_if_bigger(quick->used_key_parts, (uint) key_tree->part+1);
-  if (insert_dynamic(&quick->ranges, (uchar*) &range))
+  if (insert_dynamic(&quick->ranges, &range))
     return 1;
 
  end:
@@ -8336,7 +8336,7 @@ QUICK_RANGE_SELECT *get_quick_select_for
     key_part->null_bit=     key_info->key_part[part].null_bit;
     key_part->flag=         (uint8) key_info->key_part[part].key_part_flag;
   }
-  if (insert_dynamic(&quick->ranges,(uchar*)&range))
+  if (insert_dynamic(&quick->ranges, &range))
     goto err;
 
   /*
@@ -8357,7 +8357,7 @@ QUICK_RANGE_SELECT *get_quick_select_for
                       make_prev_keypart_map(ref->key_parts), EQ_RANGE)))
       goto err;
     *ref->null_ref_key= 0;		// Clear null byte
-    if (insert_dynamic(&quick->ranges,(uchar*)&null_range))
+    if (insert_dynamic(&quick->ranges, &null_range))
       goto err;
   }
 
@@ -10846,7 +10846,7 @@ bool QUICK_GROUP_MIN_MAX_SELECT::add_ran
                          range_flag);
   if (!range)
     return TRUE;
-  if (insert_dynamic(&min_max_ranges, (uchar*)&range))
+  if (insert_dynamic(&min_max_ranges, &range))
     return TRUE;
   return FALSE;
 }

=== modified file 'sql/rpl_filter.cc'
--- a/sql/rpl_filter.cc	2010-10-13 23:16:09 +0000
+++ b/sql/rpl_filter.cc	2010-11-04 16:08:12 +0000
@@ -465,7 +465,7 @@ Rpl_filter::add_table_rule_to_array(DYNA
   e->key_len= len;
   memcpy(e->db, table_spec, len);
 
-  if (insert_dynamic(a, (uchar*)&e))
+  if (insert_dynamic(a, &e))
   {
     my_free(e);
     return 1;

=== modified file 'sql/rpl_handler.cc'
--- a/sql/rpl_handler.cc	2010-07-16 21:00:50 +0000
+++ b/sql/rpl_handler.cc	2010-11-04 16:08:12 +0000
@@ -181,7 +181,7 @@ void delegates_destroy()
       r= 0;                                                             \
       break;                                                            \
     }                                                                   \
-    insert_dynamic(plugins, (uchar *)&plugin);                          \
+    insert_dynamic(plugins, &plugin);                                   \
     if (((Observer *)info->observer)->f                                 \
         && ((Observer *)info->observer)->f args)                        \
     {                                                                   \

=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc	2010-09-26 23:56:20 +0000
+++ b/sql/rpl_slave.cc	2010-11-04 16:08:12 +0000
@@ -1156,7 +1156,7 @@ int init_dynarray_intvar_from_file(DYNAM
     else
     {
       ulong val= atol(token);
-      insert_dynamic(arr, (uchar *) &val);
+      insert_dynamic(arr, &val);
     }
   }
 err:
@@ -5725,7 +5725,7 @@ bool change_master(THD* thd, Master_info
                   mi->ignore_server_ids.elements, sizeof(ulong),
                   (int (*) (const void*, const void*))
                   change_master_server_id_cmp) == NULL)
-        insert_dynamic(&mi->ignore_server_ids, (uchar*) &s_id);
+        insert_dynamic(&mi->ignore_server_ids, &s_id);
     }
   }
   sort_dynamic(&mi->ignore_server_ids, (qsort_cmp) change_master_server_id_cmp);

=== modified file 'sql/set_var.h'
--- a/sql/set_var.h	2010-09-09 13:10:57 +0000
+++ b/sql/set_var.h	2010-11-04 16:08:12 +0000
@@ -134,7 +134,7 @@ public:
   bool register_option(DYNAMIC_ARRAY *array, int parse_flags)
   {
     return (option.id != -1) && (m_parse_flag & parse_flags) &&
-           insert_dynamic(array, (uchar*)&option);
+           insert_dynamic(array, &option);
   }
 
 private:

=== modified file 'sql/sp_head.cc'
--- a/sql/sp_head.cc	2010-08-12 13:58:01 +0000
+++ b/sql/sp_head.cc	2010-11-04 16:08:12 +0000
@@ -2669,7 +2669,7 @@ int sp_head::add_instr(sp_instr *instr)
     entire stored procedure, as their life span is equal.
   */
   instr->mem_root= &main_mem_root;
-  return insert_dynamic(&m_instr, (uchar*)&instr);
+  return insert_dynamic(&m_instr, &instr);
 }
 
 

=== modified file 'sql/sp_pcontext.cc'
--- a/sql/sp_pcontext.cc	2010-07-08 21:42:23 +0000
+++ b/sql/sp_pcontext.cc	2010-11-04 16:08:12 +0000
@@ -263,7 +263,7 @@ sp_pcontext::push_variable(LEX_STRING *n
   p->mode= mode;
   p->offset= current_var_count();
   p->dflt= NULL;
-  if (insert_dynamic(&m_vars, (uchar*)&p))
+  if (insert_dynamic(&m_vars, &p))
     return NULL;
   return p;
 }
@@ -318,7 +318,7 @@ sp_pcontext::push_cond(LEX_STRING *name,
   p->name.str= name->str;
   p->name.length= name->length;
   p->val= val;
-  return insert_dynamic(&m_conds, (uchar *)&p);
+  return insert_dynamic(&m_conds, &p);
 }
 
 /*
@@ -390,7 +390,7 @@ sp_pcontext::push_cursor(LEX_STRING *nam
     m_max_cursor_index+= 1;
   n.str= name->str;
   n.length= name->length;
-  return insert_dynamic(&m_cursors, (uchar *)&n);
+  return insert_dynamic(&m_cursors, &n);
 }
 
 /*

=== modified file 'sql/sp_pcontext.h'
--- a/sql/sp_pcontext.h	2010-07-30 15:30:30 +0000
+++ b/sql/sp_pcontext.h	2010-11-04 16:08:12 +0000
@@ -279,7 +279,7 @@ public:
   inline bool
   push_case_expr_id(int case_expr_id)
   {
-    return insert_dynamic(&m_case_expr_id_lst, (uchar*) &case_expr_id);
+    return insert_dynamic(&m_case_expr_id_lst, &case_expr_id);
   }
 
   inline void
@@ -342,7 +342,7 @@ public:
   inline void
   push_handler(sp_cond_type_t *cond)
   {
-    insert_dynamic(&m_handlers, (uchar*)&cond);
+    insert_dynamic(&m_handlers, &cond);
   }
 
   bool

=== modified file 'sql/sql_array.h'
--- a/sql/sql_array.h	2010-07-13 17:29:44 +0000
+++ b/sql/sql_array.h	2010-11-04 16:08:12 +0000
@@ -53,7 +53,7 @@ public:
 
   bool append(Elem &el)
   {
-    return (insert_dynamic(&array, (uchar*)&el));
+    return (insert_dynamic(&array, &el));
   }
 
   int elements()

=== modified file 'sql/sql_audit.cc'
--- a/sql/sql_audit.cc	2010-08-23 17:02:22 +0000
+++ b/sql/sql_audit.cc	2010-11-04 16:08:12 +0000
@@ -131,7 +131,7 @@ static my_bool acquire_plugins(THD *thd,
   
   /* lock the plugin and add it to the list */
   plugin= my_plugin_lock(NULL, &plugin);
-  insert_dynamic(&thd->audit_class_plugins, (uchar*) &plugin);
+  insert_dynamic(&thd->audit_class_plugins, &plugin);
 
   return 0;
 }

=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	2010-09-21 21:27:43 +0000
+++ b/sql/sql_plugin.cc	2010-11-04 16:08:12 +0000
@@ -374,7 +374,7 @@ static st_plugin_dl *plugin_dl_insert_or
       DBUG_RETURN(tmp);
     }
   }
-  if (insert_dynamic(&plugin_dl_array, (uchar*)&plugin_dl))
+  if (insert_dynamic(&plugin_dl_array, &plugin_dl))
     DBUG_RETURN(0);
   tmp= *dynamic_element(&plugin_dl_array, plugin_dl_array.elements - 1,
                         struct st_plugin_dl **)=
@@ -691,7 +691,7 @@ static plugin_ref intern_plugin_lock(LEX
                        (long) current_thd, pi->name.str, pi->ref_count));
 
     if (lex)
-      insert_dynamic(&lex->plugins, (uchar*)&plugin);
+      insert_dynamic(&lex->plugins, &plugin);
     DBUG_RETURN(plugin);
   }
   DBUG_RETURN(NULL);
@@ -738,7 +738,7 @@ static st_plugin_int *plugin_insert_or_r
       DBUG_RETURN(tmp);
     }
   }
-  if (insert_dynamic(&plugin_array, (uchar*)&plugin))
+  if (insert_dynamic(&plugin_array, &plugin))
     DBUG_RETURN(0);
   tmp= *dynamic_element(&plugin_array, plugin_array.elements - 1,
                         struct st_plugin_int **)=
@@ -1367,7 +1367,7 @@ static bool register_builtin(struct st_m
   tmp->ref_count= 0;
   tmp->plugin_dl= 0;
 
-  if (insert_dynamic(&plugin_array, (uchar*)&tmp))
+  if (insert_dynamic(&plugin_array, &tmp))
     DBUG_RETURN(1);
 
   *ptr= *dynamic_element(&plugin_array, plugin_array.elements - 1,
@@ -3465,7 +3465,7 @@ void add_plugin_options(DYNAMIC_ARRAY *o
     /* Only options with a non-NULL comment are displayed in help text */
     for (;opt->name; opt++)
       if (opt->comment)
-        insert_dynamic(options, (uchar*) opt);
+        insert_dynamic(options, opt);
   }
 }
 

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2010-10-21 13:30:19 +0000
+++ b/sql/sql_select.cc	2010-11-04 16:08:12 +0000
@@ -5874,7 +5874,7 @@ add_key_part(DYNAMIC_ARRAY *keyuse_array
           keyuse.null_rejecting= key_field->null_rejecting;
           keyuse.cond_guard=     key_field->cond_guard;
           keyuse.sj_pred_no=     key_field->sj_pred_no;
-          if (insert_dynamic(keyuse_array, (uchar*) &keyuse))
+          if (insert_dynamic(keyuse_array, &keyuse))
             return TRUE;
 	}
       }
@@ -5947,7 +5947,7 @@ add_ft_keys(DYNAMIC_ARRAY *keyuse_array,
   keyuse.optimize= 0;
   keyuse.keypart_map= 0;
   keyuse.sj_pred_no= UINT_MAX;
-  return insert_dynamic(keyuse_array,(uchar*) &keyuse);
+  return insert_dynamic(keyuse_array, &keyuse);
 }
 
 
@@ -6190,7 +6190,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_AR
 	  (qsort_cmp) sort_keyuse);
 
     bzero((char*) &key_end,sizeof(key_end));    /* Add for easy testing */
-    if (insert_dynamic(keyuse,(uchar*) &key_end))
+    if (insert_dynamic(keyuse, &key_end))
       return TRUE;
 
     use=save_pos=dynamic_element(keyuse,0,KEYUSE*);
@@ -6226,7 +6226,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_AR
       save_pos++;
     }
     i=(uint) (save_pos-(KEYUSE*) keyuse->buffer);
-    (void) set_dynamic(keyuse,(uchar*) &key_end,i);
+    (void) set_dynamic(keyuse, &key_end, i);
     keyuse->elements=i;
   }
   DBUG_EXECUTE("opt", print_keyuse_array(keyuse););

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2010-09-28 15:17:29 +0000
+++ b/sql/sql_show.cc	2010-11-04 16:08:12 +0000
@@ -2035,8 +2035,8 @@ int add_status_vars(SHOW_VAR *list)
     goto err;
   }
   while (list->name)
-    res|= insert_dynamic(&all_status_vars, (uchar*)list++);
-  res|= insert_dynamic(&all_status_vars, (uchar*)list); // appending NULL-element
+    res|= insert_dynamic(&all_status_vars, list++);
+  res|= insert_dynamic(&all_status_vars, list); // appending NULL-element
   all_status_vars.elements--; // but next insert_dynamic should overwite it
   if (status_vars_inited)
     sort_dynamic(&all_status_vars, show_var_cmp);

=== modified file 'sql/uniques.cc'
--- a/sql/uniques.cc	2010-07-08 21:42:23 +0000
+++ b/sql/uniques.cc	2010-11-04 16:08:12 +0000
@@ -332,7 +332,7 @@ bool Unique::flush()
 
   if (tree_walk(&tree, (tree_walk_action) unique_write_to_file,
 		(void*) this, left_root_right) ||
-      insert_dynamic(&file_ptrs, (uchar*) &file_ptr))
+      insert_dynamic(&file_ptrs, &file_ptr))
     return 1;
   delete_tree(&tree);
   return 0;

=== modified file 'storage/federated/ha_federated.cc'
--- a/storage/federated/ha_federated.cc	2010-07-23 20:17:55 +0000
+++ b/storage/federated/ha_federated.cc	2010-11-04 16:08:12 +0000
@@ -3280,7 +3280,7 @@ MYSQL_RES *ha_federated::store_result(MY
   DBUG_ENTER("ha_federated::store_result");
   if (result)
   {
-    (void) insert_dynamic(&results, (uchar*) &result);
+    (void) insert_dynamic(&results, &result);
   }
   position_called= FALSE;
   DBUG_RETURN(result);


Attachment: [text/bzr-bundle] bzr/guilhem@mysql.com-20101104160812-nchxbpn8li2mrnqu.bundle
Thread
bzr commit into mysql-next-mr-bugfixing branch (guilhem:3330) Guilhem Bichot4 Nov