diff options
author | Bill King <bill.king@nokia.com> | 2009-12-17 03:49:31 (GMT) |
---|---|---|
committer | Bill King <bill.king@nokia.com> | 2009-12-17 03:49:31 (GMT) |
commit | 65fe21e8c1cfb70e5b763818928c6570bb67b5e3 (patch) | |
tree | 3928b5b9278b7225174f34f3c8d2e990f935603b | |
parent | b745c926f6fceed7a7d7078c0923bb8ab8e3019c (diff) | |
download | Qt-65fe21e8c1cfb70e5b763818928c6570bb67b5e3.zip Qt-65fe21e8c1cfb70e5b763818928c6570bb67b5e3.tar.gz Qt-65fe21e8c1cfb70e5b763818928c6570bb67b5e3.tar.bz2 |
(OCI) Fixes problem with clobs being handled as binary
CLOB/NCLOB/LONG are actually strings, so treat them as such.
Task-number: QTBUG-4461
Reviewed-by: Justin McPherson
-rw-r--r-- | src/sql/drivers/oci/qsql_oci.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qsqldatabase/tst_qsqldatabase.cpp | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp index f130087..a384ba0 100644 --- a/src/sql/drivers/oci/qsql_oci.cpp +++ b/src/sql/drivers/oci/qsql_oci.cpp @@ -517,7 +517,7 @@ QVariant::Type qDecodeOCIType(const QString& ocitype, QSql::NumericalPrecisionPo } else if (ocitype == QLatin1String("LONG") || ocitype == QLatin1String("NCLOB") || ocitype == QLatin1String("CLOB")) - type = QVariant::ByteArray; + type = QVariant::String; else if (ocitype == QLatin1String("RAW") || ocitype == QLatin1String("LONG RAW") || ocitype == QLatin1String("ROWID") || ocitype == QLatin1String("BLOB") || ocitype == QLatin1String("CFILE") || ocitype == QLatin1String("BFILE")) @@ -543,6 +543,7 @@ QVariant::Type qDecodeOCIType(int ocitype, QSql::NumericalPrecisionPolicy precis case SQLT_AVC: case SQLT_RDD: case SQLT_LNG: + case SQLT_CLOB: #ifdef SQLT_INTERVAL_YM case SQLT_INTERVAL_YM: #endif @@ -584,7 +585,6 @@ QVariant::Type qDecodeOCIType(int ocitype, QSql::NumericalPrecisionPolicy precis case SQLT_NTY: case SQLT_REF: case SQLT_RID: - case SQLT_CLOB: type = QVariant::ByteArray; break; case SQLT_DAT: diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp index cb4e103..4f89708 100644 --- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp @@ -942,9 +942,9 @@ void tst_QSqlDatabase::recordOCI() FieldDef("raw(2000)", QVariant::ByteArray, QByteArray(Q3CString("blah6")), false), FieldDef("blob", QVariant::ByteArray, QByteArray(Q3CString("blah7"))), #endif -//FIXME FieldDef("clob", QVariant::CString, Q3CString("blah8")), -//FIXME FieldDef("nclob", QVariant::CString, Q3CString("blah9")), -//X FieldDef("bfile", QVariant::ByteArray, QByteArray(Q3CString("blah10"))), + FieldDef("clob", QVariant::String, QString("blah8")), + FieldDef("nclob", QVariant::String, QString("blah9")), + FieldDef("bfile", QVariant::ByteArray, QByteArray("blah10")), intytm, intdts, |