Kaydet (Commit) d4469196 authored tarafından Julien Nabet's avatar Julien Nabet

Related tdf#104942: implement setByte on firebird

There's no TINYINT or equivalent so let's do the same as setShort
Tested-by: 's avatarJenkins <ci@libreoffice.org>
(cherry picked from commit f31ccd18)

Change-Id: Ia1154ee068b02f40e7efa21571036d8b49844859
Reviewed-on: https://gerrit.libreoffice.org/47237Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst 24b3fc49
...@@ -350,7 +350,7 @@ void SAL_CALL OPreparedStatement::setBoolean(sal_Int32 nIndex, sal_Bool bValue) ...@@ -350,7 +350,7 @@ void SAL_CALL OPreparedStatement::setBoolean(sal_Int32 nIndex, sal_Bool bValue)
} }
template <typename T> template <typename T>
void OPreparedStatement::setValue(sal_Int32 nIndex, T& nValue, ISC_SHORT nType) void OPreparedStatement::setValue(sal_Int32 nIndex, const T& nValue, ISC_SHORT nType)
{ {
MutexGuard aGuard( m_aMutex ); MutexGuard aGuard( m_aMutex );
checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
...@@ -372,9 +372,11 @@ void OPreparedStatement::setValue(sal_Int32 nIndex, T& nValue, ISC_SHORT nType) ...@@ -372,9 +372,11 @@ void OPreparedStatement::setValue(sal_Int32 nIndex, T& nValue, ISC_SHORT nType)
memcpy(pVar->sqldata, &nValue, sizeof(nValue)); memcpy(pVar->sqldata, &nValue, sizeof(nValue));
} }
void SAL_CALL OPreparedStatement::setByte(sal_Int32 /*nIndex*/, sal_Int8 /*nValue*/) void SAL_CALL OPreparedStatement::setByte(sal_Int32 nIndex, sal_Int8 nValue)
{ {
::dbtools::throwFunctionNotSupportedSQLException("XParameters::setByte", *this); // there's no TINYINT or equivalent on Firebird,
// so do the same as setShort
setValue< sal_Int16 >(nIndex, nValue, SQL_SHORT);
} }
void SAL_CALL OPreparedStatement::setShort(sal_Int32 nIndex, sal_Int16 nValue) void SAL_CALL OPreparedStatement::setShort(sal_Int32 nIndex, sal_Int16 nValue)
......
...@@ -64,7 +64,7 @@ namespace connectivity ...@@ -64,7 +64,7 @@ namespace connectivity
* @throws css::sdbc::SQLException * @throws css::sdbc::SQLException
* @throws css::uno::RuntimeException * @throws css::uno::RuntimeException
*/ */
template <typename T> void setValue(sal_Int32 nIndex, T& nValue, ISC_SHORT nType); template <typename T> void setValue(sal_Int32 nIndex, const T& nValue, ISC_SHORT nType);
void setParameterNull(sal_Int32 nParameterIndex, bool bSetNull = true); void setParameterNull(sal_Int32 nParameterIndex, bool bSetNull = true);
/// @throws css::sdbc::SQLException /// @throws css::sdbc::SQLException
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment