Skip to content

Commit 3e051bc

Browse files
committed
Assume fetch_hash is always possible
The driver managers and even Db2 support this. This would also allow simplifying the fetch code to merge fetch_into and fetch_array into a single implementation perhaps.
1 parent 9286496 commit 3e051bc

File tree

4 files changed

+1
-15
lines changed

4 files changed

+1
-15
lines changed

ext/odbc/odbc.stub.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,9 @@ function odbc_exec(Odbc\Connection $odbc, string $query): Odbc\Result|false {}
344344
/** @alias odbc_exec */
345345
function odbc_do(Odbc\Connection $odbc, string $query): Odbc\Result|false {}
346346

347-
#ifdef PHP_ODBC_HAVE_FETCH_HASH
348347
function odbc_fetch_object(Odbc\Result $statement, ?int $row = null): stdClass|false {}
349348

350349
function odbc_fetch_array(Odbc\Result $statement, ?int $row = null): array|false {}
351-
#endif
352350

353351
/**
354352
* @param array $array

ext/odbc/odbc_arginfo.h

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/odbc/php_odbc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,6 @@ PHP_FUNCTION(odbc_exec)
13061306
}
13071307
/* }}} */
13081308

1309-
#ifdef PHP_ODBC_HAVE_FETCH_HASH
13101309
#define ODBC_NUM 1
13111310
#define ODBC_OBJECT 2
13121311

@@ -1458,7 +1457,6 @@ PHP_FUNCTION(odbc_fetch_array)
14581457
php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAM_PASSTHRU, ODBC_OBJECT);
14591458
}
14601459
/* }}} */
1461-
#endif
14621460

14631461
/* {{{ Fetch one result row into an array */
14641462
PHP_FUNCTION(odbc_fetch_into)

ext/odbc/php_odbc.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ extern zend_module_entry odbc_module_entry;
3131
#include "php_version.h"
3232
#define PHP_ODBC_VERSION PHP_VERSION
3333

34-
#if defined(PHP_WIN32) || defined(HAVE_IBMDB2) || defined(HAVE_UNIXODBC) || defined(HAVE_IODBC)
35-
# define PHP_ODBC_HAVE_FETCH_HASH 1
36-
#endif
37-
3834
/* user functions */
3935
PHP_MINIT_FUNCTION(odbc);
4036
PHP_MSHUTDOWN_FUNCTION(odbc);

0 commit comments

Comments
 (0)