From: Marko Mäkelä Date: October 21 2010 6:54am Subject: Re: bzr commit into mysql-5.5-innodb branch (marko.makela:3192) Bug#57588 List-Archive: http://lists.mysql.com/commits/121441 Message-Id: <20101021065429.GA2554@x60s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed On Thu, Oct 21, 2010 at 08:25:00AM +1100, Sunny Bains wrote: >> /* Get mbmaxlen from mbminmaxlen. */ >> -#define DATA_MBMAXLEN(mbminmaxlen) ((mbminmaxlen) / DATA_MBMAX) >> +#define DATA_MBMAXLEN(mbminmaxlen) ((ulint) ((mbminmaxlen) / DATA_MBMAX)) > >This cast was dropped in the final version to catch type mismatch >between the two macros. If someone changes the type of the underlying >variables after your fix we will not catch the mismatch. Unless the >original fix didn't solve the problem this change should be reverted. The original fix was causing a warning in handler0alter.cc: ut_ad(DATA_MBMAXLEN(col->mbminmaxlen) >= DATA_MBMINLEN(col->mbminmaxlen)); ut_ad(DATA_MBMAXLEN(col->mbminmaxlen) > DATA_MBMINLEN(col->mbminmaxlen) || flen == len); This is because DATA_MBMAXLEN would have returned unsigned and DATA_MBMINLEN (after the cast that you added) would have returned ulint: unsigned mbminmaxlen:5; /*!< minimum and maximum length of a character, in bytes; DATA_MBMINMAXLEN(mbminlen,mbmaxlen); mbminlen=DATA_MBMINLEN(mbminmaxlen); mbmaxlen=DATA_MBMINLEN(mbminmaxlen) */ Best regards, Marko