summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--connectivity/source/drivers/firebird/PreparedStatement.cxx13
-rw-r--r--connectivity/source/drivers/firebird/PreparedStatement.hxx2
2 files changed, 15 insertions, 0 deletions
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index 506e14528365..9f4637a31be2 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -207,6 +207,7 @@ void SAL_CALL OPreparedStatement::setString(sal_Int32 nParameterIndex,
ensurePrepared();
checkParameterIndex(nParameterIndex);
+ setParameterNull(nParameterIndex, false);
OString str = OUStringToOString(x , RTL_TEXTENCODING_UTF8 );
@@ -590,5 +591,17 @@ void OPreparedStatement::checkParameterIndex(sal_Int32 nParameterIndex)
// TODO: sane error message here.
}
+void OPreparedStatement::setParameterNull(sal_Int32 nParameterIndex,
+ bool bSetNull)
+{
+ XSQLVAR* pVar = m_pInSqlda->sqlvar + (nParameterIndex - 1);
+ if (pVar->sqltype & 1)
+ {
+ if (bSetNull)
+ *pVar->sqlind = -1;
+ else
+ *pVar->sqlind = 0;
+ }
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.hxx b/connectivity/source/drivers/firebird/PreparedStatement.hxx
index 8d4a0e1dd429..eca8562bcf4f 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.hxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.hxx
@@ -74,6 +74,8 @@ namespace connectivity
void checkParameterIndex(sal_Int32 nParameterIndex)
throw(::com::sun::star::sdbc::SQLException);
+ void setParameterNull(sal_Int32 nParameterIndex, bool bSetNull = true);
+
void ensurePrepared()
throw(::com::sun::star::sdbc::SQLException);