summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-01-01 16:59:58 +0100
committerJulien Nabet <serval2412@yahoo.fr>2018-01-02 16:33:42 +0100
commitd4469196a2072d2d3fa2e433d02552facaa269f2 (patch)
treeb4855892d2bde7102f88e70cacc69a439b355890 /connectivity
parent24b3fc49238b1890769fa45571a3043646e4e4b9 (diff)
Related tdf#104942: implement setByte on firebird
There's no TINYINT or equivalent so let's do the same as setShort Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit f31ccd18f1b142f8c851e7e219f8bc18b157bc52) Change-Id: Ia1154ee068b02f40e7efa21571036d8b49844859 Reviewed-on: https://gerrit.libreoffice.org/47237 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/PreparedStatement.cxx8
-rw-r--r--connectivity/source/drivers/firebird/PreparedStatement.hxx2
2 files changed, 6 insertions, 4 deletions
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index 400b6c147cf8..a120ada7c1f9 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -350,7 +350,7 @@ void SAL_CALL OPreparedStatement::setBoolean(sal_Int32 nIndex, sal_Bool bValue)
}
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 );
checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
@@ -372,9 +372,11 @@ void OPreparedStatement::setValue(sal_Int32 nIndex, T& nValue, ISC_SHORT nType)
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)
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.hxx b/connectivity/source/drivers/firebird/PreparedStatement.hxx
index 986752cd66c1..81910ad1f3dd 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.hxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.hxx
@@ -64,7 +64,7 @@ namespace connectivity
* @throws css::sdbc::SQLException
* @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);
/// @throws css::sdbc::SQLException