summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2015-12-18 16:54:00 +0100
committerAndras Timar <andras.timar@collabora.com>2016-01-04 12:20:41 +0100
commitea16a20b15db733cc9bf35d4fc9cd9624ed2e2ce (patch)
tree5e3b5966ceb6108c0452ee7a06e74b198c334c83 /connectivity
parentf8887d73444afe1a61beb24e3d4469f99159afbe (diff)
tdf#96572 firebird correctly transmit request for NULL
even if column is not nullable Conflicts: connectivity/source/drivers/firebird/Util.cxx Change-Id: I72ceda68e983125aef26c8f0aacc06320bd16b77 Reviewed-on: https://gerrit.libreoffice.org/20793 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 93c15f226cfd424682178883b0a525707d5303ea)
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/PreparedStatement.cxx10
-rw-r--r--connectivity/source/drivers/firebird/Util.cxx16
2 files changed, 10 insertions, 16 deletions
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index 3a783788f2ef..e4548a41e5f1 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -706,13 +706,13 @@ void OPreparedStatement::setParameterNull(sal_Int32 nParameterIndex,
bool bSetNull)
{
XSQLVAR* pVar = m_pInSqlda->sqlvar + (nParameterIndex - 1);
- if (pVar->sqltype & 1)
+ if (bSetNull)
{
- if (bSetNull)
- *pVar->sqlind = -1;
- else
- *pVar->sqlind = 0;
+ pVar->sqltype |= 1;
+ *pVar->sqlind = -1;
}
+ else
+ *pVar->sqlind = 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx
index c8f182d37924..263d1cf9a5eb 100644
--- a/connectivity/source/drivers/firebird/Util.cxx
+++ b/connectivity/source/drivers/firebird/Util.cxx
@@ -254,11 +254,8 @@ void firebird::mallocSQLVAR(XSQLDA* pSqlda)
assert(false);
break;
}
- if (pVar->sqltype & 1)
- {
- /* allocate variable to hold NULL status */
- pVar->sqlind = static_cast<short *>(malloc(sizeof(short)));
- }
+ /* allocate variable to hold NULL status */
+ pVar->sqlind = static_cast<short *>(malloc(sizeof(short)));
}
}
@@ -302,13 +299,10 @@ void firebird::freeSQLVAR(XSQLDA* pSqlda)
break;
}
- if (pVar->sqltype & 1)
+ if(pVar->sqlind)
{
- if(pVar->sqlind)
- {
- free(pVar->sqlind);
- pVar->sqlind = NULL;
- }
+ free(pVar->sqlind);
+ pVar->sqlind = NULL;
}
}
}