List:Commits« Previous MessageNext Message »
From:Øystein Grøvlen Date:May 6 2009 1:47pm
Subject:Re: bzr commit into mysql-6.0 branch (bar:2701) WL#2649
View as plain text  
Alexander Barkov wrote:
> Hi  Øystein,
> 
> Alexander Barkov wrote:
> 
> <skip>
>>>  >
>>>  >
>>>  > @@ -324,7 +327,7 @@ public:
>>>  >    double val_real();
>>>  >    String *val_str(String*str);
>>>  >    enum Item_result result_type () const { return INT_RESULT; }
>>>  > -  void fix_length_and_dec() {}
>>>  > +  void fix_length_and_dec() { set_char_length_and_dec(21); }
>>>  >  };
>>>  >
>>>
>>> Why do you need to set this when it is set in the constructor of the
>>> parent class?
>>>
>>> By the way, lot's of fix_length_and_dec functions uses hard-coded
>>> constants.  Why not use the constructor instead?
>>
>> Thank for noticing this. This change is not needed. Removed.
> 
> Oops. Tests started to fail after reverting this change.
> Without this line, charset is not set to @@character_set_connection,
> so it returns BINARY(21) instead of VARCHAR(21).
> 
> We do need this call. But the methods names are really confusing.
> They also set charset/collation.
> 
> Hmm. Should I rename the methods to:
> 
> set_charset_and_char_length()
> 
> and
> 
> set_charset_and_char_length_and_dec()
> 
> ?
> 
> Sounds cumbersome :(

Just an idea: How about setting a default charset and length at 
construction time, and introduce a method set_charset() that will modify 
max_length accordingly if mbmaxlen for new charset is different from 
mbmaxlen for old charset?  I would then also remove the setting of 
charset from set_char_length, and rather call both set_charset() and 
set_char_length() when necessary.  Makes things a bit more explicit and 
easier to understand.

-- 
Øystein
Thread
bzr commit into mysql-6.0 branch (bar:2701) WL#2649Alexander Barkov4 Mar
  • Re: bzr commit into mysql-6.0 branch (bar:2701) WL#2649Øystein Grøvlen24 Apr
    • Re: bzr commit into mysql-6.0 branch (bar:2701) WL#2649Alexander Barkov29 Apr
      • Re: bzr commit into mysql-6.0 branch (bar:2701) WL#2649Øystein Grøvlen5 May
        • WL#2649Alexander Barkov19 Jun
          • Re: WL#2649Øystein Grøvlen25 Jun
            • Re: WL#2649Alexander Barkov25 Jun
              • Re: WL#2649Øystein Grøvlen25 Jun
                • Re: WL#2649Peter Gulutzan29 Jun
                  • Re: WL#2649Øystein Grøvlen1 Jul
                    • Re: WL#2649Peter Gulutzan2 Jul
                      • Re: WL#2649Øystein Grøvlen3 Jul
                        • Re: WL#2649Peter Gulutzan15 Jul
                        • Re: WL#2649Alexander Barkov20 Aug
                        • Re: WL#2649Alexander Barkov20 Aug
                          • Re: WL#2649Øystein Grøvlen21 Aug
    • Re: bzr commit into mysql-6.0 branch (bar:2701) WL#2649Alexander Barkov5 May
      • Re: bzr commit into mysql-6.0 branch (bar:2701) WL#2649Alexander Barkov5 May
        • Re: bzr commit into mysql-6.0 branch (bar:2701) WL#2649Øystein Grøvlen6 May
      • Re: bzr commit into mysql-6.0 branch (bar:2701) WL#2649Øystein Grøvlen6 May