Skip to content

Commit 2b4bc89

Browse files
committed
1 parent c5f79b8 commit 2b4bc89

File tree

6 files changed

+2
-64
lines changed

6 files changed

+2
-64
lines changed

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 & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
// vim:ft=javascript
22

3-
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");
5-
63
if (PHP_ODBC == "yes") {
74
if (CHECK_LIB("odbc32.lib", "odbc") && CHECK_LIB("odbccp32.lib", "odbc")
85
&& CHECK_HEADER_ADD_INCLUDE("sql.h", "CFLAGS_ODBC")
96
&& CHECK_HEADER_ADD_INCLUDE("sqlext.h", "CFLAGS_ODBC")) {
107
EXTENSION("odbc", "php_odbc.c odbc_utils.c", PHP_ODBC_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
118
AC_DEFINE("HAVE_UODBC", 1, "Define to 1 if the PHP extension 'odbc' is available.");
129
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-
}
1810
} else {
1911
WARNING("odbc support can't be enabled, libraries or header are missing (SDK)")
2012
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.

ext/odbc/php_odbc.c

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -579,10 +579,6 @@ PHP_MINFO_FUNCTION(odbc)
579579
snprintf(buf, sizeof(buf), ZEND_LONG_FMT, ODBCG(num_links));
580580
php_info_print_table_row(2, "Active Links", buf);
581581
php_info_print_table_row(2, "ODBC library", PHP_ODBC_TYPE);
582-
#ifdef ODBCVER
583-
snprintf(buf, sizeof(buf), "0x%.4x", ODBCVER);
584-
php_info_print_table_row(2, "ODBCVER", buf);
585-
#endif
586582
#ifndef PHP_WIN32
587583
php_info_print_table_row(2, "ODBC_CFLAGS", PHP_ODBC_CFLAGS);
588584
php_info_print_table_row(2, "ODBC_LFLAGS", PHP_ODBC_LFLAGS);
@@ -695,9 +691,7 @@ void odbc_bindcols(odbc_result *result)
695691
case SQL_VARBINARY:
696692
case SQL_LONGVARBINARY:
697693
case SQL_LONGVARCHAR:
698-
#if defined(ODBCVER) && (ODBCVER >= 0x0300)
699694
case SQL_WLONGVARCHAR:
700-
#endif
701695
result->values[i].value = NULL;
702696
break;
703697

@@ -710,13 +704,9 @@ void odbc_bindcols(odbc_result *result)
710704
#endif /* HAVE_ADABAS */
711705
case SQL_CHAR:
712706
case SQL_VARCHAR:
713-
#if defined(ODBCVER) && (ODBCVER >= 0x0300)
714707
case SQL_WCHAR:
715708
case SQL_WVARCHAR:
716709
colfieldid = SQL_DESC_OCTET_LENGTH;
717-
#else
718-
char_extra_alloc = true;
719-
#endif
720710
/* TODO: Check this is the intended behaviour */
721711
ZEND_FALLTHROUGH;
722712
default:
@@ -725,7 +715,6 @@ void odbc_bindcols(odbc_result *result)
725715
if (rc != SQL_SUCCESS) {
726716
displaysize = 0;
727717
}
728-
#if defined(ODBCVER) && (ODBCVER >= 0x0300)
729718
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO && colfieldid == SQL_DESC_OCTET_LENGTH) {
730719
SQLINTEGER err;
731720
SQLCHAR errtxt[128];
@@ -755,7 +744,6 @@ void odbc_bindcols(odbc_result *result)
755744
result->values[i].value = NULL;
756745
break;
757746
}
758-
#endif
759747
/* Workaround for drivers that report VARCHAR(MAX) columns as SQL_VARCHAR (bug #73725) */
760748
if (SQL_VARCHAR == result->values[i].coltype && displaysize == 0) {
761749
result->values[i].coltype = SQL_LONGVARCHAR;
@@ -1444,9 +1432,7 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
14441432
}
14451433
ZEND_FALLTHROUGH;
14461434
case SQL_LONGVARCHAR:
1447-
#if defined(ODBCVER) && (ODBCVER >= 0x0300)
14481435
case SQL_WLONGVARCHAR:
1449-
#endif
14501436
if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) {
14511437
ZVAL_EMPTY_STRING(&tmp);
14521438
break;
@@ -1614,9 +1600,7 @@ PHP_FUNCTION(odbc_fetch_into)
16141600
/* TODO: Check this is the intended behaviour */
16151601
ZEND_FALLTHROUGH;
16161602
case SQL_LONGVARCHAR:
1617-
#if defined(ODBCVER) && (ODBCVER >= 0x0300)
16181603
case SQL_WLONGVARCHAR:
1619-
#endif
16201604
if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0) {
16211605
ZVAL_EMPTY_STRING(&tmp);
16221606
break;
@@ -1838,9 +1822,7 @@ PHP_FUNCTION(odbc_result)
18381822
ZEND_FALLTHROUGH;
18391823

18401824
case SQL_LONGVARCHAR:
1841-
#if defined(ODBCVER) && (ODBCVER >= 0x0300)
18421825
case SQL_WLONGVARCHAR:
1843-
#endif
18441826
if (IS_SQL_LONG(result->values[field_ind].coltype)) {
18451827
if (result->longreadlen <= 0) {
18461828
break;
@@ -1884,10 +1866,7 @@ PHP_FUNCTION(odbc_result)
18841866
/* Reduce fieldlen by 1 if we have char data. One day we might
18851867
have binary strings... */
18861868
if ((result->values[field_ind].coltype == SQL_LONGVARCHAR)
1887-
#if defined(ODBCVER) && (ODBCVER >= 0x0300)
1888-
|| (result->values[field_ind].coltype == SQL_WLONGVARCHAR)
1889-
#endif
1890-
) {
1869+
|| (result->values[field_ind].coltype == SQL_WLONGVARCHAR)) {
18911870
fieldsize -= 1;
18921871
}
18931872
/* Don't duplicate result, saves one emalloc.
@@ -2023,9 +2002,7 @@ PHP_FUNCTION(odbc_result_all)
20232002
/* TODO: Check this is the intended behaviour */
20242003
ZEND_FALLTHROUGH;
20252004
case SQL_LONGVARCHAR:
2026-
#if defined(ODBCVER) && (ODBCVER >= 0x0300)
20272005
case SQL_WLONGVARCHAR:
2028-
#endif
20292006
if (IS_SQL_LONG(result->values[i].coltype) &&
20302007
result->longreadlen <= 0) {
20312008
php_printf("<td>Not printable</td>");

ext/odbc/php_odbc_includes.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@
102102
#endif
103103

104104
#define ODBC_TYPE "unixODBC"
105-
#undef ODBCVER
106105
#include <sql.h>
107106
#include <sqlext.h>
108107
#define HAVE_SQL_EXTENDED_FETCH 1
@@ -132,8 +131,6 @@
132131
#elif defined(HAVE_DBMAKER) /* DBMaker */
133132

134133
#define ODBC_TYPE "DBMaker"
135-
#undef ODBCVER
136-
#define ODBCVER 0x0300
137134
#define HAVE_SQL_EXTENDED_FETCH 1
138135
#include <odbc.h>
139136

@@ -265,21 +262,12 @@ void odbc_bindcols(odbc_result *result);
265262

266263
void odbc_sql_error(ODBC_SQL_ERROR_PARAMS);
267264

268-
#if defined(ODBCVER) && (ODBCVER >= 0x0300)
269265
#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR || x == SQL_WLONGVARCHAR)
270266

271267
#define PHP_ODBC_SQLCOLATTRIBUTE SQLColAttribute
272268
#define PHP_ODBC_SQLALLOCSTMT(hdbc, phstmt) SQLAllocHandle(SQL_HANDLE_STMT, hdbc, phstmt)
273269

274270
#define PHP_ODBC_SQL_DESC_NAME SQL_DESC_NAME
275-
#else
276-
#define IS_SQL_LONG(x) (x == SQL_LONGVARBINARY || x == SQL_LONGVARCHAR)
277-
278-
#define PHP_ODBC_SQLCOLATTRIBUTE SQLColAttributes
279-
#define PHP_ODBC_SQLALLOCSTMT SQLAllocStmt
280-
281-
#define PHP_ODBC_SQL_DESC_NAME SQL_COLUMN_NAME
282-
#endif
283271
#define IS_SQL_BINARY(x) (x == SQL_BINARY || x == SQL_VARBINARY || x == SQL_LONGVARBINARY)
284272

285273
PHP_ODBC_API ZEND_EXTERN_MODULE_GLOBALS(odbc)

0 commit comments

Comments
 (0)