On Mon, Jan 30, 2012 at 02:08:54PM +0000, Michael Meeks wrote: > On Mon, 2012-01-30 at 12:40 +0100, Stephan Bergmann wrote:
>> The attached >> 0001-fdo-44025-repair-dbaccess-ORowSetCache-isLast-after-.patch >> appears to be completely unrelated? > True :-) Yes, I used an older email as a template and forgot to replace the attached patch. > I suspect the patch intended is attached; the patch it refers to is > already merged. This has my ack - seems like a nice piece of cleanup > and bug fix in one. So, I had thought that this was too invasive for a "late release candidate" change, so I did a less invasive version of it for libreoffice-3-5. The patch you dug up is the corresponding master commit. I attach here the "less invasive" variant originally meant for libreoffice-3-5. However, if people are happy with cherry-picking the (more invasive) master commit, by all means, cherry-pick it. This would have the advantage of not "forking" these codepaths between 3.5 and 3.6, which means these codepaths will get more testing and if a remaining bug is discovered, then when we correct the bug in both of them by just cherry-picking from master to libreoffice-3-5 in future. It has the disadvantage that, well, more invasive change close to release. <shrug> > From 19ef5bcc8d9dbcf965f79495e1afd86ac0f22c31 Mon Sep 17 00:00:00 2001 > From: Lionel Elie Mamane <lio...@mamane.lu> > Date: Tue, 24 Jan 2012 22:21:41 +0100 > Subject: [PATCH] use proper sizes for SQL(Get|Set)StmtAttr > Fixes fdo#34432 (driver smashes our stack) > Continuation of > commit 9a466d9718cceeb4ace9e3352a173c7b62387eee > Author: Lionel Elie Mamane <lio...@mamane.lu> > Date: Tue Nov 29 17:49:36 2011 +0100 > ODBC: use right integer length to get Statement Options -- Lionel
>From f10aaa6a56c4ac764f27e040b40191c4b9028feb Mon Sep 17 00:00:00 2001 From: Lionel Elie Mamane <lio...@mamane.lu> Date: Sun, 29 Jan 2012 21:17:36 +0100 Subject: [PATCH] use proper sizes for SQL(Get|Set)StmtAttr Fixes fdo#34432 (driver smashes our stack on 64bits arch) --- .../source/drivers/odbcbase/OResultSet.cxx | 14 +++++++------- .../source/drivers/odbcbase/OStatement.cxx | 14 +++++++------- connectivity/source/inc/odbc/OResultSet.hxx | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx index fa0e844..136f597 100644 --- a/connectivity/source/drivers/odbcbase/OResultSet.cxx +++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx @@ -123,7 +123,7 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) : catch(const Exception&) { // we don't want our result destroy here } - SQLINTEGER nCurType = 0; + SQLULEN nCurType = 0; try { N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_TYPE,&nCurType,SQL_IS_UINTEGER,0); @@ -1268,7 +1268,7 @@ Sequence< sal_Int32 > SAL_CALL OResultSet::deleteRows( const Sequence< Any >& //------------------------------------------------------------------------------ sal_Int32 OResultSet::getResultSetConcurrency() const { - sal_uInt32 nValue = 0; + SQLULEN nValue = 0; SQLRETURN nReturn = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CONCURRENCY,&nValue,SQL_IS_UINTEGER,0); OSL_UNUSED( nReturn ); if(SQL_CONCUR_READ_ONLY == nValue) @@ -1281,7 +1281,7 @@ sal_Int32 OResultSet::getResultSetConcurrency() const //------------------------------------------------------------------------------ sal_Int32 OResultSet::getResultSetType() const { - sal_uInt32 nValue = 0; + SQLULEN nValue = 0; N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_SENSITIVITY,&nValue,SQL_IS_UINTEGER,0); if(SQL_SENSITIVE == nValue) nValue = ResultSetType::SCROLL_SENSITIVE; @@ -1289,7 +1289,7 @@ sal_Int32 OResultSet::getResultSetType() const nValue = ResultSetType::SCROLL_INSENSITIVE; else { - SQLINTEGER nCurType = 0; + SQLULEN nCurType = 0; N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_TYPE,&nCurType,SQL_IS_UINTEGER,0); if(SQL_CURSOR_KEYSET_DRIVEN == nCurType) nValue = ResultSetType::SCROLL_SENSITIVE; @@ -1311,7 +1311,7 @@ sal_Int32 OResultSet::getFetchDirection() const //------------------------------------------------------------------------------ sal_Int32 OResultSet::getFetchSize() const { - sal_uInt32 nValue = 0; + SQLULEN nValue = 0; N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_ARRAY_SIZE,&nValue,SQL_IS_UINTEGER,0); return nValue; } @@ -1329,7 +1329,7 @@ sal_Bool OResultSet::isBookmarkable() const if(!m_aConnectionHandle) return sal_False; - sal_uInt32 nValue = 0; + SQLULEN nValue = 0; N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_TYPE,&nValue,SQL_IS_UINTEGER,0); sal_Int32 nAttr = 0; @@ -1680,7 +1680,7 @@ sal_Bool OResultSet::move(IResultSetHelper::Movement _eCursorPosition, sal_Int32 // ----------------------------------------------------------------------------- sal_Int32 OResultSet::getDriverPos() const { - sal_Int32 nValue = 0; + SQLULEN nValue = 0; SQLRETURN nRet = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_NUMBER,&nValue,SQL_IS_UINTEGER,0); OSL_UNUSED( nRet ); OSL_TRACE( __FILE__": OResultSet::getDriverPos() = Ret = %d, RowNum = %d, RowPos = %d",nRet,nValue , m_nRowPos); diff --git a/connectivity/source/drivers/odbcbase/OStatement.cxx b/connectivity/source/drivers/odbcbase/OStatement.cxx index 1e8558c..d79e188 100644 --- a/connectivity/source/drivers/odbcbase/OStatement.cxx +++ b/connectivity/source/drivers/odbcbase/OStatement.cxx @@ -300,7 +300,7 @@ sal_Bool OStatement_Base::lockIfNecessary (const ::rtl::OUString& sql) throw( SQ OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); try { - SQLINTEGER nLock = SQL_CONCUR_LOCK; + const SQLULEN nLock = SQL_CONCUR_LOCK; THROW_SQL(N3SQLSetStmtAttr(m_aStatementHandle, SQL_CONCURRENCY,(SQLPOINTER)(sal_IntPtr)nLock,SQL_IS_UINTEGER)); } catch (const SQLWarning& warn) @@ -683,7 +683,7 @@ sal_Int64 OStatement_Base::getMaxRows() const sal_Int32 OStatement_Base::getResultSetConcurrency() const { OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); - sal_uInt32 nValue; + SQLULEN nValue; SQLRETURN nRetCode = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CONCURRENCY,&nValue,SQL_IS_UINTEGER,0); OSL_UNUSED( nRetCode ); if(nValue == SQL_CONCUR_READ_ONLY) @@ -696,7 +696,7 @@ sal_Int32 OStatement_Base::getResultSetConcurrency() const sal_Int32 OStatement_Base::getResultSetType() const { OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); - sal_uInt32 nValue = SQL_CURSOR_FORWARD_ONLY; + SQLULEN nValue = SQL_CURSOR_FORWARD_ONLY; SQLRETURN nRetCode = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_SENSITIVITY,&nValue,SQL_IS_UINTEGER,0); nRetCode = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_TYPE,&nValue,SQL_IS_UINTEGER,0); OSL_UNUSED( nRetCode ); @@ -720,7 +720,7 @@ sal_Int32 OStatement_Base::getResultSetType() const sal_Int32 OStatement_Base::getFetchDirection() const { OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); - sal_uInt32 nValue = 0; + SQLULEN nValue = 0; SQLRETURN nRetCode = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_CURSOR_SCROLLABLE,&nValue,SQL_IS_UINTEGER,0); OSL_UNUSED( nRetCode ); @@ -740,7 +740,7 @@ sal_Int32 OStatement_Base::getFetchDirection() const sal_Int32 OStatement_Base::getFetchSize() const { OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); - sal_uInt32 nValue; + SQLULEN nValue; SQLRETURN nRetCode = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_ROW_ARRAY_SIZE,&nValue,SQL_IS_UINTEGER,0); OSL_UNUSED( nRetCode ); return nValue; @@ -904,7 +904,7 @@ void OStatement_Base::setCursorName(const ::rtl::OUString &_par0) sal_Bool OStatement_Base::isUsingBookmarks() const { OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); - sal_uInt32 nValue = SQL_UB_OFF; + SQLULEN nValue = SQL_UB_OFF; SQLRETURN nRetCode = N3SQLGetStmtAttr(m_aStatementHandle,SQL_ATTR_USE_BOOKMARKS,&nValue,SQL_IS_UINTEGER,NULL); OSL_UNUSED( nRetCode ); return nValue != SQL_UB_OFF; @@ -913,7 +913,7 @@ sal_Bool OStatement_Base::isUsingBookmarks() const sal_Bool OStatement_Base::getEscapeProcessing() const { OSL_ENSURE( m_aStatementHandle, "StatementHandle is null!" ); - sal_uInt32 nValue = SQL_NOSCAN_OFF; + SQLULEN nValue = SQL_NOSCAN_OFF; SQLRETURN nRetCode = N3SQLGetStmtAttr( m_aStatementHandle, SQL_ATTR_NOSCAN, &nValue, SQL_IS_UINTEGER, NULL ); (void)nRetCode; return nValue == SQL_NOSCAN_OFF; diff --git a/connectivity/source/inc/odbc/OResultSet.hxx b/connectivity/source/inc/odbc/OResultSet.hxx index bbb3920..e843e51 100644 --- a/connectivity/source/inc/odbc/OResultSet.hxx +++ b/connectivity/source/inc/odbc/OResultSet.hxx @@ -142,7 +142,7 @@ namespace connectivity rtl_TextEncoding m_nTextEncoding; sal_Int32 m_nRowPos; sal_Int32 m_nLastColumnPos; // used for m_aRow just to know where we are - mutable sal_uInt32 m_nUseBookmarks; + mutable SQLULEN m_nUseBookmarks; SQLRETURN m_nCurrentFetchState; sal_Bool m_bWasNull; sal_Bool m_bEOF; // after last record -- 1.7.7.3
_______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice