summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-07-02 10:04:04 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-07-02 10:04:04 (GMT)
commitf4f79c42b7086145b59e99d195b6295720b7377a (patch)
tree9b34b9e242062d6833f9d3c9353ca1e252f76a86 /src/sql
parentc1283842567eea7dd83147a4bea5cd01564fdc2b (diff)
parent353dacb5e4c45e860ae8be228df9647c5a71093e (diff)
downloadQt-f4f79c42b7086145b59e99d195b6295720b7377a.zip
Qt-f4f79c42b7086145b59e99d195b6295720b7377a.tar.gz
Qt-f4f79c42b7086145b59e99d195b6295720b7377a.tar.bz2
Merge branch '4.5'
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/drivers/oci/qsql_oci.cpp7
-rw-r--r--src/sql/drivers/odbc/qsql_odbc.cpp4
2 files changed, 8 insertions, 3 deletions
diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp
index d5fb10f..979eeec 100644
--- a/src/sql/drivers/oci/qsql_oci.cpp
+++ b/src/sql/drivers/oci/qsql_oci.cpp
@@ -1586,9 +1586,12 @@ void QOCICols::getValues(QVector<QVariant> &v, int index)
} else if ((d->q->numericalPrecisionPolicy() == QSql::LowPrecisionInt64)
&& (fld.typ == QVariant::LongLong)) {
qint64 qll = 0;
- OCINumberToInt(d->err, reinterpret_cast<OCINumber *>(fld.data), sizeof(qint64),
+ int r = OCINumberToInt(d->err, reinterpret_cast<OCINumber *>(fld.data), sizeof(qint64),
OCI_NUMBER_SIGNED, &qll);
- v[index + i] = qll;
+ if(r == OCI_SUCCESS)
+ v[index + i] = qll;
+ else
+ v[index + i] = QVariant();
break;
} else if ((d->q->numericalPrecisionPolicy() == QSql::LowPrecisionInt32)
&& (fld.typ == QVariant::Int)) {
diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp
index 39565d3..50defdf 100644
--- a/src/sql/drivers/odbc/qsql_odbc.cpp
+++ b/src/sql/drivers/odbc/qsql_odbc.cpp
@@ -255,9 +255,11 @@ static QVariant::Type qDecodeODBCType(SQLSMALLINT sqltype, const T* p, bool isSi
case SQL_SMALLINT:
case SQL_INTEGER:
case SQL_BIT:
- case SQL_TINYINT:
type = isSigned ? QVariant::Int : QVariant::UInt;
break;
+ case SQL_TINYINT:
+ type = QVariant::UInt;
+ break;
case SQL_BIGINT:
type = isSigned ? QVariant::LongLong : QVariant::ULongLong;
break;