summaryrefslogtreecommitdiffstats
path: root/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/sqldrivers/odbc/qsql_odbc.cpp')
-rw-r--r--src/plugins/sqldrivers/odbc/qsql_odbc.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
index 88f1c74028..8df61ddaa5 100644
--- a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
+++ b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp
@@ -68,7 +68,7 @@ static const SQLSMALLINT TABLENAMESIZE = 128;
//Map Qt parameter types to ODBC types
static const SQLSMALLINT qParamType[4] = { SQL_PARAM_INPUT, SQL_PARAM_INPUT, SQL_PARAM_OUTPUT, SQL_PARAM_INPUT_OUTPUT };
-inline static QString fromSQLTCHAR(const QVarLengthArray<SQLTCHAR>& input, int size=-1)
+inline static QString fromSQLTCHAR(const QVarLengthArray<SQLTCHAR>& input, qsizetype size=-1)
{
QString result;
@@ -328,7 +328,7 @@ static QSqlError qMakeError(const QString& err, QSqlError::ErrorType type, const
{
int nativeCode = -1;
QString message = qODBCWarn(p, &nativeCode);
- return QSqlError(QLatin1String("QODBC3: ") + err, message, type,
+ return QSqlError(QLatin1String("QODBC: ") + err, message, type,
nativeCode != -1 ? QString::number(nativeCode) : QString());
}
@@ -337,7 +337,7 @@ static QSqlError qMakeError(const QString& err, QSqlError::ErrorType type,
{
int nativeCode = -1;
QString message = qODBCWarn(p, &nativeCode);
- return QSqlError(QLatin1String("QODBC3: ") + err, message, type,
+ return QSqlError(QLatin1String("QODBC: ") + err, message, type,
nativeCode != -1 ? QString::number(nativeCode) : QString());
}
@@ -491,7 +491,7 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni
// more data can be fetched, the length indicator does NOT
// contain the number of bytes returned - it contains the
// total number of bytes that CAN be fetched
- int rSize = (r == SQL_SUCCESS_WITH_INFO) ? colSize : lengthIndicator;
+ qsizetype rSize = (r == SQL_SUCCESS_WITH_INFO) ? colSize : lengthIndicator;
// Remove any trailing \0 as some drivers misguidedly append one
int realsize = qMin(rSize, buf.size());
if (realsize > 0 && buf[realsize - 1] == 0)
@@ -1586,7 +1586,7 @@ bool QODBCResult::exec()
if (bindValueType(i) & QSql::Out) {
const QVarLengthArray<SQLTCHAR> a(toSQLTCHAR(str));
- ba = QByteArray((const char *)a.constData(), a.size() * sizeof(SQLTCHAR));
+ ba = QByteArray((const char *)a.constData(), int(a.size() * sizeof(SQLTCHAR)));
r = SQLBindParameter(d->hStmt,
i + 1,
qParamType[bindValueType(i) & QSql::InOut],
@@ -2643,3 +2643,5 @@ bool QODBCDriver::isIdentifierEscaped(const QString &identifier, IdentifierType)
}
QT_END_NAMESPACE
+
+#include "moc_qsql_odbc_p.cpp"