Fix memory leaks in 64-bits ODBC driver

On 64-bits Windows system, integers and longs are still 4 bytes values.
Several functions that were previously defined with SQLINTEGER and
SQLUINTEGER parameters have been changed where appropiate to use new
SQLLEN and SQLULEN typedefs. SQLGetStmtAttr() is one of these functions.
This fix replaces SQLINTEGER with SQLULEN in appropriate functions to avoid
memory leaks.

Task-number: QTBUG-25256
Change-Id: I744927f42b8578ece60815df360e3b337ebf452a
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
This commit is contained in:
Honglei Zhang 2012-04-26 13:17:40 +03:00 committed by Qt by Nokia
parent f3721d7706
commit 1509316a37

View File

@ -962,7 +962,8 @@ bool QODBCResult::reset (const QString& query)
return true;
}
SQLINTEGER isScrollable, bufferLength;
SQLINTEGER bufferLength;
SQLULEN isScrollable;
r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, &bufferLength);
if(r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO)
QSqlResult::setForwardOnly(isScrollable==SQL_NONSCROLLABLE);
@ -1584,7 +1585,8 @@ bool QODBCResult::exec()
return false;
}
SQLINTEGER isScrollable, bufferLength;
SQLINTEGER bufferLength;
SQLULEN isScrollable;
r = SQLGetStmtAttr(d->hStmt, SQL_ATTR_CURSOR_SCROLLABLE, &isScrollable, SQL_IS_INTEGER, &bufferLength);
if(r == SQL_SUCCESS || r == SQL_SUCCESS_WITH_INFO)
QSqlResult::setForwardOnly(isScrollable==SQL_NONSCROLLABLE);