[Libreoffice-commits] core.git: connectivity/source
Julien Nabet (via logerrit)
logerrit at kemper.freedesktop.org
Mon Nov 16 19:57:32 UTC 2020
connectivity/source/drivers/firebird/ResultSet.cxx | 23 ++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
New commits:
commit 61560ae7d6f00ba6b410f7779e9a46cf692a5400
Author: Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Sun Nov 15 15:45:26 2020 +0100
Commit: Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Mon Nov 16 20:56:29 2020 +0100
tdf#121886: Firebird Datatype Image(BLOB) is not working properly
with Form or Report image controls.
Implements getBytes at least when LONGVARBINARY corresponds to a BLOB
Change-Id: I7e4e99b537333558d5c3dcd172dc54e73472553b
Change-Id: I86c20310235fb4902633fab058066a1f2d62a600
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105899
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
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)
More information about the Libreoffice-commits
mailing list