summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2013-08-30 11:14:59 +0100
committerAndrzej J.R. Hunt <andrzej@ahunt.org>2013-08-30 11:33:12 +0100
commit437dd0369a759e32ef8788b1829bc3b355952518 (patch)
treeeac52ace221b75197450a9f189ede2d05268903d /connectivity
parent3f56234ecb4b8b07becfdcbbc3d7facbd95e6f60 (diff)
Cast pointer before dereferencing. (firebird-sdbc)
We have a char* pointing to arbitrary data hence we need to cast to the right type, othwerwise we retrieve the first byte only. Change-Id: I6d3d08d15105a506c140044008c5255a8a8e4c39
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/ResultSet.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx
index 21d4152e75fa..7b106c3f7d87 100644
--- a/connectivity/source/drivers/firebird/ResultSet.cxx
+++ b/connectivity/source/drivers/firebird/ResultSet.cxx
@@ -361,10 +361,11 @@ bool OResultSet::isNull(sal_Int32 columnIndex)
template <typename T>
T OResultSet::retrieveValue(sal_Int32 columnIndex)
{
+ // TODO: check we have the right type.
if ((m_bWasNull = isNull(columnIndex)))
return 0;
- return *m_pSqlda->sqlvar[columnIndex-1].sqldata;
+ return *((T*) m_pSqlda->sqlvar[columnIndex-1].sqldata);
}
template <>