--- a/src/sql/drivers/odbc/qsql_odbc.cpp Wed Jun 23 19:07:03 2010 +0300
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp Tue Jul 06 15:10:48 2010 +0300
@@ -62,15 +62,8 @@
// undefine this to prevent initial check of the ODBC driver
#define ODBC_CHECK_DRIVER
-#if defined(Q_ODBC_VERSION_2)
-//crude hack to get non-unicode capable driver managers to work
-# undef UNICODE
-# define SQLTCHAR SQLCHAR
-# define SQL_C_TCHAR SQL_C_CHAR
-#endif
-
// newer platform SDKs use SQLLEN instead of SQLINTEGER
-#if defined(WIN32) && (_MSC_VER < 1300)
+#if defined(WIN32) && (_MSC_VER < 1300) && !defined(__MINGW64_VERSION_MAJOR)
# define QSQLLEN SQLINTEGER
# define QSQLULEN SQLUINTEGER
#else
@@ -343,13 +336,11 @@
case SQL_TYPE_TIMESTAMP:
type = QVariant::DateTime;
break;
-#ifndef Q_ODBC_VERSION_2
case SQL_WCHAR:
case SQL_WVARCHAR:
case SQL_WLONGVARCHAR:
type = QVariant::String;
break;
-#endif
case SQL_CHAR:
case SQL_VARCHAR:
#if (ODBCVER >= 0x0350)
@@ -669,17 +660,9 @@
static int qGetODBCVersion(const QString &connOpts)
{
-#ifndef Q_ODBC_VERSION_2
if (connOpts.contains(QLatin1String("SQL_ATTR_ODBC_VERSION=SQL_OV_ODBC3"), Qt::CaseInsensitive))
return SQL_OV_ODBC3;
-#endif
- if (connOpts.contains(QLatin1String("SQL_ATTR_ODBC_VERSION=SQL_OV_ODBC2"), Qt::CaseInsensitive))
- return SQL_OV_ODBC2;
-#ifdef _IODBCUNIX_H
- return SQL_OV_ODBC3;
-#else
return SQL_OV_ODBC2;
-#endif
}
QChar QODBCDriverPrivate::quoteChar()
@@ -780,7 +763,6 @@
continue;
}
r = SQLSetConnectAttr(hDbc, SQL_ATTR_TRACE, (SQLPOINTER) v, 0);
-#ifndef Q_ODBC_VERSION_2
} else if (opt.toUpper() == QLatin1String("SQL_ATTR_CONNECTION_POOLING")) {
if (val == QLatin1String("SQL_CP_OFF"))
v = SQL_CP_OFF;
@@ -807,7 +789,6 @@
continue;
}
r = SQLSetConnectAttr(hDbc, SQL_ATTR_CP_MATCH, (SQLPOINTER)v, 0);
-#endif
} else if (opt.toUpper() == QLatin1String("SQL_ATTR_ODBC_VERSION")) {
// Already handled in QODBCDriver::open()
continue;
@@ -1529,7 +1510,6 @@
*ind == SQL_NULL_DATA ? ind : NULL);
break;
case QVariant::String:
-#ifndef Q_ODBC_VERSION_2
if (d->unicode) {
QString str = val.toString();
if (*ind != SQL_NULL_DATA)
@@ -1567,7 +1547,6 @@
break;
}
else
-#endif
{
QByteArray str = val.toString().toUtf8();
if (*ind != SQL_NULL_DATA)
@@ -1973,11 +1952,6 @@
// as two byte unicode characters
void QODBCDriverPrivate::checkUnicode()
{
-#if defined(Q_ODBC_VERSION_2)
- unicode = false;
- return;
-#endif
-
SQLRETURN r;
SQLUINTEGER fFunc;