summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2013-09-19 20:02:07 +0100
committerAndrzej J.R. Hunt <andrzej@ahunt.org>2013-09-19 20:37:54 +0100
commit79f1c6e50ed303494b5c39cc6b2a448b264f7c28 (patch)
tree53467f6be653d0c8efdebd042064be59df96612e /connectivity
parent52841daec985e04bff77ee6eb1d70af0238e0eae (diff)
Use conversion for Byte/Bool.
These are both non-native to firebird, hence always have to be converted from whatever data we have. Change-Id: I6e6843d95ee4f5cf0cd5953251796150f325f800
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/ResultSet.cxx21
1 files changed, 11 insertions, 10 deletions
diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx
index c5af439ec9ba..b6df5b5b5afb 100644
--- a/connectivity/source/drivers/firebird/ResultSet.cxx
+++ b/connectivity/source/drivers/firebird/ResultSet.cxx
@@ -370,6 +370,11 @@ bool OResultSet::isNull(const sal_Int32 nColumnIndex)
ORowSetValue OResultSet::retrieveConvertibleValue(const sal_Int32 nColumnIndex)
{
+ MutexGuard aGuard(m_rMutex);
+ checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
+
+ checkColumnIndex(nColumnIndex);
+ checkRowIndex();
// See http://wiki.openoffice.org/wiki/Documentation/DevGuide/Database/Using_the_getXXX_Methods
// (bottom of page) for a chart of possible conversions, we should allow all
// of these -- Blob/Clob will probably need some specialist handling especially
@@ -549,22 +554,18 @@ sal_Bool SAL_CALL OResultSet::wasNull() throw(SQLException, RuntimeException)
}
// ---- XRow: Simple Numerical types ------------------------------------------
-sal_Bool SAL_CALL OResultSet::getBoolean(sal_Int32 columnIndex)
+sal_Bool SAL_CALL OResultSet::getBoolean(sal_Int32 nColumnIndex)
throw(SQLException, RuntimeException)
{
-// // TODO: maybe retrieve as string and test for "true", "t", "1" etc. instead?
-// return safelyRetrieveValue< bool >(columnIndex);
- (void) columnIndex;
- return sal_False;
+ // Not a native firebird type hence we always have to convert.
+ return retrieveConvertibleValue(nColumnIndex);
}
-sal_Int8 SAL_CALL OResultSet::getByte( sal_Int32 columnIndex )
+sal_Int8 SAL_CALL OResultSet::getByte(sal_Int32 nColumnIndex)
throw(SQLException, RuntimeException)
{
- // TODO: this doesn't exist in firebird, we have to always convert.
-// return safelyRetrieveValue< sal_Int8 >(columnIndex);
- (void) columnIndex;
- return 0;
+ // Not a native firebird type hence we always have to convert.
+ return retrieveConvertibleValue(nColumnIndex);
}
Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes(sal_Int32 columnIndex)