diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-03-02 10:58:35 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-03-02 10:59:34 +0100 |
commit | 3a867b982755501b514d19418086972a0cc693e7 (patch) | |
tree | b659eff4fa0fb3029ceed0e78dc52f9cd20672db /ext/mysqlnd/mysqlnd_ps_codec.c | |
parent | c28751c69c9e2f923dd923fee5e1d4a3c970308a (diff) | |
download | php-git-3a867b982755501b514d19418086972a0cc693e7.tar.gz |
Fixed bug #80808
If the ZEROFILL flag is set for a field, do not convert it into
an integer (text protocol) or convert it explicitly into a padded
string (binary protocol).
Diffstat (limited to 'ext/mysqlnd/mysqlnd_ps_codec.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd_ps_codec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c index e695d6ba79..eba4805b9d 100644 --- a/ext/mysqlnd/mysqlnd_ps_codec.c +++ b/ext/mysqlnd/mysqlnd_ps_codec.c @@ -74,6 +74,11 @@ ps_fetch_from_1_to_8_bytes(zval * zv, const MYSQLND_FIELD * const field, const u case 1:uval = (uint64_t) uint1korr(*row);break; } + if (field->flags & ZEROFILL_FLAG) { + DBG_INF("stringify due to zerofill"); + tmp_len = sprintf((char *)&tmp, "%0*" PRIu64, (int) field->length, uval); + DBG_INF_FMT("value=%s", tmp); + } else #if SIZEOF_ZEND_LONG==4 if (uval > INT_MAX) { DBG_INF("stringify"); |