[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - connectivity/source

Julien Nabet serval2412 at yahoo.fr
Tue Jan 2 15:34:08 UTC 2018


 connectivity/source/drivers/firebird/PreparedStatement.cxx |    8 +++++---
 connectivity/source/drivers/firebird/PreparedStatement.hxx |    2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit d4469196a2072d2d3fa2e433d02552facaa269f2
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon Jan 1 16:59:58 2018 +0100

    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 at libreoffice.org>
    (cherry picked from commit f31ccd18f1b142f8c851e7e219f8bc18b157bc52)
    
    Change-Id: Ia1154ee068b02f40e7efa21571036d8b49844859
    Reviewed-on: https://gerrit.libreoffice.org/47237
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

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


More information about the Libreoffice-commits mailing list