summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_wireprotocol.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-03-02 10:58:35 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-03-02 10:59:34 +0100
commit3a867b982755501b514d19418086972a0cc693e7 (patch)
treeb659eff4fa0fb3029ceed0e78dc52f9cd20672db /ext/mysqlnd/mysqlnd_wireprotocol.c
parentc28751c69c9e2f923dd923fee5e1d4a3c970308a (diff)
downloadphp-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_wireprotocol.c')
-rw-r--r--ext/mysqlnd/mysqlnd_wireprotocol.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c
index 8cb94b6598..ed36c8404b 100644
--- a/ext/mysqlnd/mysqlnd_wireprotocol.c
+++ b/ext/mysqlnd/mysqlnd_wireprotocol.c
@@ -1600,7 +1600,8 @@ php_mysqlnd_rowp_read_text_protocol(MYSQLND_ROW_BUFFER * row_buffer, zval * fiel
} else if (Z_TYPE_P(current_field) == IS_STRING) {
/* nothing to do here, as we want a string and ps_fetch_from_1_to_8_bytes() has given us one */
}
- } else if (as_int_or_float && perm_bind.php_type == IS_LONG) {
+ } else if (as_int_or_float && perm_bind.php_type == IS_LONG
+ && !(fields_metadata[i].flags & ZEROFILL_FLAG)) {
zend_uchar save = *(p + len);
/* We have to make it ASCIIZ temporarily */
*(p + len) = '\0';