diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-11-01 15:58:31 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-11-01 15:58:31 +0100 |
commit | c3a8753eb49072715f467c6478823e16d0d20a4c (patch) | |
tree | 10fe9202ed28685d8bd5746e92f2b53e94878595 /dbaccess/source/core | |
parent | 14e356fa33c96e3175ed60937a4a4610b22de9f8 (diff) | |
parent | 2ac71a6dcdee4119c7b302faecbfd49c1b79652b (diff) |
#i10000# changes from OOO330 m13ooo/DEV300_m92
Diffstat (limited to 'dbaccess/source/core')
-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(); |