summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/ResultSet.cxx23
1 files changed, 20 insertions, 3 deletions
diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx
index 9409701d431f..e1b5107ae42c 100644
--- a/connectivity/source/drivers/firebird/ResultSet.cxx
+++ b/connectivity/source/drivers/firebird/ResultSet.cxx
@@ -665,10 +665,27 @@ sal_Int8 SAL_CALL OResultSet::getByte(sal_Int32 nColumnIndex)
return safelyRetrieveValue< ORowSetValue >(nColumnIndex);
}
-Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes(sal_Int32)
+Sequence< sal_Int8 > SAL_CALL OResultSet::getBytes(sal_Int32 nColumnIndex)
{
- return Sequence< sal_Int8 >(); // TODO: implement
- //return safelyRetrieveValue(columnIndex);
+ // &~1 to remove the "can contain NULL" indicator
+ int aSqlType = m_pSqlda->sqlvar[nColumnIndex-1].sqltype & ~1;
+ if ( aSqlType == SQL_BLOB )
+ {
+ Reference< XBlob> xBlob = getBlob(nColumnIndex);
+ if (xBlob.is())
+ {
+ sal_Int32 aBlobLength = static_cast<sal_Int32>(xBlob->length());
+ return xBlob->getBytes(1, aBlobLength);
+ }
+ else
+ return Sequence< sal_Int8 >();
+ }
+ // TODO implement SQL_VARYING and SQL_TEXT
+ // as it's the counterpart as OPreparedStatement::setBytes
+ else
+ {
+ return Sequence< sal_Int8 >(); // TODO: implement
+ }
}
sal_Int16 SAL_CALL OResultSet::getShort(sal_Int32 columnIndex)