From 00bf077b98bb53304bd9e487e9ad3d0734fb65af Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Fri, 13 Apr 2012 01:01:23 +0200 Subject: remove useless workaround The workaround attempts to let the application reserve memory in QString for receiving the stored procedure output parameter. This does not work because the reserved capacity is not preserved through QVariant. Unfortunately, the application must actually populate QString with at least the number of characters that will be received. Change-Id: Icb3be60d6bd570ad2349f20fb7d93b340e395627 Reviewed-by: Harald Fernengel Reviewed-by: Mark Brand --- src/sql/drivers/odbc/qsql_odbc.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 9b1b7fa2ba..f503f64cdf 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -1502,8 +1502,7 @@ bool QODBCResult::exec() int strSize = str.length() * sizeof(SQLTCHAR); if (bindValueType(i) & QSql::Out) { - QVarLengthArray a(toSQLTCHAR(str)); - a.reserve(str.capacity()); + const QVarLengthArray a(toSQLTCHAR(str)); QByteArray ba((const char *)a.constData(), a.size() * sizeof(SQLTCHAR)); r = SQLBindParameter(d->hStmt, i + 1, -- cgit v1.2.3