Skip to content
Permalink
Browse files
MDEV-13988 connect.drop-open-error fails
PCOLRES::Length is the length in characters, not in bytes
(because it's printed as length in "VARCHAR(N)").
So convert it into characters using cs->mbmaxlen.
  • Loading branch information
vuvova committed Jan 22, 2018
1 parent 4316072 commit ea78c57
Showing 1 changed file with 3 additions and 2 deletions.
@@ -933,8 +933,9 @@ PQRYRES MYSQLC::GetResult(PGLOBAL g, bool pdb)

crp->Prec = (crp->Type == TYPE_DOUBLE || crp->Type == TYPE_DECIM)
? fld->decimals : 0;
crp->Length = MY_MAX(fld->length, fld->max_length);
crp->Clen = GetTypeSize(crp->Type, crp->Length);
CHARSET_INFO *cs= get_charset(fld->charsetnr, MYF(0));
crp->Clen = GetTypeSize(crp->Type, fld->length);
crp->Length = fld->length / (cs ? cs->mbmaxlen : 1);
uns = (fld->flags & (UNSIGNED_FLAG | ZEROFILL_FLAG)) ? true : false;

if (!(crp->Kdata = AllocValBlock(g, NULL, crp->Type, m_Rows,

0 comments on commit ea78c57

Please sign in to comment.