Skip to content

Commit 6004702

Browse files
NattyNarwhalcmb69
andauthored
Remove references to ODBCVER and assume ODBC 3.x (#19453)
* Remove references to ODBCVER and assume ODBC 3.x See https://wiki.php.net/rfc/deprecations_php_8_5#remove_support_for_older_odbc_versions * Avoid calling deprecated ODBC functions `SQLGetConnectOption`, `SQLSetConnectOption` and `SQLSetStmtOption` are deprecated, so if ODBC 3 is available, we use `SQLSetConnectAttr`, `SQLGetConnectAttr`, and `SQLSetStmtAttr` instead. (This is based on GH-17556, but just assumes ODBC 3.x.) * Remove wrappers for SQLColAttribute We don't need to support the old way of doing it. * Just call SQLAllocHandle directly Again, no need for the version specific wrapper * Update NEWS for ODBCVER in beta2 * [skip ci] UPGRADING for ODBCVER changes --------- Co-authored-by: Christoph M. Becker <[email protected]>
1 parent 77dace7 commit 6004702

File tree

8 files changed

+35
-92
lines changed

8 files changed

+35
-92
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.5.0beta2
44

5+
- ODBC:
6+
. Remove ODBCVER and assume ODBC 3.5. (Calvin Buckley)
7+
58
- OpenSSL:
69
. Implement #81724 (openssl_cms_encrypt only allows specific ciphers).
710
(Jakub Zelenka)

UPGRADING

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ PHP 8.5 UPGRADE NOTES
8080
. Calling the mysqli constructor on an already-constructed object
8181
is now no longer possible and throws an Error.
8282

83+
- ODBC:
84+
. ODBC now assumes that at least ODBC 3.5 functionality is available. The
85+
ODBCVER definition and build system flags to control it have been removed.
86+
8387
- Opcache:
8488
. The Opcache extension is now always built into the PHP binary and is always
8589
loaded. The INI directives opcache.enable and opcache.enable_cli are still

ext/odbc/config.m4

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,6 @@ dnl
106106
dnl configure options
107107
dnl
108108

109-
PHP_ARG_WITH([odbcver],,
110-
[AS_HELP_STRING([[--with-odbcver[=HEX]]],
111-
[Force support for the passed ODBC version. A hex number is expected,
112-
default 0x0350. Use the special value of 0 to prevent an explicit ODBCVER to
113-
be defined.])],
114-
[0x0350])
115-
116109
AS_VAR_IF([ODBC_TYPE],, [
117110
PHP_ARG_WITH([adabas],
118111
[for Adabas support],
@@ -410,12 +403,6 @@ PHP_ARG_WITH([dbmaker],
410403
])
411404
])
412405

413-
AH_TEMPLATE([ODBCVER], [The highest supported ODBC version.])
414-
AS_VAR_IF([PHP_ODBCVER], [no],
415-
[AC_DEFINE([ODBCVER], [0x0350])],
416-
[AS_VAR_IF([PHP_ODBCVER], [0],,
417-
[AC_DEFINE_UNQUOTED([ODBCVER], [$PHP_ODBCVER])])])
418-
419406
dnl Extension setup
420407
if test -n "$ODBC_TYPE"; then
421408
AS_VAR_IF([ODBC_TYPE], [dbmaker],, [

ext/odbc/config.w32

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// vim:ft=javascript
22

33
ARG_ENABLE("odbc", "ODBC support", "no");
4-
ARG_WITH("odbcver", "Force support for the passed ODBC version. A hex number is expected, default 0x0350. Use the special value of 0 to prevent an explicit ODBCVER to be defined.", "0x0350");
54

65
if (PHP_ODBC == "yes") {
76
if (CHECK_LIB("odbc32.lib", "odbc") && CHECK_LIB("odbccp32.lib", "odbc")
@@ -10,11 +9,6 @@ if (PHP_ODBC == "yes") {
109
EXTENSION("odbc", "php_odbc.c odbc_utils.c", PHP_ODBC_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
1110
AC_DEFINE("HAVE_UODBC", 1, "Define to 1 if the PHP extension 'odbc' is available.");
1211
AC_DEFINE("HAVE_SQLDATASOURCES", 1, "Define to 1 if ODBC library has 'SQLDataSources', as a function or macro.");
13-
if ("no" == PHP_ODBCVER) {
14-
AC_DEFINE("ODBCVER", "0x0350", "The highest supported ODBC version.", false);
15-
} else if ("0" != PHP_ODBCVER) {
16-
AC_DEFINE("ODBCVER", PHP_ODBCVER, "The highest supported ODBC version.", false);
17-
}
1812
} else {
1913
WARNING("odbc support can't be enabled, libraries or header are missing (SDK)")
2014
PHP_ODBC = "no"

ext/odbc/odbc.stub.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,6 @@ class Result
233233
* @cvalue SQL_TIMESTAMP
234234
*/
235235
const SQL_TIMESTAMP = UNKNOWN;
236-
237-
#if (defined(ODBCVER) && (ODBCVER >= 0x0300))
238236
/**
239237
* @var int
240238
* @cvalue SQL_TYPE_DATE
@@ -327,8 +325,6 @@ class Result
327325
*/
328326
const SQL_QUICK = UNKNOWN;
329327

330-
#endif
331-
332328
function odbc_close_all(): void {}
333329

334330
function odbc_binmode(Odbc\Result $statement, int $mode): true {}

ext/odbc/odbc_arginfo.h

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

0 commit comments

Comments
 (0)