Skip to content

Commit 26811b2

Browse files
committed
Address review comments
1 parent 69d1388 commit 26811b2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

UPGRADING

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ PHP 8.0 UPGRADE NOTES
391391
. Several alias functions have been marked as deprecated.
392392
. oci_internal_debug() and its alias ociinternaldebug() have been removed.
393393

394+
- ODBC:
395+
. The unused flags parameter of odbc_exec() has been removed.
396+
394397
- OpenSSL:
395398
. openssl_x509_read() and openssl_csr_sign() will now return an
396399
OpenSSLCertificate object rather than a resource. Return value checks using

ext/odbc/php_odbc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ PHP_FUNCTION(odbc_prepare)
964964
PHP_FUNCTION(odbc_execute)
965965
{
966966
zval *pv_res, *tmp;
967-
HashTable *pv_param_ht = NULL;
967+
HashTable *pv_param_ht = (HashTable *) &zend_empty_array;
968968
typedef struct params_t {
969969
SQLLEN vallen;
970970
int fp;
@@ -974,7 +974,7 @@ PHP_FUNCTION(odbc_execute)
974974
unsigned char otype;
975975
SQLSMALLINT ctype;
976976
odbc_result *result;
977-
int i, ne = 0;
977+
int i, ne;
978978
RETCODE rc;
979979

980980
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|h", &pv_res, &pv_param_ht) == FAILURE) {
@@ -986,7 +986,7 @@ PHP_FUNCTION(odbc_execute)
986986
}
987987

988988
if (result->numparams > 0) {
989-
if (!pv_param_ht || (ne = zend_hash_num_elements(pv_param_ht)) < result->numparams) {
989+
if ((ne = zend_hash_num_elements(pv_param_ht)) < result->numparams) {
990990
php_error_docref(NULL, E_WARNING, "Not enough parameters (%d should be %d) given", ne, result->numparams);
991991
RETURN_FALSE;
992992
}

0 commit comments

Comments
 (0)