Skip to content

Commit b87e43d

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #80152: odbc_execute() moves internal pointer of $params
2 parents 3928b6b + bf5f07c commit b87e43d

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ PHP NEWS
1919
. Fixed bug #80147 (BINARY strings may not be properly zero-terminated).
2020
(cmb)
2121
. Fixed bug #80150 (Failure to fetch error message). (cmb)
22+
. Fixed bug #80152 (odbc_execute() moves internal pointer of $params). (cmb)
2223

2324
- OPcache:
2425
. Fixed bug #80083 (Optimizer pass 6 removes variables used for ibm_db2 data

ext/odbc/php_odbc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,7 @@ PHP_FUNCTION(odbc_execute)
13091309
int numArgs = ZEND_NUM_ARGS(), i, ne;
13101310
RETCODE rc;
13111311

1312-
if (zend_parse_parameters(numArgs, "r|a", &pv_res, &pv_param_arr) == FAILURE) {
1312+
if (zend_parse_parameters(numArgs, "r|a/", &pv_res, &pv_param_arr) == FAILURE) {
13131313
return;
13141314
}
13151315

ext/odbc/tests/bug80152.phpt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--TEST--
2+
Bug #80152 (odbc_execute() moves internal pointer of $params)
3+
--SKIPIF--
4+
<?php include 'skipif.inc'; ?>
5+
--FILE--
6+
<?php
7+
include 'config.inc';
8+
9+
$conn = odbc_connect($dsn, $user, $pass);
10+
odbc_exec($conn,"CREATE TABLE bug80152 (id INT, name CHAR(24))");
11+
$stmt = odbc_prepare($conn,"INSERT INTO bug80152 (id, name) VALUES (?, ?)");
12+
$params = [1, "John", "Lim"];
13+
var_dump(key($params));
14+
odbc_execute($stmt, $params);
15+
var_dump(key($params));
16+
?>
17+
--CLEAN--
18+
<?php
19+
include 'config.inc';
20+
21+
$conn = odbc_connect($dsn, $user, $pass);
22+
odbc_exec($conn, "DROP TABLE bug80152");
23+
?>
24+
--EXPECT--
25+
int(0)
26+
int(0)

0 commit comments

Comments
 (0)