Modified:
trunk/SDK/MYSQLPlus/Library/MResult.cpp
Log:
FIX: length now used when handling bind parameter (needed in particular for SQL_WCHAR)
- this enables updating char data in MS Access
Modified: trunk/SDK/MYSQLPlus/Library/MResult.cpp
===================================================================
--- trunk/SDK/MYSQLPlus/Library/MResult.cpp 2006-11-13 22:34:19 UTC (rev 667)
+++ trunk/SDK/MYSQLPlus/Library/MResult.cpp 2006-11-13 23:20:34 UTC (rev 668)
@@ -3770,13 +3770,18 @@
{
MYODBCDbgEnter();
- /*!
- \internal ODBC RULE (?)
+ if ( pResultPutData->pDescriptorRecordAPD->getConciseType() == SQL_C_WCHAR )
+ {
+ SQLINTEGER *pnOctetLengthPtr =
pResultPutData->pDescriptorRecordAPD->getOctetLengthPtr();
+ SQLINTEGER nLenBytes = ( pnOctetLengthPtr ? *pnOctetLengthPtr : -1 );
+ SQLINTEGER nLenChars = ( nLenBytes > 1 ? nLenBytes / 2 : -1 );
- Incoming character data is always null terminated (so ignore OctetLength).
- */
- if ( pResultPutData->pDescriptorRecordAPD->getConciseType() == SQL_C_WCHAR )
- pResultPutData->variantData.setValue( MYODBCC::QString_fromWCharArray(
(SQLWCHAR*)pResultPutData->pDescriptorRecordAPD->getDataPtr() ) );
+#if MYODBC_DBG > 1
+ MYODBCDbgInfo( QString( "pnOctetLengthPtr=%1, nLenBytes=%2, nLenChars=%3" ).arg(
(qulonglong)pnOctetLengthPtr ).arg( nLenBytes ).arg( nLenChars ) );
+#endif
+
+ pResultPutData->variantData.setValue( MYODBCC::QString_fromWCharArray(
(SQLWCHAR*)pResultPutData->pDescriptorRecordAPD->getDataPtr(), nLenChars ) );
+ }
else
pResultPutData->variantData.setValue( QString::fromAscii(
(char*)pResultPutData->pDescriptorRecordAPD->getDataPtr() ) );
| Thread |
|---|
| • Connector/ODBC 5 commit: r668 - trunk/SDK/MYSQLPlus/Library | pharvey | 14 Nov |