List:Commits« Previous MessageNext Message »
From:Chuck Bell Date:December 8 2008 8:38pm
Subject:Re: bzr commit into mysql-6.0-backup branch (ingo.struewing:2737)
Bug#39749,Bug#40808
View as plain text  
STATUS
------
Patch approved pending fix of warning.

REQUESTS
--------
1. There is a compiler warning on Windows. Please fix this.

COMMENTARY
----------
2. I am not seeing your commit emails. I have discovered the problem (on
my end -- my email has been hosed) and have fixed it. So next time it
should be OK.

DETAILS
-------
>  2737 Ingo Struewing	2008-12-05
>       Bug#39749 - main.backup_timeout fails sporadically on OS X
>       Bug#40808 - The backup_wait_timeout variable is not working
>                 on powermac platform
>       
>       backup_timeout.test failed on POWER processors. Due to word ordering
>       within a long long variable, the code was not portable between
>       different processor types.
>       
>       Fixed by reworking the implementation of sys_var_backup_wait_timeout.
>       
>       Re-enabled backup_timeout.test.
>       
>       Included are unrelated fixes to get rid of compiler warnings.

...

> === modified file 'sql/set_var.cc'
> --- a/sql/set_var.cc	2008-11-13 09:46:39 +0000
> +++ b/sql/set_var.cc	2008-12-05 21:38:28 +0000


...

>  bool sys_var_backup_wait_timeout::update(THD *thd, set_var *var)
>  {
> -  if (var->save_result.ulong_value > (LONG_MAX/1000))
> -    thd->backup_wait_timeout= LONG_MAX/1000;
> +  /*
> +    The default sys_var::check() method sets ulonglong_value.
> +    This can corrupt other values on some platforms.
> +    Since we don't redefine check() for backup_wait_timeout,
> +    we need to use ulonglong_value. Since we assign to an ulong
> +    variable, we better check the value and limit it.
> +  */
> +  if (var->save_result.ulonglong_value > ULONG_MAX)
> +    thd->backup_wait_timeout= ULONG_MAX;
>    else
> -    thd->backup_wait_timeout= var->save_result.ulong_value;
> +    thd->backup_wait_timeout= var->save_result.ulonglong_value;
>    return 0;
>  }

[1] This line gives a compile warning on Windows:

\set_var.cc(3073) : warning C4244: '=' : conversion from 'ulonglong' to 
'ulong', possible loss of data

...

Chuck
Thread
Re: bzr commit into mysql-6.0-backup branch (ingo.struewing:2737)Bug#39749,Bug#40808Ingo Strüwing5 Dec
  • Re: bzr commit into mysql-6.0-backup branch (ingo.struewing:2737)Bug#39749,Bug#40808Chuck Bell8 Dec
re: bzr commit into mysql-6.0-backup branch (ingo.struewing:2737)Bug#39749,Bug#40808Chuck Bell5 Dec