Skip to content

Commit a41aa46

Browse files
committed
Fixed bug #68964 Allowed memory size exhausted with odbc_exec
This is done in two steps: - the ODBCVER has to be rased to 0x0300 which corresponds to Sql Server 9, otherwise the client will not recognize several SQL datatypes - additionally the config scripts was tweaked so then ODBCVER can be overridden, that still allows enabling compatibility with lower versions Bug #67437 might be fixed by this as well.
1 parent 9ef0c39 commit a41aa46

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

ext/odbc/config.m4

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,19 @@ PHP_ARG_WITH(dbmaker,,
490490
fi
491491
fi
492492

493+
PHP_ARG_WITH(odbcver,,
494+
[ --with-odbcver[=HEX] Force support for the passed ODBC version. A hex number is expected, default 0x0300.
495+
Use the special value of 0 to prevent an explicit ODBCVER to be defined. ], 0x0300)
496+
497+
if test "no" != "$PHP_ODBCVER"; then
498+
if test "$PHP_ODBCVER" != "0"; then
499+
AC_DEFINE_UNQUOTED(ODBCVER, $PHP_ODBCVER, [ The highest supported ODBC version ])
500+
fi
501+
else
502+
AC_DEFINE(ODBCVER, 0x300, [ The highest supported ODBC version ])
503+
fi
504+
505+
493506
dnl
494507
dnl Extension setup
495508
dnl

ext/odbc/config.w32

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@
22
// vim:ft=javascript
33

44
ARG_ENABLE("odbc", "ODBC support", "yes");
5+
ARG_WITH("odbcver", "Force support for the passed ODBC version. A hex number is expected, default 0x0300. Use the special value of 0 to prevent an explicit ODBCVER to be defined.");
56

67
if (PHP_ODBC == "yes") {
78
if (CHECK_LIB("odbc32.lib", "odbc") && CHECK_LIB("odbccp32.lib", "odbc")
89
&& CHECK_HEADER_ADD_INCLUDE("sql.h", "CFLAGS_ODBC")
910
&& CHECK_HEADER_ADD_INCLUDE("sqlext.h", "CFLAGS_ODBC")) {
1011
EXTENSION("odbc", "php_odbc.c");
1112
AC_DEFINE("HAVE_UODBC", 1, "ODBC support");
13+
if ("no" == PHP_ODBCVER) {
14+
AC_DEFINE("ODBCVER", "0x0300", "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+
}
1218
} else {
1319
WARNING("odbc support can't be enabled, libraries or header are missing (SDK)")
1420
PHP_ODBC = "no"
1521
}
16-
}
22+
}

ext/odbc/php_odbc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#define PHP_ODBC_H
2525

2626
#if HAVE_UODBC
27-
#define ODBCVER 0x0250
2827

2928
#ifdef ZTS
3029
#include "TSRM.h"

ext/odbc/php_odbc_includes.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525

2626
#if HAVE_UODBC
2727

28-
#define ODBCVER 0x0250
29-
/*#ifndef MSVC5
30-
#define FAR
31-
#endif
32-
*/
33-
3428
/* checking in the same order as in configure.in */
3529

3630
#if defined(HAVE_SOLID) || defined(HAVE_SOLID_30) || defined(HAVE_SOLID_35) /* Solid Server */

0 commit comments

Comments
 (0)