List:Commits« Previous MessageNext Message »
From:Sergei Golubchik Date:July 13 2007 3:10pm
Subject:Re: bk commit into 5.0 tree (antony:1.2492) BUG#10516
View as plain text  
Hi!

On Jun 20, antony@stripped wrote:
> ChangeSet@stripped, 2007-06-20 02:33:50-07:00, antony@stripped +2 -0
>   Bug#10516
>     "No error or warning message in getopt_ull_limit_value()"
>     Validation does not emit any error messages if values are out of
>     range.
>     Perform checks when updating system variables when in STRICT mode.
>   
>   Initial commit for review.

Code-wise ok.
Please recommit with a test case (for all affected classes, if
possible).

> --- 1.187/sql/set_var.cc	2007-06-05 14:04:33 -07:00
> +++ 1.188/sql/set_var.cc	2007-06-20 02:33:44 -07:00
> @@ -1445,19 +1445,26 @@
>  
>  bool sys_var_long_ptr_global::check(THD *thd, set_var *var)
>  {
> -  longlong v= var->value->val_int();
> -  var->save_result.ulonglong_value= v < 0 ? 0 : v;
> -  return 0;
> +  sys_var_global::check(thd, var);

I wish, C++ had some way of saying "SUPER::check(thd, var)" or
"super(thd, var)" like Perl or Ruby :(

> +  longlong v= (longlong) var->save_result.ulonglong_value;
> +  ulonglong tmp= v < 0 ? 0 : v;
> +
> +  if (option_limits)
> +    tmp= (ulong) getopt_ull_limit_value(tmp, option_limits);
> +  else
> +    tmp= (ulong) tmp;
> +
> +  bool result= (thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES |
> +                                           MODE_STRICT_ALL_TABLES)) &&
> +                tmp != var->save_result.ulonglong_value;
> +  var->save_result.ulonglong_value= tmp;
> +  return result;
>  }
>  
Regards / Mit vielen Grüssen,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Developer
/_/  /_/\_, /___/\___\_\___/  MySQL GmbH, Radlkoferstr. 2, D-81373 München
       <___/                  Geschäftsführer: Kaj Arnö - HRB
München 162140
Thread
bk commit into 5.0 tree (antony:1.2492) BUG#10516antony20 Jun
  • Re: bk commit into 5.0 tree (antony:1.2492) BUG#10516Sergei Golubchik13 Jul
    • Re: bk commit into 5.0 tree (antony:1.2492) BUG#10516Antony T Curtis13 Jul