List:Commits« Previous MessageNext Message »
From:Sergei Golubchik Date:November 27 2009 8:08am
Subject:Re: bzr commit into mysql-5.0-bugteam branch (satya.bn:2849)
Bug#37408
View as plain text  
Hi, Satya!

On Nov 25, Satya B wrote:
>  2849 Satya B	2009-11-25
>       Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
>                         
> === modified file 'myisam/mi_packrec.c'
> --- a/myisam/mi_packrec.c	2009-08-28 15:51:31 +0000
> +++ b/myisam/mi_packrec.c	2009-11-25 12:46:32 +0000
> @@ -1504,7 +1504,8 @@ my_bool _mi_memmap_file(MI_INFO *info)
>    if (!share->file_map)
>    {
>      my_off_t data_file_length= share->state.state.data_file_length;
> -    if (data_file_length > (my_off_t) (~((size_t) 0)) - MEMMAP_EXTRA_MARGIN)
> +    if ((data_file_length + myisam_mmap_used + MEMMAP_EXTRA_MARGIN) > 

eh, you access a shared variable without a mutex ?

> +         myisam_mmap_size)
>      {
>        DBUG_PRINT("warning", ("File is too large for mmap"));
>        DBUG_RETURN(0);
> === modified file 'sql/set_var.h'
> --- a/sql/set_var.h	2009-06-19 09:27:19 +0000
> +++ b/sql/set_var.h	2009-11-25 12:46:32 +0000
> @@ -148,6 +148,22 @@ public:
>    { return (byte*) value; }
>  };
>  
> +class sys_var_ulonglong_const_ptr :public sys_var
> +{
> +public:
> +  ulonglong *value;
> +  sys_var_ulonglong_const_ptr(const char *name_arg, ulonglong *value_ptr_arg)
> +    :sys_var(name_arg),value(value_ptr_arg) {}
> +  sys_var_ulonglong_const_ptr(const char *name_arg, ulonglong *value_ptr_arg,
> +		              sys_after_update_func func)
> +    :sys_var(name_arg,func), value(value_ptr_arg) {}
> +  bool update(THD *thd, set_var *var) { return 1; }
> +  void set_default(THD *thd, enum_var_type type) {};
> +  SHOW_TYPE show_type() { return SHOW_LONGLONG; }
> +  byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
> +  { return (byte*) value; }
> +  bool is_readonly() const { return 1; }
> +};

You don't need a new class, use sys_var_readonly.

Regards / Mit vielen Grüßen,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Engineer/Server Architect
/_/  /_/\_, /___/\___\_\___/  Sun Microsystems GmbH, HRB München 161028
       <___/                  Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring
Thread
bzr commit into mysql-5.0-bugteam branch (satya.bn:2849) Bug#37408Satya B25 Nov
  • Re: bzr commit into mysql-5.0-bugteam branch (satya.bn:2849)Bug#37408Sergei Golubchik27 Nov