From 42165189826367937737861116e969a22e9db787 Mon Sep 17 00:00:00 2001 From: "Andrzej J.R. Hunt" Date: Wed, 11 Sep 2013 21:40:41 +0100 Subject: Update implementations of ColumnLocate::findColumn to throw on invalid column. Change-Id: I7a9354ecd35a70a005c6c50e38d27de9b33332bd Reviewed-on: https://gerrit.libreoffice.org/5922 Reviewed-by: Fridrich Strba Tested-by: Fridrich Strba --- connectivity/source/drivers/firebird/ResultSet.cxx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'connectivity/source/drivers/firebird') diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx index cbbd4d58dac9..99051fe423c6 100644 --- a/connectivity/source/drivers/firebird/ResultSet.cxx +++ b/connectivity/source/drivers/firebird/ResultSet.cxx @@ -331,15 +331,9 @@ sal_Int32 SAL_CALL OResultSet::findColumn(const OUString& rColumnName) return i; } - // The API documentation (XRowLocate) doesn't specify what should happen - // if the column name isn't found. The JDBC api specifies that an SQLException - // should be thrown. Most drivers return either -1 (some don't check for this - // case and just return nLen), however the JDBC specification seems more - // correct (in the case of the JDBC/HSQLDB drivers the SQLException is - // just propagated from the JDBC call, hence should be expected by any - // SDBC user too). - ::dbtools::throwSQLException("Invalid column name", SQL_COLUMN_NOT_FOUND, *this); - return -1; // Never reached + ::dbtools::throwInvalidColumnException(rColumnName, *this); + assert(false); + return 0; // Never reached } // ------------------------------------------------------------------------- uno::Reference< XInputStream > SAL_CALL OResultSet::getBinaryStream( sal_Int32 columnIndex ) throw(SQLException, RuntimeException) -- cgit