Tag: cws_src680_dba22ui User: fs Date: 2006/12/05 01:46:59 Modified: dba/connectivity/inc/connectivity/dbmetadata.hxx dba/connectivity/inc/connectivity/dbtools.hxx dba/connectivity/inc/connectivity/sqliterator.hxx dba/connectivity/inc/connectivity/sqlnode.hxx dba/connectivity/inc/connectivity/virtualdbtools.hxx dba/connectivity/source/commontools/TIndexes.cxx dba/connectivity/source/commontools/dbmetadata.cxx dba/connectivity/source/commontools/dbtools.cxx dba/connectivity/source/commontools/dbtools2.cxx dba/connectivity/source/commontools/predicateinput.cxx dba/connectivity/source/drivers/ado/APreparedStatement.cxx dba/connectivity/source/drivers/file/FStatement.cxx dba/connectivity/source/drivers/jdbc/Connection.cxx dba/connectivity/source/drivers/mozab/MStatement.cxx dba/connectivity/source/drivers/odbc/OPreparedStatement.cxx dba/connectivity/source/parse/sqliterator.cxx dba/connectivity/source/parse/sqlnode.cxx dba/connectivity/source/simpledbt/parsenode_s.cxx dba/connectivity/source/simpledbt/parsenode_s.hxx dba/connectivity/source/simpledbt/staticdbtools_s.cxx dba/connectivity/source/simpledbt/staticdbtools_s.hxx
Log: copying the fix for #i72252# from CWS dba22b to dba22ui - intended for the latter, but wrongly checked in into the former File Changes: Directory: /dba/connectivity/inc/connectivity/ ============================================== File [changed]: dbmetadata.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/inc/connectivity/dbmetadata.hxx?r1=1.3&r2=1.3.60.1 Delta lines: +17 -3 -------------------- --- dbmetadata.hxx 26 Jul 2006 07:20:57 -0000 1.3 +++ dbmetadata.hxx 5 Dec 2006 09:46:52 -0000 1.3.60.1 @@ -4,9 +4,9 @@ * * $RCSfile: dbmetadata.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.60.1 $ * - * last change: $Author: rt $ $Date: 2006/07/26 07:20:57 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:52 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -108,6 +108,12 @@ *this = DatabaseMetaData( _connection ); } + /// wraps XDatabaseMetaData::getIdentifierQuoteString + const ::rtl::OUString& SAL_CALL getIdentifierQuoteString() const; + + /// wraps XDatabaseMetaData::getCatalogSeparator + const ::rtl::OUString& SAL_CALL getCatalogSeparator() const; + /** determines whether the database supports sub queries in the FROM part of a SELECT clause are supported. @throws ::com::sun::star::sdbc::SQLException @@ -122,6 +128,14 @@ if present. */ bool SAL_CALL restrictIdentifiersToSQL92() const; + + /** determines whether when generating SQL statements, an AS keyword should be generated + before a correlation name. + + E.g., it determines whether <code>SELECT * FROM table AS correlation_name</code> or + <code>SELECT * FROM table correlation_name</code> is generated. + */ + bool SAL_CALL generateASBeforeCorrelationName() const; }; //........................................................................ File [changed]: dbtools.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/inc/connectivity/dbtools.hxx?r1=1.31&r2=1.31.70.1 Delta lines: +15 -11 --------------------- --- dbtools.hxx 10 Jul 2006 14:16:27 -0000 1.31 +++ dbtools.hxx 5 Dec 2006 09:46:52 -0000 1.31.70.1 @@ -4,9 +4,9 @@ * * $RCSfile: dbtools.hxx,v $ * - * $Revision: 1.31 $ + * $Revision: 1.31.70.1 $ * - * last change: $Author: obo $ $Date: 2006/07/10 14:16:27 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:52 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -335,15 +335,19 @@ */ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource> findDataSource(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xParent); + /** determines the value of a booolean data source setting, given by ASCII name + + @param _rxConnection + the connection belonging to the data source whose setting is to be retrieved + @param _pAsciiSettingName + the ASCII name of the setting + */ + bool getBooleanDataSourceSetting( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const sal_Char* _pAsciiSettingName ); + /** check if a specific property is enabled in the info sequence - @param _xProp - The datasource or a child of it. - @param _sProperty - The property to search in the info property of the data source. - @param _bDefault - This value will be returned, if the property doesn't exist in the data source. - @return - <TRUE/> if so otherwise <FALSE/> + @deprecated + Use getBooleanDataSourceSetting instead, which cares for the default of the property itself, + instead of spreading this knowledge through all callers. */ sal_Bool isDataSourcePropertyEnabled(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xProp ,const ::rtl::OUString& _sProperty, File [changed]: sqliterator.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/inc/connectivity/sqliterator.hxx?r1=1.22&r2=1.22.70.1 Delta lines: +4 -7 ------------------- --- sqliterator.hxx 10 Jul 2006 14:16:38 -0000 1.22 +++ sqliterator.hxx 5 Dec 2006 09:46:52 -0000 1.22.70.1 @@ -4,9 +4,9 @@ * * $RCSfile: sqliterator.hxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.22.70.1 $ * - * last change: $Author: obo $ $Date: 2006/07/10 14:16:38 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:52 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -44,9 +44,6 @@ #ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_ #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #endif -#ifndef _COM_SUN_STAR_SDBC_XDATABASEMETADATA_HPP_ -#include <com/sun/star/sdbc/XDatabaseMetaData.hpp> -#endif #ifndef _COM_SUN_STAR_SDBC_DATATYPE_HPP_ #include <com/sun/star/sdbc/DataType.hpp> #endif @@ -293,7 +290,7 @@ The table range to be set. */ static void getColumnRange( const OSQLParseNode* _pColumnRef, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData>& _xMetaData, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, ::rtl::OUString &_rColumnName, ::rtl::OUString& _rTableRange); File [changed]: sqlnode.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/inc/connectivity/sqlnode.hxx?r1=1.19&r2=1.19.70.1 Delta lines: +14 -23 --------------------- --- sqlnode.hxx 10 Jul 2006 14:16:48 -0000 1.19 +++ sqlnode.hxx 5 Dec 2006 09:46:52 -0000 1.19.70.1 @@ -4,9 +4,9 @@ * * $RCSfile: sqlnode.hxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.19.70.1 $ * - * last change: $Author: obo $ $Date: 2006/07/10 14:16:48 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:52 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -35,8 +35,10 @@ #ifndef _CONNECTIVITY_SQLNODE_HXX #define _CONNECTIVITY_SQLNODE_HXX -#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_ -#include <com/sun/star/uno/Reference.h> +#include "connectivity/dbmetadata.hxx" + +#ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_ +#include <com/sun/star/uno/Reference.hxx> #endif #ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTYPES_HPP_ #include <com/sun/star/util/XNumberFormatTypes.hpp> @@ -44,9 +46,6 @@ #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> #endif -#ifndef _COM_SUN_STAR_SDBC_XDATABASEMETADATA_HPP_ -#include <com/sun/star/sdbc/XDatabaseMetaData.hpp> -#endif #include <vector> #include <functional> #include <set> @@ -59,10 +58,6 @@ { namespace star { - namespace sdbc - { - class XDatabaseMetaData; - } namespace beans { class XPropertySet; @@ -100,8 +95,7 @@ struct SQLParseNodeParameter { const ::com::sun::star::lang::Locale& rLocale; - const ::rtl::OUString aIdentifierQuote; - const ::rtl::OUString aCatalogSeparator; + ::dbtools::DatabaseMetaData aMetaData; OSQLParser* pParser; ::boost::shared_ptr< QueryNameSet > pSubQueryHistory; ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > xFormatter; @@ -113,11 +107,9 @@ bool bInternational : 1; /// should we internationalize keywords and placeholders? bool bPredicate : 1; /// are we going to parse a mere predicate? bool bParseToSDBCLevel : 1; /// should we create an SDBC-level statement (e.g. with substituted sub queries)? - bool bCaseSensistiveIdentCompare : 1; /// should identifiers be compared case-sensitively? SQLParseNodeParameter( - const ::rtl::OUString& _rIdentifierQuote, - const ::rtl::OUString& _rCatalogSep, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _xFormatter, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xField, const ::com::sun::star::lang::Locale& _rLocale, @@ -126,8 +118,7 @@ bool _bQuote, sal_Char _cDecSep, bool _bPredicate, - bool _bParseToSDBC, - bool _bCaseSensistiveIdentCompare + bool _bParseToSDBC ); ~SQLParseNodeParameter(); }; @@ -331,21 +322,21 @@ ::com::sun::star::sdbc::SQLException* _pErrorHolder ) const; void parseNodeToStr(::rtl::OUString& rString, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > & xMeta, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const IParseContext* pContext = NULL, sal_Bool _bIntl = sal_False, sal_Bool _bQuote= sal_True) const; // quoted und internationalisert void parseNodeToPredicateStr(::rtl::OUString& rString, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > & xMeta, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > & xFormatter, const ::com::sun::star::lang::Locale& rIntl, sal_Char _cDec, const IParseContext* pContext = NULL ) const; void parseNodeToPredicateStr(::rtl::OUString& rString, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > & xMeta, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > & xFormatter, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & _xField, const ::com::sun::star::lang::Locale& rIntl, @@ -425,7 +416,7 @@ protected: // ParseNodeToStr konkateniert alle Token (Blaetter) des ParseNodes void parseNodeToStr(::rtl::OUString& rString, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > & xMeta, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > & xFormatter, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & _xField, const ::com::sun::star::lang::Locale& rIntl, File [changed]: virtualdbtools.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/inc/connectivity/virtualdbtools.hxx?r1=1.12&r2=1.12.70.1 Delta lines: +5 -19 -------------------- --- virtualdbtools.hxx 10 Jul 2006 14:17:11 -0000 1.12 +++ virtualdbtools.hxx 5 Dec 2006 09:46:52 -0000 1.12.70.1 @@ -4,9 +4,9 @@ * * $RCSfile: virtualdbtools.hxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.12.70.1 $ * - * last change: $Author: obo $ $Date: 2006/07/10 14:17:11 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:52 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -230,20 +230,6 @@ */ virtual sal_Bool canDelete(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxCursorSet) const = 0; - /** check if a specific property is enabled in the info sequence - @param _xProp - The datasource or a child of it. - @param _sProperty - The property to search in the info property of the data source. - @param _bDefault - This value will be returned, if the property doesn't exist in the data source. - @return - <TRUE/> if so otherwise <FALSE/> - */ - virtual sal_Bool isDataSourcePropertyEnabled(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xProp - ,const ::rtl::OUString& _sProperty, - sal_Bool _bDefault = sal_False) const = 0; - /** determines whether the given component is part of a document which is an embedded database document (such as a form) */ @@ -307,12 +293,12 @@ { public: virtual void parseNodeToStr(::rtl::OUString& _rString, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxMeta, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const IParseContext* _pContext ) const = 0; virtual void parseNodeToPredicateStr(::rtl::OUString& _rString, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxMeta, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxField, const ::com::sun::star::lang::Locale& _rIntl, Directory: /dba/connectivity/source/commontools/ ================================================ File [changed]: TIndexes.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/TIndexes.cxx?r1=1.10&r2=1.10.20.1 Delta lines: +4 -4 ------------------- --- TIndexes.cxx 17 Sep 2006 02:00:00 -0000 1.10 +++ TIndexes.cxx 5 Dec 2006 09:46:53 -0000 1.10.20.1 @@ -4,9 +4,9 @@ * * $RCSfile: TIndexes.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.10.20.1 $ * - * last change: $Author: obo $ $Date: 2006/09/17 02:00:00 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:53 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -186,7 +186,7 @@ Reference<XColumnsSupplier> xColumnSup(descriptor,UNO_QUERY); Reference<XIndexAccess> xColumns(xColumnSup->getColumns(),UNO_QUERY); Reference< XPropertySet > xColProp; - sal_Bool bAddIndexAppendix = ::dbtools::isDataSourcePropertyEnabled(m_pTable->getConnection(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AddIndexAppendix")),sal_True); + sal_Bool bAddIndexAppendix = ::dbtools::getBooleanDataSourceSetting( m_pTable->getConnection(), "AddIndexAppendix" ); sal_Int32 nCount = xColumns->getCount(); for(sal_Int32 i = 0 ; i < nCount; ++i) { File [changed]: dbmetadata.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/dbmetadata.cxx?r1=1.4&r2=1.4.20.1 Delta lines: +68 -18 --------------------- --- dbmetadata.cxx 17 Sep 2006 02:02:44 -0000 1.4 +++ dbmetadata.cxx 5 Dec 2006 09:46:53 -0000 1.4.20.1 @@ -4,9 +4,9 @@ * * $RCSfile: dbmetadata.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.4.20.1 $ * - * last change: $Author: obo $ $Date: 2006/09/17 02:02:44 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:53 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -56,12 +56,17 @@ #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ #include <com/sun/star/beans/PropertyValue.hpp> #endif +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_ +#include <com/sun/star/beans/XPropertySetInfo.hpp> +#endif /** === end UNO includes === **/ #ifndef TOOLS_DIAGNOSE_EX_H #include <tools/diagnose_ex.h> #endif +#include <boost/optional.hpp> + //........................................................................ namespace dbtools { @@ -80,6 +85,7 @@ using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::uno::Sequence; using ::com::sun::star::beans::PropertyValue; + using ::com::sun::star::beans::XPropertySetInfo; /** === end UNO using === **/ //==================================================================== @@ -89,11 +95,15 @@ { Reference< XConnection > xConnection; Reference< XDatabaseMetaData > xConnectionMetaData; + + ::boost::optional< ::rtl::OUString > sCachedIdentifierQuoteString; + ::boost::optional< ::rtl::OUString > sCachedCatalogSeparator; }; //-------------------------------------------------------------------- namespace { + //................................................................ static void lcl_construct( DatabaseMetaData_Impl& _metaDataImpl, const Reference< XConnection >& _connection ) { _metaDataImpl.xConnection = _connection; @@ -105,12 +115,14 @@ throw IllegalArgumentException(); } - static void lcl_checkConnected( DatabaseMetaData_Impl& _metaDataImpl ) + //................................................................ + static void lcl_checkConnected( const DatabaseMetaData_Impl& _metaDataImpl ) { - if ( !_metaDataImpl.xConnection.is() ) + if ( !_metaDataImpl.xConnection.is() || !_metaDataImpl.xConnectionMetaData.is() ) throwSQLException( "not connected", SQL_CONNECTION_DOES_NOT_EXIST, NULL ); } + //................................................................ static bool lcl_getDataSourceSetting( const sal_Char* _asciiName, const DatabaseMetaData_Impl& _metaData, Any& _out_setting ) { try @@ -118,26 +130,40 @@ Reference< XChild > connectionAsChild( _metaData.xConnection, UNO_QUERY_THROW ); Reference< XPropertySet > dataSource( connectionAsChild->getParent(), UNO_QUERY_THROW ); - Sequence< PropertyValue > dataSourceSettings; - OSL_VERIFY( dataSource->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Info" ) ) ) >>= dataSourceSettings ); - - const PropertyValue* setting( dataSourceSettings.getConstArray() ); - const PropertyValue* settingEnd( setting + dataSourceSettings.getLength() ); - for ( ; setting != settingEnd; ++setting ) - { - if ( setting->Name.equalsAscii( _asciiName ) ) - { - _out_setting = setting->Value; + Reference< XPropertySet > xDataSourceSettings( + dataSource->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Settings" ) ) ), + UNO_QUERY_THROW ); + + Reference< XPropertySetInfo > xPSI( xDataSourceSettings->getPropertySetInfo() ); + ::rtl::OUString sPropertyName( ::rtl::OUString::createFromAscii( _asciiName ) ); + if ( xPSI.is() && xPSI->hasPropertyByName( sPropertyName ) ) + _out_setting = xDataSourceSettings->getPropertyValue( sPropertyName ); return true; } - } - } catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } return false; } + + //................................................................ + static const ::rtl::OUString& lcl_getConnectionStringSetting( + const DatabaseMetaData_Impl& _metaData, ::boost::optional< ::rtl::OUString >& _cachedSetting, + ::rtl::OUString (SAL_CALL XDatabaseMetaData::*_getter)() ) + { + lcl_checkConnected( _metaData ); + + if ( !_cachedSetting ) + { + try + { + _cachedSetting.reset( (_metaData.xConnectionMetaData.get()->*_getter)() ); + } + catch( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } + } + return *_cachedSetting; + } } //==================================================================== @@ -204,11 +230,35 @@ } //-------------------------------------------------------------------- + const ::rtl::OUString& SAL_CALL DatabaseMetaData::getIdentifierQuoteString() const + { + return lcl_getConnectionStringSetting( *m_pImpl, m_pImpl->sCachedIdentifierQuoteString, &XDatabaseMetaData::getIdentifierQuoteString ); + } + + //-------------------------------------------------------------------- + const ::rtl::OUString& SAL_CALL DatabaseMetaData::getCatalogSeparator() const + { + return lcl_getConnectionStringSetting( *m_pImpl, m_pImpl->sCachedCatalogSeparator, &XDatabaseMetaData::getCatalogSeparator ); + } + + //-------------------------------------------------------------------- bool SAL_CALL DatabaseMetaData::restrictIdentifiersToSQL92() const { + lcl_checkConnected( *m_pImpl ); + bool restrict( false ); Any setting; if ( lcl_getDataSourceSetting( "EnableSQL92Check", *m_pImpl, setting ) ) + OSL_VERIFY( setting >>= restrict ); + return restrict; + } + + //-------------------------------------------------------------------- + bool SAL_CALL DatabaseMetaData::generateASBeforeCorrelationName() const + { + bool restrict( false ); + Any setting; + if ( lcl_getDataSourceSetting( "GenerateASBeforeCorrelationName", *m_pImpl, setting ) ) OSL_VERIFY( setting >>= restrict ); return restrict; } File [changed]: dbtools.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/dbtools.cxx?r1=1.67&r2=1.67.2.1 Delta lines: +5 -5 ------------------- --- dbtools.cxx 21 Nov 2006 16:59:34 -0000 1.67 +++ dbtools.cxx 5 Dec 2006 09:46:53 -0000 1.67.2.1 @@ -4,9 +4,9 @@ * * $RCSfile: dbtools.cxx,v $ * - * $Revision: 1.67 $ + * $Revision: 1.67.2.1 $ * - * last change: $Author: vg $ $Date: 2006/11/21 16:59:34 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:53 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1529,8 +1529,8 @@ ::rtl::OUString composeTableNameForSelect( const Reference< XConnection >& _rxConnection, const ::rtl::OUString& _rCatalog, const ::rtl::OUString& _rSchema, const ::rtl::OUString& _rName ) { - sal_Bool bUseCatalogInSelect = isDataSourcePropertyEnabled( _rxConnection, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseCatalogInSelect" ) ), sal_True ); - sal_Bool bUseSchemaInSelect = isDataSourcePropertyEnabled( _rxConnection, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseSchemaInSelect" ) ), sal_True ); + bool bUseCatalogInSelect = getBooleanDataSourceSetting( _rxConnection, "UseCatalogInSelect" ); + bool bUseSchemaInSelect = getBooleanDataSourceSetting( _rxConnection, "UseSchemaInSelect" ); return impl_doComposeTableName( _rxConnection->getMetaData(), File [changed]: dbtools2.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/dbtools2.cxx?r1=1.19.14.1&r2=1.19.14.2 Delta lines: +30 -3 -------------------- --- dbtools2.cxx 25 Oct 2006 10:20:29 -0000 1.19.14.1 +++ dbtools2.cxx 5 Dec 2006 09:46:53 -0000 1.19.14.2 @@ -4,9 +4,9 @@ * * $RCSfile: dbtools2.cxx,v $ * - * $Revision: 1.19.14.1 $ + * $Revision: 1.19.14.2 $ * - * last change: $Author: fs $ $Date: 2006/10/25 10:20:29 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:53 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -103,6 +103,8 @@ #include <com/sun/star/container/XChild.hpp> #endif +#include <tools/diagnose_ex.h> + //......................................................................... namespace dbtools { @@ -577,6 +579,31 @@ return xProp; } + +// ----------------------------------------------------------------------------- +bool getBooleanDataSourceSetting( const Reference< XConnection >& _rxConnection, const sal_Char* _pAsciiSettingName ) +{ + bool bValue( false ); + try + { + Reference< XPropertySet> xDataSourceProperties( findDataSource( _rxConnection ), UNO_QUERY ); + OSL_ENSURE( xDataSourceProperties.is(), "::dbtools::getBooleanDataSourceSetting: somebody is using this with a non-SDB-level connection!" ); + if ( xDataSourceProperties.is() ) + { + Reference< XPropertySet > xSettings( + xDataSourceProperties->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Settings") ) ), + UNO_QUERY_THROW + ); + OSL_VERIFY( xSettings->getPropertyValue( ::rtl::OUString::createFromAscii( _pAsciiSettingName ) ) >>= bValue ); + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return bValue; +} + // ----------------------------------------------------------------------------- sal_Bool isDataSourcePropertyEnabled(const Reference<XInterface>& _xProp,const ::rtl::OUString& _sProperty,sal_Bool _bDefault) { @@ -597,7 +624,7 @@ } catch(SQLException&) { - OSL_ASSERT(!"isDataSourcePropertyEnabled"); + DBG_UNHANDLED_EXCEPTION(); } return bEnabled; } File [changed]: predicateinput.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/predicateinput.cxx?r1=1.8&r2=1.8.20.1 Delta lines: +7 -7 ------------------- --- predicateinput.cxx 17 Sep 2006 02:03:26 -0000 1.8 +++ predicateinput.cxx 5 Dec 2006 09:46:53 -0000 1.8.20.1 @@ -4,9 +4,9 @@ * * $RCSfile: predicateinput.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.8.20.1 $ * - * last change: $Author: obo $ $Date: 2006/09/17 02:03:26 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:53 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -293,7 +293,7 @@ // translate it back into a string sTransformedText = ::rtl::OUString(); pParseNode->parseNodeToPredicateStr( - sTransformedText, m_xConnection->getMetaData(), m_xFormatter, _rxField, + sTransformedText, m_xConnection, m_xFormatter, _rxField, rParseContext.getPreferredLocale(), (sal_Char)nDecSeparator, &rParseContext ); _rPredicateValue = sTransformedText; @@ -372,7 +372,7 @@ OSL_ENSURE( pFuncSpecParent, "OPredicateInputController::getPredicateValue: an ODBC func spec node without parent?" ); if ( pFuncSpecParent ) pFuncSpecParent->parseNodeToStr( - sReturn, m_xConnection->getMetaData(), &m_aParser.getContext(), sal_False, sal_True + sReturn, m_xConnection, &m_aParser.getContext(), sal_False, sal_True ); } } @@ -388,12 +388,12 @@ sReturn = pValueNode->getTokenValue(); else pValueNode->parseNodeToStr( - sReturn, m_xConnection->getMetaData(), &m_aParser.getContext(), sal_False, sal_True + sReturn, m_xConnection, &m_aParser.getContext(), sal_False, sal_True ); } else pValueNode->parseNodeToStr( - sReturn, m_xConnection->getMetaData(), &m_aParser.getContext(), sal_False, sal_True + sReturn, m_xConnection, &m_aParser.getContext(), sal_False, sal_True ); } else Directory: /dba/connectivity/source/drivers/ado/ ================================================ File [changed]: APreparedStatement.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/ado/APreparedStatement.cxx?r1=1.21&r2=1.21.12.1 Delta lines: +4 -4 ------------------- --- APreparedStatement.cxx 6 Nov 2006 14:34:33 -0000 1.21 +++ APreparedStatement.cxx 5 Dec 2006 09:46:54 -0000 1.21.12.1 @@ -4,9 +4,9 @@ * * $RCSfile: APreparedStatement.cxx,v $ * - * $Revision: 1.21 $ + * $Revision: 1.21.12.1 $ * - * last change: $Author: kz $ $Date: 2006/11/06 14:34:33 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:54 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -101,7 +101,7 @@ sal_Int32 nParameterCount = 0; ::rtl::OUString sDefaultName = ::rtl::OUString::createFromAscii("parame"); replaceParameterNodeName(pNode,sDefaultName,nParameterCount); - pNode->parseNodeToStr(sNewSql,_pConnection->getMetaData()); + pNode->parseNodeToStr( sNewSql, _pConnection ); delete pNode; } else Directory: /dba/connectivity/source/drivers/file/ ================================================= File [changed]: FStatement.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/file/FStatement.cxx?r1=1.42&r2=1.42.20.1 Delta lines: +4 -4 ------------------- --- FStatement.cxx 17 Sep 2006 02:34:18 -0000 1.42 +++ FStatement.cxx 5 Dec 2006 09:46:54 -0000 1.42.20.1 @@ -4,9 +4,9 @@ * * $RCSfile: FStatement.cxx,v $ * - * $Revision: 1.42 $ + * $Revision: 1.42.20.1 $ * - * last change: $Author: obo $ $Date: 2006/09/17 02:34:18 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:54 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -460,7 +460,7 @@ // 0, String() ); // return; // } - pColumnRef->getChild(2)->parseNodeToStr(aColumnName,m_xDBMetaData,NULL,sal_False,sal_False); + pColumnRef->getChild(2)->parseNodeToStr( aColumnName, getOwnConnection(), NULL, sal_False, sal_False ); } else { Directory: /dba/connectivity/source/drivers/jdbc/ ================================================= File [changed]: Connection.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/jdbc/Connection.cxx?r1=1.27&r2=1.27.20.1 Delta lines: +4 -5 ------------------- --- Connection.cxx 17 Sep 2006 02:45:28 -0000 1.27 +++ Connection.cxx 5 Dec 2006 09:46:54 -0000 1.27.20.1 @@ -4,9 +4,9 @@ * * $RCSfile: Connection.cxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.27.20.1 $ * - * last change: $Author: obo $ $Date: 2006/09/17 02:45:28 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:54 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -550,9 +550,8 @@ OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,_sSQL); if(pNode) { // special handling for parameters - /* we recusive replace all occurences of ? in the statement and replace them with name like "æ¬å" */ OSQLParseNode::substituteParameterNames(pNode); - pNode->parseNodeToStr(sNewSql,getMetaData()); + pNode->parseNodeToStr( sNewSql, this ); delete pNode; sSqlStatement = sNewSql; } Directory: /dba/connectivity/source/drivers/mozab/ ================================================== File [changed]: MStatement.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/mozab/MStatement.cxx?r1=1.16&r2=1.16.34.1 Delta lines: +4 -4 ------------------- --- MStatement.cxx 18 Oct 2006 13:09:15 -0000 1.16 +++ MStatement.cxx 5 Dec 2006 09:46:55 -0000 1.16.34.1 @@ -4,9 +4,9 @@ * * $RCSfile: MStatement.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.16.34.1 $ * - * last change: $Author: ihi $ $Date: 2006/10/18 13:09:15 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:55 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -597,7 +597,7 @@ aColumnName = pColumnRef->getChild(0)->getTokenValue(); else if (pColumnRef->count() == 3) { - pColumnRef->getChild(2)->parseNodeToStr(aColumnName,m_xDBMetaData,NULL,sal_False,sal_False); + pColumnRef->getChild(2)->parseNodeToStr( aColumnName, getOwnConnection(), NULL, sal_False, sal_False ); } else { Directory: /dba/connectivity/source/drivers/odbc/ ================================================= File [changed]: OPreparedStatement.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/odbc/OPreparedStatement.cxx?r1=1.42&r2=1.42.20.1 Delta lines: +4 -5 ------------------- --- OPreparedStatement.cxx 17 Sep 2006 03:06:35 -0000 1.42 +++ OPreparedStatement.cxx 5 Dec 2006 09:46:55 -0000 1.42.20.1 @@ -4,9 +4,9 @@ * * $RCSfile: OPreparedStatement.cxx,v $ * - * $Revision: 1.42 $ + * $Revision: 1.42.20.1 $ * - * last change: $Author: obo $ $Date: 2006/09/17 03:06:35 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:55 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -118,9 +118,8 @@ OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,sql); if(pNode) { // special handling for parameters - /* we recusive replace all occurences of ? in the statement and replace them with name like "æ¬å" */ OSQLParseNode::substituteParameterNames(pNode); - pNode->parseNodeToStr(sNewSql,_pConnection->getMetaData()); + pNode->parseNodeToStr( sNewSql, _pConnection ); delete pNode; m_sSqlStatement = sNewSql; } Directory: /dba/connectivity/source/parse/ ========================================== File [changed]: sqliterator.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/parse/sqliterator.cxx?r1=1.52&r2=1.52.20.1 Delta lines: +19 -19 --------------------- --- sqliterator.cxx 17 Sep 2006 03:09:24 -0000 1.52 +++ sqliterator.cxx 5 Dec 2006 09:46:55 -0000 1.52.20.1 @@ -4,9 +4,9 @@ * * $RCSfile: sqliterator.cxx,v $ * - * $Revision: 1.52 $ + * $Revision: 1.52.20.1 $ * - * last change: $Author: obo $ $Date: 2006/09/17 03:09:24 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:55 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -706,7 +706,7 @@ // ----------------------------------------------------------------------------- namespace { - void lcl_getColumnRange( const OSQLParseNode* _pColumnRef, const Reference< XDatabaseMetaData>& _xMetaData, + void lcl_getColumnRange( const OSQLParseNode* _pColumnRef, const Reference< XConnection >& _rxConnection, ::rtl::OUString& _out_rColumnName, ::rtl::OUString& _out_rTableRange, const OSQLColumns* _pSelectColumns, ::rtl::OUString& _out_rColumnAliasIfPresent ) { @@ -716,7 +716,7 @@ if( _pColumnRef->count() > 1 ) { for ( sal_Int32 i=0; i<((sal_Int32)_pColumnRef->count())-2; ++i ) - _pColumnRef->getChild(i)->parseNodeToStr( _out_rTableRange, _xMetaData, NULL, sal_False, sal_False ); + _pColumnRef->getChild(i)->parseNodeToStr( _out_rTableRange, _rxConnection, NULL, sal_False, sal_False ); _out_rColumnName = _pColumnRef->getChild( _pColumnRef->count()-1 )->getChild(0)->getTokenValue(); } else @@ -748,7 +748,7 @@ } else if(SQL_ISRULE(_pColumnRef,general_set_fct) || SQL_ISRULE(_pColumnRef,set_fct_spec)) { // Funktion - _pColumnRef->parseNodeToStr(_out_rColumnName,_xMetaData); + _pColumnRef->parseNodeToStr( _out_rColumnName, _rxConnection ); } else if(_pColumnRef->getNodeType() == SQL_NODE_NAME) _out_rColumnName = _pColumnRef->getTokenValue(); @@ -761,7 +761,7 @@ ::rtl::OUString& _rTableRange) const { ::rtl::OUString sDummy; - lcl_getColumnRange( _pColumnRef, m_pImpl->m_xDatabaseMetaData, _rColumnName, _rTableRange, NULL, sDummy ); + lcl_getColumnRange( _pColumnRef, m_pImpl->m_xConnection, _rColumnName, _rTableRange, NULL, sDummy ); } // ----------------------------------------------------------------------------- @@ -770,15 +770,15 @@ ::rtl::OUString& _rTableRange, ::rtl::OUString& _out_rColumnAliasIfPresent ) const { - lcl_getColumnRange( _pColumnRef, m_pImpl->m_xDatabaseMetaData, _rColumnName, _rTableRange, &*m_aSelectColumns, _out_rColumnAliasIfPresent ); + lcl_getColumnRange( _pColumnRef, m_pImpl->m_xConnection, _rColumnName, _rTableRange, &*m_aSelectColumns, _out_rColumnAliasIfPresent ); } //----------------------------------------------------------------------------- void OSQLParseTreeIterator::getColumnRange( const OSQLParseNode* _pColumnRef, - const Reference< XDatabaseMetaData>& _xMetaData, ::rtl::OUString& _out_rColumnName, ::rtl::OUString& _out_rTableRange ) + const Reference< XConnection >& _rxConnection, ::rtl::OUString& _out_rColumnName, ::rtl::OUString& _out_rTableRange ) { ::rtl::OUString sDummy; - lcl_getColumnRange( _pColumnRef, _xMetaData, _out_rColumnName, _out_rTableRange, NULL, sDummy ); + lcl_getColumnRange( _pColumnRef, _rxConnection, _out_rColumnName, _out_rTableRange, NULL, sDummy ); } //----------------------------------------------------------------------------- @@ -937,7 +937,7 @@ { // alle Spalten der Tabelle ::rtl::OUString aTableRange; - pColumnRef->getChild(0)->parseNodeToStr( aTableRange, m_pImpl->m_xDatabaseMetaData, NULL, sal_False, sal_False ); + pColumnRef->getChild(0)->parseNodeToStr( aTableRange, m_pImpl->m_xConnection, NULL, sal_False, sal_False ); setSelectColumnName(m_aSelectColumns,::rtl::OUString::createFromAscii("*"), aEmptyString,aTableRange); continue; } @@ -967,7 +967,7 @@ SQL_ISRULE(pColumnRef,num_value_exp) || SQL_ISRULE(pColumnRef,term))*/ { /* Funktionsaufruf vorhanden */ - pColumnRef->parseNodeToStr( sColumnName, m_pImpl->m_xDatabaseMetaData, NULL, sal_False, sal_True ); + pColumnRef->parseNodeToStr( sColumnName, m_pImpl->m_xConnection, NULL, sal_False, sal_True ); ::rtl::OUString sTableRange; // check if the column is also a parameter traverseORCriteria(pColumnRef); // num_value_exp @@ -994,10 +994,10 @@ ::rtl::OUString sFunctionName; if ( SQL_ISRULE(pColumnRef,length_exp) ) pColumnRef->getChild(0)->getChild(0)->parseNodeToStr( - sFunctionName, m_pImpl->m_xDatabaseMetaData, NULL, sal_False, sal_False ); + sFunctionName, m_pImpl->m_xConnection, NULL, sal_False, sal_False ); else pColumnRef->getChild(0)->parseNodeToStr( - sFunctionName, m_pImpl->m_xDatabaseMetaData, NULL, sal_False, sal_False ); + sFunctionName, m_pImpl->m_xConnection, NULL, sal_False, sal_False ); nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, &m_rParser.getContext() ); } } @@ -1092,13 +1092,13 @@ if(SQL_ISRULE(pColumnRef,column_ref)) getColumnRange(pColumnRef,sColumnName,aTableRange); else // eine Expression - pColumnRef->parseNodeToStr( sColumnName, m_pImpl->m_xDatabaseMetaData, NULL, sal_False, sal_False ); + pColumnRef->parseNodeToStr( sColumnName, m_pImpl->m_xConnection, NULL, sal_False, sal_False ); OSL_ENSURE(sColumnName.getLength(),"sColumnName darf nicht leer sein"); } else { // here I found a predicate - pColumnRef->parseNodeToStr( sColumnName, m_pImpl->m_xDatabaseMetaData, NULL, sal_False, sal_False ); + pColumnRef->parseNodeToStr( sColumnName, m_pImpl->m_xConnection, NULL, sal_False, sal_False ); } OSL_ENSURE(pColumnRef != NULL,"OSQLParseTreeIterator: error in parse tree!"); if ( _bOrder ) @@ -1272,7 +1272,7 @@ else if (SQL_ISRULE(pSearchCondition,comparison_predicate) ) { ::rtl::OUString aValue; - pSearchCondition->getChild(2)->parseNodeToStr( aValue, m_pImpl->m_xDatabaseMetaData, NULL, sal_False, sal_False ); + pSearchCondition->getChild(2)->parseNodeToStr( aValue, m_pImpl->m_xConnection, NULL, sal_False, sal_False ); traverseOnePredicate(pSearchCondition->getChild(0),aValue,pSearchCondition->getChild(2)); // if (! aIteratorStatus.IsSuccessful()) // return; @@ -1304,7 +1304,7 @@ aValue = pNum_value_exp->getTokenValue(); else { - pNum_value_exp->parseNodeToStr( aValue, m_pImpl->m_xDatabaseMetaData, NULL, sal_False, sal_False ); + pNum_value_exp->parseNodeToStr( aValue, m_pImpl->m_xConnection, NULL, sal_False, sal_False ); pParam = pNum_value_exp; } @@ -1395,7 +1395,7 @@ if ( _pColumnRef && (SQL_ISRULE(_pColumnRef,general_set_fct) || SQL_ISRULE(_pColumnRef,set_fct_spec)) ) {// found a function as column_ref ::rtl::OUString sFunctionName; - _pColumnRef->getChild(0)->parseNodeToStr( sFunctionName, m_pImpl->m_xDatabaseMetaData, NULL, sal_False, sal_False ); + _pColumnRef->getChild(0)->parseNodeToStr( sFunctionName, m_pImpl->m_xConnection, NULL, sal_False, sal_False ); sal_Int32 nType = ::connectivity::OSQLParser::getFunctionReturnType( sFunctionName, &m_rParser.getContext() ); OParseColumn* pColumn = new OParseColumn( sParameterName, File [changed]: sqlnode.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/parse/sqlnode.cxx?r1=1.45&r2=1.45.32.1 Delta lines: +32 -35 --------------------- --- sqlnode.cxx 24 Oct 2006 15:06:24 -0000 1.45 +++ sqlnode.cxx 5 Dec 2006 09:46:56 -0000 1.45.32.1 @@ -4,9 +4,9 @@ * * $RCSfile: sqlnode.cxx,v $ * - * $Revision: 1.45 $ + * $Revision: 1.45.32.1 $ * - * last change: $Author: hr $ $Date: 2006/10/24 15:06:24 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:56 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -215,13 +215,12 @@ //= SQLParseNodeParameter //============================================================================= //----------------------------------------------------------------------------- -SQLParseNodeParameter::SQLParseNodeParameter( const ::rtl::OUString& _rIdentifierQuote, const ::rtl::OUString& _rCatalogSep, +SQLParseNodeParameter::SQLParseNodeParameter( const Reference< XConnection >& _rxConnection, const Reference< XNumberFormatter >& _xFormatter, const Reference< XPropertySet >& _xField, const Locale& _rLocale, const IParseContext* _pContext, - bool _bIntl, bool _bQuote, sal_Char _cDecSep, bool _bPredicate, bool _bParseToSDBC, bool _bCaseSensistiveIdentCompare ) + bool _bIntl, bool _bQuote, sal_Char _cDecSep, bool _bPredicate, bool _bParseToSDBC ) :rLocale(_rLocale) - ,aIdentifierQuote(_rIdentifierQuote) - ,aCatalogSeparator(_rCatalogSep) + ,aMetaData( _rxConnection ) ,pParser( NULL ) ,pSubQueryHistory( new QueryNameSet ) ,xFormatter(_xFormatter) @@ -232,7 +231,6 @@ ,bInternational(_bIntl) ,bPredicate(_bPredicate) ,bParseToSDBCLevel( _bParseToSDBC ) - ,bCaseSensistiveIdentCompare( _bCaseSensistiveIdentCompare ) { } @@ -283,21 +281,21 @@ //----------------------------------------------------------------------------- void OSQLParseNode::parseNodeToStr(::rtl::OUString& rString, - const Reference< XDatabaseMetaData > & xMeta, + const Reference< XConnection >& _rxConnection, const IParseContext* pContext, sal_Bool _bIntl, sal_Bool _bQuote) const { parseNodeToStr( - rString, xMeta, Reference< XNumberFormatter >(), Reference< XPropertySet >(), + rString, _rxConnection, NULL, NULL, pContext ? pContext->getPreferredLocale() : OParseContext::getDefaultLocale(), pContext, _bIntl, _bQuote, '.', false, false ); } //----------------------------------------------------------------------------- void OSQLParseNode::parseNodeToPredicateStr(::rtl::OUString& rString, - const Reference< XDatabaseMetaData > & xMeta, + const Reference< XConnection >& _rxConnection, const Reference< XNumberFormatter > & xFormatter, const ::com::sun::star::lang::Locale& rIntl, sal_Char _cDec, @@ -307,12 +305,12 @@ OSL_ENSURE(xFormatter.is(), "OSQLParseNode::parseNodeToPredicateStr:: no formatter!"); if (xFormatter.is()) - parseNodeToStr(rString, xMeta, xFormatter, Reference< XPropertySet >(), rIntl, pContext, sal_True, sal_True, _cDec, true, false); + parseNodeToStr(rString, _rxConnection, xFormatter, NULL, rIntl, pContext, sal_True, sal_True, _cDec, true, false); } //----------------------------------------------------------------------------- void OSQLParseNode::parseNodeToPredicateStr(::rtl::OUString& rString, - const Reference< XDatabaseMetaData > & xMeta, + const Reference< XConnection > & _rxConnection, const Reference< XNumberFormatter > & xFormatter, const Reference< XPropertySet > & _xField, const ::com::sun::star::lang::Locale& rIntl, @@ -323,12 +321,12 @@ OSL_ENSURE(xFormatter.is(), "OSQLParseNode::parseNodeToPredicateStr:: no formatter!"); if (xFormatter.is()) - parseNodeToStr(rString, xMeta, xFormatter, _xField, rIntl, pContext, true, true, _cDec, true, false); + parseNodeToStr( rString, _rxConnection, xFormatter, _xField, rIntl, pContext, true, true, _cDec, true, false ); } //----------------------------------------------------------------------------- void OSQLParseNode::parseNodeToStr(::rtl::OUString& rString, - const Reference< XDatabaseMetaData > & xMeta, + const Reference< XConnection > & _rxConnection, const Reference< XNumberFormatter > & xFormatter, const Reference< XPropertySet > & _xField, const ::com::sun::star::lang::Locale& rIntl, @@ -340,20 +338,16 @@ bool _bSubstitute) const { - OSL_ENSURE(xMeta.is(), "OSQLParseNode::parseNodeToStr:: no meta data!"); + OSL_ENSURE( _rxConnection.is(), "OSQLParseNode::parseNodeToStr: invalid connection!" ); - if (xMeta.is()) + if ( _rxConnection.is() ) { - ::rtl::OUString aIdentifierQuote(xMeta->getIdentifierQuoteString()); - ::rtl::OUString aCatalogSeparator(xMeta->getCatalogSeparator()); - try { OSQLParseNode::impl_parseNodeToString_throw( rString, SQLParseNodeParameter( - aIdentifierQuote, aCatalogSeparator, xFormatter, _xField, rIntl, pContext, - _bIntl, _bQuote, _cDecSep, _bPredicate, _bSubstitute, - xMeta->storesMixedCaseQuotedIdentifiers() + _rxConnection, xFormatter, _xField, rIntl, pContext, + _bIntl, _bQuote, _cDecSep, _bPredicate, _bSubstitute ) ); } catch( const SQLException& ) @@ -371,14 +365,10 @@ OSQLParser& _rParser, ::com::sun::star::sdbc::SQLException* _pErrorHolder ) const { OSL_PRECOND( _rxConnection.is(), "OSQLParseNode::parseNodeToExecutableStatement: invalid connection!" ); - Reference< XDatabaseMetaData > xMeta( _rxConnection->getMetaData() ); - - SQLParseNodeParameter aParseParam( xMeta->getIdentifierQuoteString(), xMeta->getCatalogSeparator(), - NULL, NULL, OParseContext::getDefaultLocale(), NULL, false, true, '.', false, true, - xMeta->storesMixedCaseQuotedIdentifiers() ); + SQLParseNodeParameter aParseParam( _rxConnection, + NULL, NULL, OParseContext::getDefaultLocale(), NULL, false, true, '.', false, true ); - DatabaseMetaData aMeta( _rxConnection ); - if ( aMeta.supportsSubqueriesInFrom() ) + if ( aParseParam.aMetaData.supportsSubqueriesInFrom() ) { Reference< XQueriesSupplier > xSuppQueries( _rxConnection, UNO_QUERY ); OSL_ENSURE( xSuppQueries.is(), "OSQLParseNode::parseNodeToExecutableStatement: cannot substitute everything without a QueriesSupplier!" ); @@ -506,6 +496,7 @@ break; case as: + if ( rParam.aMetaData.generateASBeforeCorrelationName() ) rString += ::rtl::OUString::createFromAscii( " AS" ); bHandled = true; break; @@ -718,7 +709,8 @@ { rString += ::rtl::OUString::createFromAscii( " AS " ); if ( rParam.bQuote ) - rString += SetQuotation( sTableOrQueryName, rParam.aIdentifierQuote, rParam.aIdentifierQuote ); + rString += SetQuotation( sTableOrQueryName, + rParam.aMetaData.getIdentifierQuoteString(), rParam.aMetaData.getIdentifierQuoteString() ); } // don't forget to remove the query name from the history, else multiple inclusions @@ -2439,7 +2431,9 @@ case ' ' : case '.' : break; default : - if (!rParam.aCatalogSeparator.getLength() || rString.getStr()[rString.getLength()-1] != rParam.aCatalogSeparator.toChar()) + if ( !rParam.aMetaData.getCatalogSeparator().getLength() + || rString.getStr()[ rString.getLength()-1 ] != rParam.aMetaData.getCatalogSeparator().toChar() + ) rString += ::rtl::OUString::createFromAscii(" "); break; } } @@ -2452,7 +2446,8 @@ rString+= ::rtl::OUString::createFromAscii("]"); } else - rString += SetQuotation(m_aNodeValue, rParam.aIdentifierQuote, rParam.aIdentifierQuote); + rString += SetQuotation(m_aNodeValue, + rParam.aMetaData.getIdentifierQuoteString(), rParam.aMetaData.getIdentifierQuoteString() ); } else rString += m_aNodeValue; @@ -2485,7 +2480,9 @@ case ' ' : case '.' : break; default : - if (!rParam.aCatalogSeparator.getLength() || rString.getStr()[rString.getLength()-1] != rParam.aCatalogSeparator.toChar()) + if ( !rParam.aMetaData.getCatalogSeparator().getLength() + || rString.getStr()[ rString.getLength()-1 ] != rParam.aMetaData.getCatalogSeparator().toChar() + ) rString += ::rtl::OUString::createFromAscii(" "); break; } } Directory: /dba/connectivity/source/simpledbt/ ============================================== File [changed]: parsenode_s.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/simpledbt/parsenode_s.cxx?r1=1.5&r2=1.5.20.1 Delta lines: +7 -7 ------------------- --- parsenode_s.cxx 17 Sep 2006 03:13:44 -0000 1.5 +++ parsenode_s.cxx 5 Dec 2006 09:46:56 -0000 1.5.20.1 @@ -4,9 +4,9 @@ * * $RCSfile: parsenode_s.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.5.20.1 $ * - * last change: $Author: obo $ $Date: 2006/09/17 03:13:44 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:56 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -88,17 +88,17 @@ } //---------------------------------------------------------------- - void OSimpleParseNode::parseNodeToStr(::rtl::OUString& _rString, const Reference< XDatabaseMetaData >& _rxMeta,const IParseContext* _pContext) const + void OSimpleParseNode::parseNodeToStr(::rtl::OUString& _rString, const Reference< XConnection >& _rxConnection,const IParseContext* _pContext) const { - m_pFullNode->parseNodeToStr(_rString, _rxMeta,_pContext); + m_pFullNode->parseNodeToStr( _rString, _rxConnection, _pContext ); } //---------------------------------------------------------------- - void OSimpleParseNode::parseNodeToPredicateStr(::rtl::OUString& _rString, const Reference< XDatabaseMetaData >& _rxMeta, + void OSimpleParseNode::parseNodeToPredicateStr(::rtl::OUString& _rString, const Reference< XConnection >& _rxConnection, const Reference< XNumberFormatter >& _rxFormatter, const Reference< XPropertySet >& _rxField, const Locale& _rIntl, const sal_Char _cDecSeparator,const IParseContext* _pContext) const { - m_pFullNode->parseNodeToPredicateStr(_rString, _rxMeta, _rxFormatter, _rxField, _rIntl, _cDecSeparator,_pContext); + m_pFullNode->parseNodeToPredicateStr( _rString, _rxConnection, _rxFormatter, _rxField, _rIntl, _cDecSeparator, _pContext ); } //........................................................................ File [changed]: parsenode_s.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/simpledbt/parsenode_s.hxx?r1=1.4&r2=1.4.190.1 Delta lines: +5 -5 ------------------- --- parsenode_s.hxx 8 Sep 2005 07:47:24 -0000 1.4 +++ parsenode_s.hxx 5 Dec 2006 09:46:56 -0000 1.4.190.1 @@ -4,9 +4,9 @@ * * $RCSfile: parsenode_s.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.4.190.1 $ * - * last change: $Author: rt $ $Date: 2005/09/08 07:47:24 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:56 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -66,12 +66,12 @@ // ISQLParseNode virtual void parseNodeToStr(::rtl::OUString& _rString, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxMeta, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const IParseContext* _pContext ) const; virtual void parseNodeToPredicateStr(::rtl::OUString& _rString, - const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxMeta, + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& _rxFormatter, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxField, const ::com::sun::star::lang::Locale& _rIntl, File [changed]: staticdbtools_s.cxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/simpledbt/staticdbtools_s.cxx?r1=1.11&r2=1.11.20.1 Delta lines: +3 -11 -------------------- --- staticdbtools_s.cxx 17 Sep 2006 03:14:32 -0000 1.11 +++ staticdbtools_s.cxx 5 Dec 2006 09:46:56 -0000 1.11.20.1 @@ -4,9 +4,9 @@ * * $RCSfile: staticdbtools_s.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.11.20.1 $ * - * last change: $Author: obo $ $Date: 2006/09/17 03:14:32 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:56 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -217,14 +217,6 @@ { return ::dbtools::getFieldNamesByCommandDescriptor( _rxConnection, _nCommandType, _rCommand, _pErrorInfo ); - } - - //---------------------------------------------------------------- - sal_Bool ODataAccessStaticTools::isDataSourcePropertyEnabled(const Reference< XInterface>& _xProp - ,const ::rtl::OUString& _sProperty, - sal_Bool _bDefault) const - { - return ::dbtools::isDataSourcePropertyEnabled( _xProp,_sProperty ,_bDefault ); } // ------------------------------------------------ File [changed]: staticdbtools_s.hxx Url: http://dba.openoffice.org/source/browse/dba/connectivity/source/simpledbt/staticdbtools_s.hxx?r1=1.10&r2=1.10.70.1 Delta lines: +3 -8 ------------------- --- staticdbtools_s.hxx 10 Jul 2006 14:40:08 -0000 1.10 +++ staticdbtools_s.hxx 5 Dec 2006 09:46:56 -0000 1.10.70.1 @@ -4,9 +4,9 @@ * * $RCSfile: staticdbtools_s.hxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.10.70.1 $ * - * last change: $Author: obo $ $Date: 2006/07/10 14:40:08 $ + * last change: $Author: fs $ $Date: 2006/12/05 09:46:56 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -198,11 +198,6 @@ const ::rtl::OUString& _rCommand, ::dbtools::SQLExceptionInfo* _pErrorInfo = NULL ) SAL_THROW( ( ) ); - - // ------------------------------------------------ - virtual sal_Bool isDataSourcePropertyEnabled(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& _xProp - ,const ::rtl::OUString& _sProperty, - sal_Bool _bDefault = sal_False) const; // ------------------------------------------------ virtual bool isEmbeddedInDatabase( --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
