summaryrefslogtreecommitdiffstats
path: root/src/sql/drivers
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-21 19:19:36 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-21 19:19:36 (GMT)
commit07f131927faa09402589da7b4bfb516482f59e46 (patch)
tree9b1c7fdec802bbcb9b183d5644d02d8cc4435da2 /src/sql/drivers
parent19924c1373e6acdf4ebf8cf61c51f3cdf32978b3 (diff)
parentd00d1bd5423d0bbfea7c85a0411d2b22d97fbe0f (diff)
downloadQt-07f131927faa09402589da7b4bfb516482f59e46.zip
Qt-07f131927faa09402589da7b4bfb516482f59e46.tar.gz
Qt-07f131927faa09402589da7b4bfb516482f59e46.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Use aligned load for the blending of RGB32 over RGB32 tst_moc: workaround gcc bug. Some more change to the changelog Fix compilation with QT_NO_GRAPHICSVIEW Updates changes-4.7.0 Fixes the Oracle nchar bug when NLS_CHARSET is different with NLS_NCHAR_CHARSET. Add a missing file in the config.test for SSE 4.2 Remove the masking when computing qAlpha() Add support for more vector instructions on x86 Workaround gcc bug, disable test with old version of gcc Do not crash due to a infinite recursion when using voiceover on MacOS doc: Fix qdoc errors for text related files QGraphicsItem: Animation leaves drawing artifacts when clipping is used. moc: Slot with complex template default value does not compile
Diffstat (limited to 'src/sql/drivers')
-rw-r--r--src/sql/drivers/oci/qsql_oci.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/sql/drivers/oci/qsql_oci.cpp b/src/sql/drivers/oci/qsql_oci.cpp
index c56b995..e11cf75 100644
--- a/src/sql/drivers/oci/qsql_oci.cpp
+++ b/src/sql/drivers/oci/qsql_oci.cpp
@@ -93,8 +93,17 @@ enum { QOCIEncoding = 2002 }; // AL16UTF16LE
enum { QOCIEncoding = 2000 }; // AL16UTF16
#endif
-static const ub1 CSID_NCHAR = SQLCS_NCHAR;
+// Always set the OCI_ATTR_CHARSET_FORM to SQLCS_NCHAR is safe
+// because Oracle server will deal with the implicit Conversion
+// Between CHAR and NCHAR.
+// see: http://download.oracle.com/docs/cd/A91202_01/901_doc/appdev.901/a89857/oci05bnd.htm#422705
+static const ub1 qOraCharsetForm = SQLCS_NCHAR;
+
+#if defined (OCI_UTF16ID)
+static const ub2 qOraCharset = OCI_UTF16ID;
+#else
static const ub2 qOraCharset = OCI_UCS2ID;
+#endif
typedef QVarLengthArray<sb2, 32> IndicatorArray;
typedef QVarLengthArray<ub2, 32> SizeArray;
@@ -209,12 +218,24 @@ void QOCIResultPrivate::setCharset(OCIBind* hbnd)
OCI_HTYPE_BIND,
// this const cast is safe since OCI doesn't touch
// the charset.
+ const_cast<void *>(static_cast<const void *>(&qOraCharsetForm)),
+ 0,
+ OCI_ATTR_CHARSET_FORM,
+ err);
+ if (r != 0)
+ qOraWarning("QOCIResultPrivate::setCharset: Couldn't set OCI_ATTR_CHARSET_FORM: ", err);
+
+ r = OCIAttrSet(hbnd,
+ OCI_HTYPE_BIND,
+ // this const cast is safe since OCI doesn't touch
+ // the charset.
const_cast<void *>(static_cast<const void *>(&qOraCharset)),
0,
OCI_ATTR_CHARSET_ID,
err);
if (r != 0)
qOraWarning("QOCIResultPrivate::setCharset: Couldn't set OCI_ATTR_CHARSET_ID: ", err);
+
}
int QOCIResultPrivate::bindValue(OCIStmt *sql, OCIBind **hbnd, OCIError *err, int pos,
@@ -939,6 +960,17 @@ void QOCICols::setCharset(OCIDefine* dfn)
OCI_HTYPE_DEFINE,
// this const cast is safe since OCI doesn't touch
// the charset.
+ const_cast<void *>(static_cast<const void *>(&qOraCharsetForm)),
+ 0,
+ OCI_ATTR_CHARSET_FORM,
+ d->err);
+ if (r != 0)
+ qOraWarning("QOCIResultPrivate::setCharset: Couldn't set OCI_ATTR_CHARSET_FORM: ", d->err);
+
+ r = OCIAttrSet(dfn,
+ OCI_HTYPE_DEFINE,
+ // this const cast is safe since OCI doesn't touch
+ // the charset.
const_cast<void *>(static_cast<const void *>(&qOraCharset)),
0,
OCI_ATTR_CHARSET_ID,