Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Fix #46050: odbc_next_result corrupts prepared resource
This commit is contained in:
Christoph M. Becker 2020-10-05 17:48:44 +02:00
commit 9fe5479eeb
2 changed files with 28 additions and 0 deletions

View File

@ -2373,6 +2373,7 @@ PHP_FUNCTION(odbc_next_result)
}
efree(result->values);
result->values = NULL;
result->numcols = 0;
}
result->fetched = 0;

View File

@ -0,0 +1,27 @@
--TEST--
Bug #46050 (odbc_next_result corrupts prepared resource)
--SKIPIF--
<?php include 'skipif.inc'; ?>
--FILE--
<?php
include __DIR__ . "/config.inc";
$conn = odbc_connect($dsn, $user, $pass);
$stmt = odbc_prepare($conn, "SELECT 1");
var_dump(odbc_execute($stmt));
var_dump(odbc_fetch_array($stmt));
var_dump(odbc_next_result($stmt));
var_dump(odbc_execute($stmt));
var_dump(odbc_fetch_array($stmt));
?>
--EXPECT--
bool(true)
array(1) {
["1"]=>
string(1) "1"
}
bool(false)
bool(true)
array(1) {
["1"]=>
string(1) "1"
}