summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2007-05-10 08:38:15 +0000
committerKurt Zenker <kz@openoffice.org>2007-05-10 08:38:15 +0000
commitbbc9188d40be5ffb183dee9269271a73f8fb535c (patch)
treed148064df37f0fe5606d9d278a84ab6ec58df2b4
parent4cd812bd37361f16117fb23738fc7b9352898dfb (diff)
INTEGRATION: CWS dba23a (1.10.74); FILE MERGED
2007/03/14 12:15:22 fs 1.10.74.1: #i75261# alterColumnType: don't append the column name, this will be done by ::dbtools::createStandardColumnPart (and two names are invalid HSQL syntax)
-rw-r--r--connectivity/source/drivers/hsqldb/HTable.cxx31
1 files changed, 26 insertions, 5 deletions
diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx
index e981f9ba7b45..3f4286a653e5 100644
--- a/connectivity/source/drivers/hsqldb/HTable.cxx
+++ b/connectivity/source/drivers/hsqldb/HTable.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: HTable.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: obo $ $Date: 2006-09-17 02:41:11 $
+ * last change: $Author: kz $ $Date: 2007-05-10 09:38:15 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -98,6 +98,8 @@
#include "TConnection.hxx"
#endif
+#include <tools/diagnose_ex.h>
+
using namespace ::comphelper;
using namespace connectivity::hsqldb;
@@ -319,8 +321,22 @@ void OHSQLTable::alterColumnType(sal_Int32 nNewType,const ::rtl::OUString& _rCol
::rtl::OUString sSql = getAlterTableColumnPart();
sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ALTER COLUMN "));
- sSql += ::dbtools::quoteName( getMetaData()->getIdentifierQuoteString(), _rColName );
- sSql += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
+#if OSL_DEBUG_LEVEL > 0
+ try
+ {
+ ::rtl::OUString sDescriptorName;
+ OSL_ENSURE( _xDescriptor.is()
+ && ( _xDescriptor->getPropertyValue( OMetaConnection::getPropMap().getNameByIndex( PROPERTY_ID_NAME ) ) >>= sDescriptorName )
+ && ( sDescriptorName == _rColName ),
+ "OHSQLTable::alterColumnType: unexpected column name!" );
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+#else
+ (void)_rColName;
+#endif
OHSQLColumn* pColumn = new OHSQLColumn(sal_True);
Reference<XPropertySet> xProp = pColumn;
@@ -376,7 +392,12 @@ void OHSQLTable::executeStatement(const ::rtl::OUString& _rStatement )
Reference< XStatement > xStmt = getConnection()->createStatement( );
if ( xStmt.is() )
{
- xStmt->execute(sSQL);
+ try { xStmt->execute(sSQL); }
+ catch( const Exception& )
+ {
+ ::comphelper::disposeComponent(xStmt);
+ throw;
+ }
::comphelper::disposeComponent(xStmt);
}
}