diff options
author | Kurt Zenker <kz@openoffice.org> | 2010-10-20 16:41:18 +0200 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2010-10-20 16:41:18 +0200 |
commit | 2ac71a6dcdee4119c7b302faecbfd49c1b79652b (patch) | |
tree | 1b053619991ea27d0eed6b0cb7918584b85fef34 | |
parent | c07e7342edf658a0722ad3b0c8b4fe8da8c0742b (diff) | |
parent | 00c826fce4b50f97f85ae0cf87a897be3b36cfa6 (diff) |
CWS-TOOLING: integrate CWS dba33kooo/OOO330_m20ooo/OOO330_m19ooo/OOO330_m18ooo/OOO330_m17ooo/OOO330_m16ooo/OOO330_m15ooo/OOO330_m14ooo/OOO330_m13ooo/OOO330_m12
-rw-r--r-- | dbaccess/source/core/api/KeySet.cxx | 13 | ||||
-rw-r--r-- | dbaccess/source/core/api/KeySet.hxx | 3 | ||||
-rw-r--r-- | dbaccess/source/core/api/OptimisticSet.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSetCache.cxx | 2 |
4 files changed, 14 insertions, 9 deletions
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 1f20fd129..29c906b2f 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -200,7 +200,8 @@ void OKeySet::initColumns() void OKeySet::findTableColumnsMatching_throw( const Any& i_aTable, const ::rtl::OUString& i_rUpdateTableName, const Reference<XDatabaseMetaData>& i_xMeta, - const Reference<XNameAccess>& i_xQueryColumns) + const Reference<XNameAccess>& i_xQueryColumns, + ::std::auto_ptr<SelectColumnsMetaData>& o_pKeyColumnNames) { // first ask the database itself for the best columns which can be used Sequence< ::rtl::OUString> aBestColumnNames; @@ -242,17 +243,17 @@ void OKeySet::findTableColumnsMatching_throw( const Any& i_aTable, sUpdateTableName = dbtools::composeTableName( i_xMeta, sCatalog, sSchema, sTable, sal_False, ::dbtools::eInDataManipulation ); } - ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,sUpdateTableName,(*m_pKeyColumnNames),true); + ::dbaccess::getColumnPositions(i_xQueryColumns,aBestColumnNames,sUpdateTableName,(*o_pKeyColumnNames),true); ::dbaccess::getColumnPositions(i_xQueryColumns,xTblColumns->getElementNames(),sUpdateTableName,(*m_pColumnNames),true); ::dbaccess::getColumnPositions(i_xQueryColumns,aParameterColumns,sUpdateTableName,(*m_pParameterNames),true); - if ( m_pKeyColumnNames->empty() ) + if ( o_pKeyColumnNames->empty() ) { ::dbtools::throwGenericSQLException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Could not find any key column." ) ), *this ); } - for ( SelectColumnsMetaData::const_iterator keyColumn = m_pKeyColumnNames->begin(); - keyColumn != m_pKeyColumnNames->end(); + for ( SelectColumnsMetaData::const_iterator keyColumn = o_pKeyColumnNames->begin(); + keyColumn != o_pKeyColumnNames->end(); ++keyColumn ) { @@ -298,7 +299,7 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::O Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); Reference<XColumnsSupplier> xQueryColSup(m_xComposer,UNO_QUERY); const Reference<XNameAccess> xQueryColumns = xQueryColSup->getColumns(); - findTableColumnsMatching_throw(makeAny(m_xTable),m_sUpdateTableName,xMeta,xQueryColumns); + findTableColumnsMatching_throw(makeAny(m_xTable),m_sUpdateTableName,xMeta,xQueryColumns,m_pKeyColumnNames); // the first row is empty because it's now easier for us to distinguish when we are beforefirst or first // without extra varaible to be set diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx index 631c22340..072440c69 100644 --- a/dbaccess/source/core/api/KeySet.hxx +++ b/dbaccess/source/core/api/KeySet.hxx @@ -145,7 +145,8 @@ namespace dbaccess void findTableColumnsMatching_throw( const ::com::sun::star::uno::Any& i_aTable, const ::rtl::OUString& i_rUpdateTableName, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& i_xMeta, - const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& i_xQueryColumns); + const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& i_xQueryColumns, + ::std::auto_ptr<SelectColumnsMetaData>& o_pKeyColumnNames); ::rtl::OUStringBuffer createKeyFilter(); void tryRefetch(const ORowSetRow& _rInsertRow,bool bRefetch); void executeUpdate(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrginalRow,const ::rtl::OUString& i_sSQL,const ::rtl::OUString& i_sTableName,const ::std::vector<sal_Int32>& _aIndexColumnPositions = ::std::vector<sal_Int32>()); diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx index 832513330..091ea08af 100644 --- a/dbaccess/source/core/api/OptimisticSet.cxx +++ b/dbaccess/source/core/api/OptimisticSet.cxx @@ -124,6 +124,7 @@ void OptimisticSet::construct(const Reference< XResultSet>& _xDriverSet,const :: initColumns(); Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); + bool bCase = (xMeta.is() && xMeta->storesMixedCaseQuotedIdentifiers()) ? true : false; Reference<XColumnsSupplier> xQueryColSup(m_xComposer,UNO_QUERY); const Reference<XNameAccess> xQueryColumns = xQueryColSup->getColumns(); const Reference<XTablesSupplier> xTabSup(m_xComposer,UNO_QUERY); @@ -133,7 +134,9 @@ void OptimisticSet::construct(const Reference< XResultSet>& _xDriverSet,const :: const ::rtl::OUString* pTableNameEnd = pTableNameIter + aTableNames.getLength(); for( ; pTableNameIter != pTableNameEnd ; ++pTableNameIter) { - findTableColumnsMatching_throw(xTables->getByName(*pTableNameIter),*pTableNameIter,xMeta,xQueryColumns); + ::std::auto_ptr<SelectColumnsMetaData> pKeyColumNames(new SelectColumnsMetaData(bCase)); + findTableColumnsMatching_throw(xTables->getByName(*pTableNameIter),*pTableNameIter,xMeta,xQueryColumns,pKeyColumNames); + m_pKeyColumnNames->insert(pKeyColumNames->begin(),pKeyColumNames->end()); } // the first row is empty because it's now easier for us to distinguish when we are beforefirst or first diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 73c671258..eda4632f7 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -188,7 +188,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, } catch(const Exception&) { - DBG_UNHANDLED_EXCEPTION(); + // DBG_UNHANDLED_EXCEPTION(); } m_pCacheSet = NULL; m_xCacheSet.clear(); |