diff options
author | Jan Holesovsky <kendy@suse.cz> | 2010-10-24 15:26:09 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2010-10-24 15:26:09 +0200 |
commit | d10a4b873926455cd2df7d82ea3ccfe3a1b91281 (patch) | |
tree | c7907c27a07338cac3a2ebf9018b2c1422847e0f | |
parent | 72cc77c8bbbdd3a8b3b00ad6f24f26c6abb5c285 (diff) | |
parent | 2ac71a6dcdee4119c7b302faecbfd49c1b79652b (diff) |
Merge commit 'ooo/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 1da0379cc..2faec3b55 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -151,7 +151,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; @@ -193,17 +194,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 ) { @@ -249,7 +250,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 f2f301549..1cf174495 100644 --- a/dbaccess/source/core/api/KeySet.hxx +++ b/dbaccess/source/core/api/KeySet.hxx @@ -135,7 +135,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 25c6c15a3..6d5624f5c 100644 --- a/dbaccess/source/core/api/OptimisticSet.cxx +++ b/dbaccess/source/core/api/OptimisticSet.cxx @@ -125,6 +125,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); @@ -134,7 +135,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 0714c9d53..f4d7ae108 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -186,7 +186,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, } catch(const Exception&) { - DBG_UNHANDLED_EXCEPTION(); + // DBG_UNHANDLED_EXCEPTION(); } m_pCacheSet = NULL; m_xCacheSet.clear(); |