Skip to content

Commit

Permalink
fix failing main.mysql_client_test test on 32bit
Browse files Browse the repository at this point in the history
in `ulonglong=ulong*uint` multiplication
is done in ulong, wrapping around on 32bit.

This became visible after C/C changed the
default charset to utf8, thus changing
mbmaxlem from 1 to 3.
  • Loading branch information
vuvova committed May 15, 2018
1 parent 9d6ec6d commit 93efa48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/mysql_client_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ static void do_verify_prepare_field(MYSQL_RES *result,
{
MYSQL_FIELD *field;
CHARSET_INFO *cs;
ulonglong expected_field_length;
ulonglong expected_field_length= length;

if (!(field= mysql_fetch_field_direct(result, no)))
{
Expand All @@ -777,7 +777,7 @@ static void do_verify_prepare_field(MYSQL_RES *result,
}
cs= get_charset(field->charsetnr, 0);
DIE_UNLESS(cs);
if ((expected_field_length= length * cs->mbmaxlen) > UINT_MAX32)
if ((expected_field_length*= cs->mbmaxlen) > UINT_MAX32)
expected_field_length= UINT_MAX32;
if (!opt_silent)
{
Expand Down

0 comments on commit 93efa48

Please sign in to comment.