connectivity/source/drivers/odbcbase/OResultSet.cxx | 16 ++++++++-------- connectivity/source/drivers/odbcbase/OStatement.cxx | 20 ++++++++++---------- connectivity/source/inc/odbc/OResultSet.hxx | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-)
New commits: commit e2c1be67b8bf8513e58b80aed1ad7e9a2fe3d5e6 Author: Damjan Jovanovic <dam...@apache.org> Date: Fri Nov 17 04:05:27 2017 +0000 More ODBC64 fixes, for SQLGetStmtAttr() and SQLSetStmtAttr(). Patch by: me diff --git a/connectivity/source/drivers/odbcbase/OResultSet.cxx b/connectivity/source/drivers/odbcbase/OResultSet.cxx index 5747a0904d7a..273e96271e34 100644 --- a/connectivity/source/drivers/odbcbase/OResultSet.cxx +++ b/connectivity/source/drivers/odbcbase/OResultSet.cxx @@ -118,7 +118,7 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle ,OStatement_Base* pStmt) : catch(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); @@ -1263,7 +1263,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) @@ -1276,7 +1276,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; @@ -1284,7 +1284,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; @@ -1305,7 +1305,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; } @@ -1323,7 +1323,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; @@ -1674,10 +1674,10 @@ 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); + OSL_TRACE( __FILE__": OResultSet::getDriverPos() = Ret = %d, RowNum = %lu, RowPos = %d",nRet,nValue , m_nRowPos); return nValue ? nValue : m_nRowPos; } // ----------------------------------------------------------------------------- diff --git a/connectivity/source/drivers/odbcbase/OStatement.cxx b/connectivity/source/drivers/odbcbase/OStatement.cxx index b1c0a3316d4a..8b47185b38b3 100644 --- a/connectivity/source/drivers/odbcbase/OStatement.cxx +++ b/connectivity/source/drivers/odbcbase/OStatement.cxx @@ -297,7 +297,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; + SQLUINTEGER nLock = SQL_CONCUR_LOCK; THROW_SQL(N3SQLSetStmtAttr(m_aStatementHandle, SQL_CONCURRENCY,(SQLPOINTER)nLock,SQL_IS_UINTEGER)); } catch (SQLWarning& warn) @@ -679,7 +679,7 @@ sal_Int32 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) @@ -692,7 +692,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); switch(nValue) @@ -715,7 +715,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 ); @@ -735,7 +735,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; @@ -772,7 +772,7 @@ void OStatement_Base::setMaxRows(sal_Int32 _par0) //------------------------------------------------------------------------------ void OStatement_Base::setResultSetConcurrency(sal_Int32 _par0) { - SQLINTEGER nSet; + SQLUINTEGER nSet; if(_par0 == ResultSetConcurrency::READ_ONLY) nSet = SQL_CONCUR_READ_ONLY; else @@ -853,7 +853,7 @@ void OStatement_Base::setEscapeProcessing( const sal_Bool _bEscapeProc ) void OStatement_Base::setFetchDirection(sal_Int32 _par0) { OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); - sal_Int32 nCursType = 0; + SQLUINTEGER nCursType = 0; SQLRETURN nRetCode = SQL_SUCCESS; if(_par0 == FetchDirection::FORWARD) { @@ -899,7 +899,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; @@ -908,7 +908,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; @@ -917,7 +917,7 @@ sal_Bool OStatement_Base::getEscapeProcessing() const void OStatement_Base::setUsingBookmarks(sal_Bool _bUseBookmark) { OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!"); - sal_uInt32 nValue = _bUseBookmark ? SQL_UB_VARIABLE : SQL_UB_OFF; + SQLUINTEGER nValue = _bUseBookmark ? SQL_UB_VARIABLE : SQL_UB_OFF; SQLRETURN nRetCode = N3SQLSetStmtAttr(m_aStatementHandle,SQL_ATTR_USE_BOOKMARKS,(SQLPOINTER)nValue,SQL_IS_UINTEGER); OSL_UNUSED( nRetCode ); } diff --git a/connectivity/source/inc/odbc/OResultSet.hxx b/connectivity/source/inc/odbc/OResultSet.hxx index ea5ac06b168c..5d26961c2ea9 100644 --- a/connectivity/source/inc/odbc/OResultSet.hxx +++ b/connectivity/source/inc/odbc/OResultSet.hxx @@ -137,7 +137,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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits