summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers/db2
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-12-30 17:39:21 +0100
committerLars Knoll <lars.knoll@qt.io>2018-01-02 09:58:44 +0100
commit0f315adf9199efcfafa44371464ab6d1fc866774 (patch)
tree35b67591255624c670aff0579e45b2973f56fd81 /src/plugins/sqldrivers/db2
parent2b0eb3fac319a17dd92903106d501f0f06df871f (diff)
parent52b85212a2ec8ec5bf187f6cd00b669a45bcf0bd (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: .qmake.conf sc/corelib/io/qfsfileengine_p.h src/corelib/io/qstorageinfo_unix.cpp src/platformsupport/eglconvenience/qeglpbuffer_p.h src/platformsupport/input/libinput/qlibinputkeyboard.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/ios/qiosscreen.h src/plugins/platforms/ios/qioswindow.h src/plugins/platforms/ios/quiview.mm src/printsupport/dialogs/qpagesetupdialog_unix_p.h src/printsupport/dialogs/qprintpreviewdialog.cpp src/printsupport/widgets/qcupsjobwidget_p.h src/widgets/widgets/qmenu.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
Diffstat (limited to 'src/plugins/sqldrivers/db2')
-rw-r--r--src/plugins/sqldrivers/db2/db2.pro2
-rw-r--r--src/plugins/sqldrivers/db2/qsql_db2.cpp28
2 files changed, 16 insertions, 14 deletions
diff --git a/src/plugins/sqldrivers/db2/db2.pro b/src/plugins/sqldrivers/db2/db2.pro
index eef65fac66..b99fe91fe3 100644
--- a/src/plugins/sqldrivers/db2/db2.pro
+++ b/src/plugins/sqldrivers/db2/db2.pro
@@ -7,5 +7,7 @@ QMAKE_USE += db2
OTHER_FILES += db2.json
+equals(QT_ARCH, x86_64): DEFINES += ODBC64
+
PLUGIN_CLASS_NAME = QDB2DriverPlugin
include(../qsqldriverbase.pri)
diff --git a/src/plugins/sqldrivers/db2/qsql_db2.cpp b/src/plugins/sqldrivers/db2/qsql_db2.cpp
index b457ced538..2c8097ed07 100644
--- a/src/plugins/sqldrivers/db2/qsql_db2.cpp
+++ b/src/plugins/sqldrivers/db2/qsql_db2.cpp
@@ -272,7 +272,7 @@ static QSqlField qMakeFieldInfo(const QDB2ResultPrivate* d, int i)
{
SQLSMALLINT colNameLen;
SQLSMALLINT colType;
- SQLUINTEGER colSize;
+ SQLULEN colSize;
SQLSMALLINT colScale;
SQLSMALLINT nullable;
SQLRETURN r = SQL_ERROR;
@@ -314,7 +314,7 @@ static int qGetIntData(SQLHANDLE hStmt, int column, bool& isNull)
{
SQLINTEGER intbuf;
isNull = false;
- SQLINTEGER lengthIndicator = 0;
+ SQLLEN lengthIndicator = 0;
SQLRETURN r = SQLGetData(hStmt,
column + 1,
SQL_C_SLONG,
@@ -332,7 +332,7 @@ static double qGetDoubleData(SQLHANDLE hStmt, int column, bool& isNull)
{
SQLDOUBLE dblbuf;
isNull = false;
- SQLINTEGER lengthIndicator = 0;
+ SQLLEN lengthIndicator = 0;
SQLRETURN r = SQLGetData(hStmt,
column+1,
SQL_C_DOUBLE,
@@ -351,7 +351,7 @@ static SQLBIGINT qGetBigIntData(SQLHANDLE hStmt, int column, bool& isNull)
{
SQLBIGINT lngbuf = Q_INT64_C(0);
isNull = false;
- SQLINTEGER lengthIndicator = 0;
+ SQLLEN lengthIndicator = 0;
SQLRETURN r = SQLGetData(hStmt,
column+1,
SQL_C_SBIGINT,
@@ -368,7 +368,7 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool& is
{
QString fieldVal;
SQLRETURN r = SQL_ERROR;
- SQLINTEGER lengthIndicator = 0;
+ SQLLEN lengthIndicator = 0;
if (colSize <= 0)
colSize = 255;
@@ -404,12 +404,12 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool& is
return fieldVal;
}
-static QByteArray qGetBinaryData(SQLHANDLE hStmt, int column, SQLINTEGER& lengthIndicator, bool& isNull)
+static QByteArray qGetBinaryData(SQLHANDLE hStmt, int column, SQLLEN& lengthIndicator, bool& isNull)
{
QByteArray fieldVal;
SQLSMALLINT colNameLen;
SQLSMALLINT colType;
- SQLUINTEGER colSize;
+ SQLULEN colSize;
SQLSMALLINT colScale;
SQLSMALLINT nullable;
SQLRETURN r = SQL_ERROR;
@@ -643,9 +643,9 @@ bool QDB2Result::exec()
{
Q_D(QDB2Result);
QList<QByteArray> tmpStorage; // holds temporary ptrs
- QVarLengthArray<SQLINTEGER, 32> indicators(boundValues().count());
+ QVarLengthArray<SQLLEN, 32> indicators(boundValues().count());
- memset(indicators.data(), 0, indicators.size() * sizeof(SQLINTEGER));
+ memset(indicators.data(), 0, indicators.size() * sizeof(SQLLEN));
setActive(false);
setAt(QSql::BeforeFirstRow);
SQLRETURN r;
@@ -661,7 +661,7 @@ bool QDB2Result::exec()
int i;
for (i = 0; i < values.count(); ++i) {
// bind parameters - only positional binding allowed
- SQLINTEGER *ind = &indicators[i];
+ SQLLEN *ind = &indicators[i];
if (values.at(i).isNull())
*ind = SQL_NULL_DATA;
if (bindValueType(i) & QSql::Out)
@@ -1006,7 +1006,7 @@ QVariant QDB2Result::data(int field)
return QVariant();
}
SQLRETURN r = 0;
- SQLINTEGER lengthIndicator = 0;
+ SQLLEN lengthIndicator = 0;
bool isNull = false;
const QSqlField info = d->recInf.field(field);
@@ -1119,7 +1119,7 @@ bool QDB2Result::isNull(int i)
int QDB2Result::numRowsAffected()
{
Q_D(const QDB2Result);
- SQLINTEGER affectedRowCount = 0;
+ SQLLEN affectedRowCount = 0;
SQLRETURN r = SQLRowCount(d->hStmt, &affectedRowCount);
if (r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO)
return affectedRowCount;
@@ -1248,7 +1248,7 @@ bool QDB2Driver::open(const QString& db, const QString& user, const QString& pas
const QString opt(tmp.left(idx));
const QString val(tmp.mid(idx + 1).simplified());
- SQLUINTEGER v = 0;
+ SQLULEN v = 0;
r = SQL_SUCCESS;
if (opt == QLatin1String("SQL_ATTR_ACCESS_MODE")) {
if (val == QLatin1String("SQL_MODE_READ_ONLY")) {
@@ -1634,7 +1634,7 @@ bool QDB2Driver::rollbackTransaction()
bool QDB2Driver::setAutoCommit(bool autoCommit)
{
Q_D(QDB2Driver);
- SQLUINTEGER ac = autoCommit ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF;
+ SQLULEN ac = autoCommit ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF;
SQLRETURN r = SQLSetConnectAttr(d->hDbc,
SQL_ATTR_AUTOCOMMIT,
reinterpret_cast<SQLPOINTER>(ac),