Kaydet (Commit) 3ac3aff8 authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

tdf#96572 firebird correctly transmit request for NULL

even if column is not nullable

Change-Id: I72ceda68e983125aef26c8f0aacc06320bd16b77
üst 0996f40f
...@@ -706,13 +706,13 @@ void OPreparedStatement::setParameterNull(sal_Int32 nParameterIndex, ...@@ -706,13 +706,13 @@ void OPreparedStatement::setParameterNull(sal_Int32 nParameterIndex,
bool bSetNull) bool bSetNull)
{ {
XSQLVAR* pVar = m_pInSqlda->sqlvar + (nParameterIndex - 1); XSQLVAR* pVar = m_pInSqlda->sqlvar + (nParameterIndex - 1);
if (pVar->sqltype & 1) if (bSetNull)
{ {
if (bSetNull) pVar->sqltype |= 1;
*pVar->sqlind = -1; *pVar->sqlind = -1;
else
*pVar->sqlind = 0;
} }
else
*pVar->sqlind = 0;
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -254,11 +254,8 @@ void firebird::mallocSQLVAR(XSQLDA* pSqlda) ...@@ -254,11 +254,8 @@ void firebird::mallocSQLVAR(XSQLDA* pSqlda)
assert(false); assert(false);
break; 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) ...@@ -302,13 +299,10 @@ void firebird::freeSQLVAR(XSQLDA* pSqlda)
break; break;
} }
if (pVar->sqltype & 1) if(pVar->sqlind)
{ {
if(pVar->sqlind) free(pVar->sqlind);
{ pVar->sqlind = nullptr;
free(pVar->sqlind);
pVar->sqlind = nullptr;
}
} }
} }
} }
......
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