From 65fe21e8c1cfb70e5b763818928c6570bb67b5e3 Mon Sep 17 00:00:00 2001 From: Bill King Date: Thu, 17 Dec 2009 13:49:31 +1000 Subject: (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 --- src/sql/drivers/oci/qsql_oci.cpp | 4 ++-- 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, -- cgit v0.12