summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers/mork
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2013-09-11 21:40:41 +0100
committerFridrich Strba <fridrich@documentfoundation.org>2013-09-12 17:26:12 +0000
commit42165189826367937737861116e969a22e9db787 (patch)
tree69d8ec60869aee5981ecc4e5edbc1e3a89a625d7 /connectivity/source/drivers/mork
parenta042cdd7eff15ed5f6cbd613588b3fca9509a85e (diff)
Update implementations of ColumnLocate::findColumn to throw on invalid column.
Change-Id: I7a9354ecd35a70a005c6c50e38d27de9b33332bd Reviewed-on: https://gerrit.libreoffice.org/5922 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'connectivity/source/drivers/mork')
-rw-r--r--connectivity/source/drivers/mork/MResultSet.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx
index c439d05d5c9d..7561e727a022 100644
--- a/connectivity/source/drivers/mork/MResultSet.cxx
+++ b/connectivity/source/drivers/mork/MResultSet.cxx
@@ -177,12 +177,15 @@ sal_Int32 SAL_CALL OResultSet::findColumn( const OUString& columnName ) throw(SQ
sal_Int32 nLen = xMeta->getColumnCount();
sal_Int32 i = 1;
for(;i<=nLen;++i)
+ {
if(xMeta->isCaseSensitive(i) ? columnName == xMeta->getColumnName(i) :
columnName.equalsIgnoreAsciiCase(xMeta->getColumnName(i)))
- break;
- /* FIXME should throw in case of not found ? or at least return -1 */
+ return i;
+ }
- return i;
+ ::dbtools::throwInvalidColumnException( columnName, *this );
+ assert(false);
+ return 0; // Never reached
}
// -------------------------------------------------------------------------
Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 /*columnIndex*/ ) throw(SQLException, RuntimeException)