Changeset 846 for trunk/src/sql/drivers/odbc
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/sql/drivers/odbc/qsql_odbc.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 63 63 #define ODBC_CHECK_DRIVER 64 64 65 #if defined(Q_ODBC_VERSION_2)66 //crude hack to get non-unicode capable driver managers to work67 # undef UNICODE68 # define SQLTCHAR SQLCHAR69 # define SQL_C_TCHAR SQL_C_CHAR70 #endif71 72 65 // newer platform SDKs use SQLLEN instead of SQLINTEGER 73 #if defined(WIN32) && (_MSC_VER < 1300) 66 #if defined(WIN32) && (_MSC_VER < 1300) 74 67 # define QSQLLEN SQLINTEGER 75 68 # define QSQLULEN SQLUINTEGER … … 267 260 static QString qODBCWarn(const QODBCPrivate* odbc, int *nativeCode = 0) 268 261 { 269 return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->dpEnv()) + QLatin1Char(' ')262 return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->dpEnv()) + QLatin1Char(' ') 270 263 + qWarnODBCHandle(SQL_HANDLE_DBC, odbc->dpDbc()) + QLatin1Char(' ') 271 264 + qWarnODBCHandle(SQL_HANDLE_STMT, odbc->hStmt, nativeCode)).simplified(); … … 274 267 static QString qODBCWarn(const QODBCDriverPrivate* odbc, int *nativeCode = 0) 275 268 { 276 return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->hEnv) + QLatin1Char(' ')269 return (qWarnODBCHandle(SQL_HANDLE_ENV, odbc->hEnv) + QLatin1Char(' ') 277 270 + qWarnODBCHandle(SQL_HANDLE_DBC, odbc->hDbc, nativeCode)).simplified(); 278 271 } … … 344 337 type = QVariant::DateTime; 345 338 break; 346 #ifndef Q_ODBC_VERSION_2347 339 case SQL_WCHAR: 348 340 case SQL_WVARCHAR: … … 350 342 type = QVariant::String; 351 343 break; 352 #endif353 344 case SQL_CHAR: 354 345 case SQL_VARCHAR: … … 670 661 static int qGetODBCVersion(const QString &connOpts) 671 662 { 672 #ifndef Q_ODBC_VERSION_2673 663 if (connOpts.contains(QLatin1String("SQL_ATTR_ODBC_VERSION=SQL_OV_ODBC3"), Qt::CaseInsensitive)) 674 664 return SQL_OV_ODBC3; 675 #endif676 if (connOpts.contains(QLatin1String("SQL_ATTR_ODBC_VERSION=SQL_OV_ODBC2"), Qt::CaseInsensitive))677 return SQL_OV_ODBC2;678 #ifdef _IODBCUNIX_H679 return SQL_OV_ODBC3;680 #else681 665 return SQL_OV_ODBC2; 682 #endif683 666 } 684 667 … … 781 764 } 782 765 r = SQLSetConnectAttr(hDbc, SQL_ATTR_TRACE, (SQLPOINTER) v, 0); 783 #ifndef Q_ODBC_VERSION_2784 766 } else if (opt.toUpper() == QLatin1String("SQL_ATTR_CONNECTION_POOLING")) { 785 767 if (val == QLatin1String("SQL_CP_OFF")) … … 808 790 } 809 791 r = SQLSetConnectAttr(hDbc, SQL_ATTR_CP_MATCH, (SQLPOINTER)v, 0); 810 #endif811 792 } else if (opt.toUpper() == QLatin1String("SQL_ATTR_ODBC_VERSION")) { 812 793 // Already handled in QODBCDriver::open() … … 1530 1511 break; 1531 1512 case QVariant::String: 1532 #ifndef Q_ODBC_VERSION_21533 1513 if (d->unicode) { 1534 1514 QString str = val.toString(); … … 1568 1548 } 1569 1549 else 1570 #endif1571 1550 { 1572 1551 QByteArray str = val.toString().toUtf8(); … … 1974 1953 void QODBCDriverPrivate::checkUnicode() 1975 1954 { 1976 #if defined(Q_ODBC_VERSION_2)1977 unicode = false;1978 return;1979 #endif1980 1981 1955 SQLRETURN r; 1982 1956 SQLUINTEGER fFunc; … … 2133 2107 #endif 2134 2108 isFreeTDSDriver = serverType.contains(QLatin1String("tdsodbc"), Qt::CaseInsensitive); 2135 unicode = isFreeTDSDriver == false;2109 unicode = ; 2136 2110 } 2137 2111 } -
trunk/src/sql/drivers/odbc/qsql_odbc.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 48 48 #if defined (Q_OS_WIN32) 49 49 #include <QtCore/qt_windows.h> 50 #endif51 52 #if defined (Q_OS_MAC) && (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_3)53 // assume we use iodbc on MACX54 // comment next line out if you use a55 // unicode compatible manager56 # define Q_ODBC_VERSION_257 50 #endif 58 51
Note:
See TracChangeset
for help on using the changeset viewer.