QString fname = qGetStringData(hStmt, 3, -1, p->unicode);
int type = qGetIntData(hStmt, 4).toInt(); // column type
QSqlField f(fname, qDecodeODBCType(type, p));
+ QVariant var = qGetIntData(hStmt, 6);
+ f.setLength(var.isNull() ? -1 : var.toInt()); // column size
+ var = qGetIntData(hStmt, 8).toInt();
+ f.setPrecision(var.isNull() ? -1 : var.toInt()); // precision
+ f.setSqlType(type);
int required = qGetIntData(hStmt, 10).toInt(); // nullable-flag
// required can be SQL_NO_NULLS, SQL_NULLABLE or SQL_NULLABLE_UNKNOWN
if (required == SQL_NO_NULLS)
else if (required == SQL_NULLABLE)
f.setRequired(false);
// else we don't know
- QVariant var = qGetIntData(hStmt, 6);
- f.setLength(var.isNull() ? -1 : var.toInt()); // column size
- var = qGetIntData(hStmt, 8).toInt();
- f.setPrecision(var.isNull() ? -1 : var.toInt()); // precision
- f.setSqlType(type);
return f;
}
int strSize = str.length() * sizeof(SQLTCHAR);
if (bindValueType(i) & QSql::Out) {
- QVarLengthArray<SQLTCHAR> ba(toSQLTCHAR(str));
- ba.reserve(str.capacity());
+ QVarLengthArray<SQLTCHAR> a(toSQLTCHAR(str));
+ a.reserve(str.capacity());
+ QByteArray ba((const char *)a.constData(), a.size() * sizeof(SQLTCHAR));
r = SQLBindParameter(d->hStmt,
i + 1,
qParamType[(QFlag)(bindValueType(i)) & QSql::InOut],
strSize > 254 ? SQL_WLONGVARCHAR : SQL_WVARCHAR,
0, // god knows... don't change this!
0,
- (void *)ba.constData(),
+ (void *)ba.data(),
ba.size(),
ind);
- tmpStorage.append(QByteArray((const char *)ba.constData(), ba.size()*sizeof(SQLTCHAR)));
+ tmpStorage.append(ba);
break;
}
QByteArray strba((const char *)toSQLTCHAR(str).constData(), str.size()*sizeof(SQLTCHAR));
QByteArray first = tmpStorage.takeFirst();
QVarLengthArray<SQLTCHAR> array;
array.append((SQLTCHAR *)first.constData(), first.size());
- values[i] = fromSQLTCHAR(array, first.size()/sizeof(SQLTCHAR*));
+ values[i] = fromSQLTCHAR(array, first.size()/sizeof(SQLTCHAR));
}
break;
}
return res;
}
-bool QODBCDriver::isIdentifierEscapedImplementation(const QString &identifier, IdentifierType) const
+bool QODBCDriver::isIdentifierEscaped(const QString &identifier, IdentifierType) const
{
QChar quote = d->quoteChar();
return identifier.size() > 2