On Fri, 2007-07-13 at 15:10 +0200, Sergei Golubchik wrote:
> 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).
Ok,
> > --- 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 :(
Me too.... But C++'s need to support multiple inheritance has caused
many deficiencies in the language.
> > + 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
>
--
Antony T Curtis, Senior Software Developer
MySQL Inc, www.mysql.com
SIP: 4468@stripped