diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-10 16:12:10 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-09-10 18:53:57 +0200 |
commit | ccea340276609c87384ee7fff4837e48baaba9b5 (patch) | |
tree | 01b9d5b5bf8187262bbcb77c21e810ca18be150c /offapi | |
parent | c9517311f4c209f549668867c9b07ffa18246dee (diff) |
Clarify that css::sdbc::XClob::getSubString takes 1-based pos
... and fix connectivity::firebird::Clob::getSubString.
XClob::getSubString is modelled after JDBC counterpart, that also
takes 1-based position argument. This is also described in multiple
places in our code:
- OPreparedStatement::setClob
in connectivity/source/drivers/firebird/PreparedStatement.cxx
- OSingleSelectQueryComposer::setConditionByColumn
in dbaccess/source/core/api/SingleSelectQueryComposer.cxx
- ORowSetValue::getString
in connectivity/source/commontools/FValue.cxx
However in some places 0-based value was used (fixed here).
To clarify, the mention that the pos argument is 1-based is put
to the corresponding IDL file.
Also the code in connectivity::firebird::Clob::getSubString had
multiple issues:
- no checks of arguments;
- possibility to throw "nPosition out of range" when just-read
segment has enough data;
- wrong start position in case when nPosition is not aligned to
segment boundary.
This change fixes these, and simplifies the implementation.
Change-Id: I119a62dd7f02c9569ce36395ed8cc1a98c931fcf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121884
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'offapi')
-rw-r--r-- | offapi/com/sun/star/sdbc/XClob.idl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/offapi/com/sun/star/sdbc/XClob.idl b/offapi/com/sun/star/sdbc/XClob.idl index bc0d2bc81f0c..045dfc981768 100644 --- a/offapi/com/sun/star/sdbc/XClob.idl +++ b/offapi/com/sun/star/sdbc/XClob.idl @@ -117,7 +117,7 @@ published interface XClob: com::sun::star::uno::XInterface consecutive characters. </p> @param pos - the starting position + the starting position, 1-based @param length the length of the substring @returns |