diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-02-01 21:55:30 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-02-02 10:09:44 +0100 |
commit | d4df7bc9b1fbdfb5c98134091a9ff998af60954f (patch) | |
tree | dfd2f5128ccf94b6e86d2475aee23acf53fa868c /storage/connect/myconn.cpp | |
parent | 80d3eee072025f34984e474ea160651eac9e11e5 (diff) | |
parent | 96cb428b350ba48ee17ad9968d08f5318e48258c (diff) | |
download | mariadb-git-d4df7bc9b1fbdfb5c98134091a9ff998af60954f.tar.gz |
Merge branch 'github/10.0' into 10.1
Diffstat (limited to 'storage/connect/myconn.cpp')
-rw-r--r-- | storage/connect/myconn.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/storage/connect/myconn.cpp b/storage/connect/myconn.cpp index 08bb24e14df..fe00f6a1eab 100644 --- a/storage/connect/myconn.cpp +++ b/storage/connect/myconn.cpp @@ -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, |