remove useless workaround
authorMark Brand <mabrand@mabrand.nl>
Thu, 12 Apr 2012 23:01:23 +0000 (01:01 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 17 Apr 2012 21:16:51 +0000 (23:16 +0200)
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 <harald.fernengel@nokia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
src/sql/drivers/odbc/qsql_odbc.cpp

index 9b1b7fa..f503f64 100644 (file)
@@ -1502,8 +1502,7 @@ bool QODBCResult::exec()
                     int strSize = str.length() * sizeof(SQLTCHAR);
 
                     if (bindValueType(i) & QSql::Out) {
-                        QVarLengthArray<SQLTCHAR> a(toSQLTCHAR(str));
-                        a.reserve(str.capacity());
+                        const QVarLengthArray<SQLTCHAR> a(toSQLTCHAR(str));
                         QByteArray ba((const char *)a.constData(), a.size() * sizeof(SQLTCHAR));
                         r = SQLBindParameter(d->hStmt,
                                             i + 1,