Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #80152: odbc_execute() moves internal pointer of $params
This commit is contained in:
Christoph M. Becker 2020-09-29 11:35:28 +02:00
commit b87e43d931
3 changed files with 28 additions and 1 deletions

1
NEWS
View File

@ -19,6 +19,7 @@ PHP NEWS
. Fixed bug #80147 (BINARY strings may not be properly zero-terminated).
(cmb)
. Fixed bug #80150 (Failure to fetch error message). (cmb)
. Fixed bug #80152 (odbc_execute() moves internal pointer of $params). (cmb)
- OPcache:
. Fixed bug #80083 (Optimizer pass 6 removes variables used for ibm_db2 data

View File

@ -1309,7 +1309,7 @@ PHP_FUNCTION(odbc_execute)
int numArgs = ZEND_NUM_ARGS(), i, ne;
RETCODE rc;
if (zend_parse_parameters(numArgs, "r|a", &pv_res, &pv_param_arr) == FAILURE) {
if (zend_parse_parameters(numArgs, "r|a/", &pv_res, &pv_param_arr) == FAILURE) {
return;
}

View File

@ -0,0 +1,26 @@
--TEST--
Bug #80152 (odbc_execute() moves internal pointer of $params)
--SKIPIF--
<?php include 'skipif.inc'; ?>
--FILE--
<?php
include 'config.inc';
$conn = odbc_connect($dsn, $user, $pass);
odbc_exec($conn,"CREATE TABLE bug80152 (id INT, name CHAR(24))");
$stmt = odbc_prepare($conn,"INSERT INTO bug80152 (id, name) VALUES (?, ?)");
$params = [1, "John", "Lim"];
var_dump(key($params));
odbc_execute($stmt, $params);
var_dump(key($params));
?>
--CLEAN--
<?php
include 'config.inc';
$conn = odbc_connect($dsn, $user, $pass);
odbc_exec($conn, "DROP TABLE bug80152");
?>
--EXPECT--
int(0)
int(0)