Skip to content

Commit a0051be

Browse files
committed
Merge branch 'PHP-7.4' into master
* PHP-7.4: Fix #80152: odbc_execute() moves internal pointer of $params
2 parents 47a166c + b87e43d commit a0051be

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

ext/odbc/php_odbc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ PHP_FUNCTION(odbc_execute)
977977
int i, ne;
978978
RETCODE rc;
979979

980-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|h", &pv_res, &pv_param_ht) == FAILURE) {
980+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|h/", &pv_res, &pv_param_ht) == FAILURE) {
981981
RETURN_THROWS();
982982
}
983983

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)