diff options
-rw-r--r-- | dbaccess/inc/dbaccess_helpid.hrc | 1 | ||||
-rw-r--r-- | dbaccess/source/core/api/RowSetCache.cxx | 18 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/brwctrlr.cxx | 15 | ||||
-rw-r--r--[-rwxr-xr-x] | dbaccess/source/ui/dlg/DbAdminImpl.cxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/advancedsettings.cxx | 33 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/advancedsettings.hrc | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/advancedsettings.hxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/advancedsettings.src | 15 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/dbadmin.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dsitems.hxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/dsmeta.hxx | 1 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/dsmeta.cxx | 1 |
12 files changed, 65 insertions, 27 deletions
diff --git a/dbaccess/inc/dbaccess_helpid.hrc b/dbaccess/inc/dbaccess_helpid.hrc index 2ab9c80c8..1003efa8f 100644 --- a/dbaccess/inc/dbaccess_helpid.hrc +++ b/dbaccess/inc/dbaccess_helpid.hrc @@ -436,6 +436,7 @@ #define HID_DSADMIN_IGNORECURRENCY "DBACCESS_HID_DSADMIN_IGNORECURRENCY" #define HID_MACRO_MIGRATION_BACKUP_LOCATION "DBACCESS_HID_MACRO_MIGRATION_BACKUP_LOCATION" #define HID_DSADMIN_PRIMARY_KEY_SUPPORT "DBACCESS_HID_DSADMIN_PRIMARY_KEY_SUPPORT" +#define HID_DSADMIN_RESPECTRESULTSETTYPE "DBACCESS_HID_DSADMIN_RESPECTRESULTSETTYPE" // this one below have hid in number space HID_SBA_START #define HID_DLG_ADABAS_NEWDB "DBACCESS_HID_DLG_ADABAS_NEWDB" diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 9963d2ad6..2a5384243 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -116,11 +116,11 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, DBG_CTOR(ORowSetCache,NULL); // first try if the result can be used to do inserts and updates + Reference< XPropertySet> xProp(_xRs,UNO_QUERY); + Reference< XPropertySetInfo > xPropInfo = xProp->getPropertySetInfo(); try { Reference< XResultSetUpdate> xUp(_xRs,UNO_QUERY_THROW); - Reference< XPropertySet> xProp(_xRs,UNO_QUERY); - Reference< XPropertySetInfo > xPropInfo = xProp->getPropertySetInfo(); sal_Bool bBookmarkable = xPropInfo->hasPropertyByName(PROPERTY_ISBOOKMARKABLE) && any2bool(xProp->getPropertyValue(PROPERTY_ISBOOKMARKABLE)) && Reference< XRowLocate >(_xRs, UNO_QUERY).is(); if ( bBookmarkable ) @@ -139,14 +139,22 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, { (void)ex; } - _xRs->beforeFirst(); + try + { + if ( xPropInfo->hasPropertyByName(PROPERTY_RESULTSETTYPE) && + ::comphelper::getINT32(xProp->getPropertyValue(PROPERTY_RESULTSETTYPE)) != ResultSetType::FORWARD_ONLY) + _xRs->beforeFirst(); + } + catch(const SQLException& e) + { + (void)e; + } // check if all keys of the updateable table are fetched sal_Bool bAllKeysFound = sal_False; sal_Int32 nTablesCount = 0; - Reference< XPropertySet> xProp(_xRs,UNO_QUERY); - Reference< XPropertySetInfo > xPropInfo = xProp->getPropertySetInfo(); + sal_Bool bNeedKeySet = !(xPropInfo->hasPropertyByName(PROPERTY_ISBOOKMARKABLE) && any2bool(xProp->getPropertyValue(PROPERTY_ISBOOKMARKABLE)) && Reference< XRowLocate >(_xRs, UNO_QUERY).is() ); bNeedKeySet = bNeedKeySet || (xPropInfo->hasPropertyByName(PROPERTY_RESULTSETCONCURRENCY) && diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 0cc058a7a..eeb4bdbef 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -760,11 +760,18 @@ sal_Bool SbaXDataBrowserController::reloadForm( const Reference< XLoadable >& _r Reference< XWarningsSupplier > xWarnings( _rxLoadable, UNO_QUERY ); if ( xWarnings.is() ) { - SQLExceptionInfo aInfo( xWarnings->getWarnings() ); - if ( aInfo.isValid() ) + try + { + SQLExceptionInfo aInfo( xWarnings->getWarnings() ); + if ( aInfo.isValid() ) + { + showError( aInfo ); + impl_checkForCannotSelectUnfiltered( aInfo ); + } + } + catch(const SQLException& e) { - showError( aInfo ); - impl_checkForCannotSelectUnfiltered( aInfo ); + (void)e; } } diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index 816d3d5e9..29a4c2a5b 100755..100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -204,6 +204,7 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_DOSLINEENDS, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PreferDosLikeLineEnds" ) ) ) ); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_SOCKET, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LocalSocket" ) ) ) ); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_NAMED_PIPE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NamedPipe" ) ) ) ); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_RESPECTRESULTSETTYPE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RespectDriverResultSetType" ) ) ) ); // special settings for adabas m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_SHUTSERVICE, ::rtl::OUString::createFromAscii("ShutdownDatabase"))); diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index 72eacab68..0b4c65d03 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -95,6 +95,7 @@ namespace dbaui ,m_pIgnoreCurrency(NULL) ,m_pEscapeDateTime(NULL) ,m_pPrimaryKeySupport(NULL) + ,m_pRespectDriverResultSetType(NULL) ,m_pBooleanComparisonModeLabel( NULL ) ,m_pBooleanComparisonMode( NULL ) ,m_pMaxRowScanLabel( NULL ) @@ -206,6 +207,7 @@ namespace dbaui DELETEZ( m_pIgnoreCurrency ); DELETEZ( m_pEscapeDateTime ); DELETEZ( m_pPrimaryKeySupport ); + DELETEZ( m_pRespectDriverResultSetType ); DELETEZ( m_pBooleanComparisonModeLabel ); DELETEZ( m_pBooleanComparisonMode ); DELETEZ( m_pMaxRowScanLabel ); @@ -219,21 +221,22 @@ namespace dbaui // for easier maintainance, write the table in this form, then copy it to m_aBooleanSettings BooleanSettingDesc aSettings[] = { - { &m_pIsSQL92Check, CB_SQL92CHECK, DSID_SQL92CHECK, false }, - { &m_pAppendTableAlias, CB_APPENDTABLEALIAS, DSID_APPEND_TABLE_ALIAS, false }, - { &m_pAsBeforeCorrelationName, CB_AS_BEFORE_CORR_NAME, DSID_AS_BEFORE_CORRNAME, false }, - { &m_pEnableOuterJoin, CB_ENABLEOUTERJOIN, DSID_ENABLEOUTERJOIN, false }, - { &m_pIgnoreDriverPrivileges, CB_IGNOREDRIVER_PRIV, DSID_IGNOREDRIVER_PRIV, false }, - { &m_pParameterSubstitution, CB_PARAMETERNAMESUBST, DSID_PARAMETERNAMESUBST, false }, - { &m_pSuppressVersionColumn, CB_SUPPRESVERSIONCL, DSID_SUPPRESSVERSIONCL, true }, - { &m_pCatalog, CB_CATALOG, DSID_CATALOG, false }, - { &m_pSchema, CB_SCHEMA, DSID_SCHEMA, false }, - { &m_pIndexAppendix, CB_IGNOREINDEXAPPENDIX, DSID_INDEXAPPENDIX, false }, - { &m_pDosLineEnds, CB_DOSLINEENDS, DSID_DOSLINEENDS, false }, - { &m_pCheckRequiredFields, CB_CHECK_REQUIRED, DSID_CHECK_REQUIRED_FIELDS, false }, - { &m_pIgnoreCurrency, CB_IGNORECURRENCY, DSID_IGNORECURRENCY, false }, - { &m_pEscapeDateTime, CB_ESCAPE_DATETIME, DSID_ESCAPE_DATETIME, false }, - { &m_pPrimaryKeySupport, CB_PRIMARY_KEY_SUPPORT, DSID_PRIMARY_KEY_SUPPORT, false }, + { &m_pIsSQL92Check, CB_SQL92CHECK, DSID_SQL92CHECK, false }, + { &m_pAppendTableAlias, CB_APPENDTABLEALIAS, DSID_APPEND_TABLE_ALIAS, false }, + { &m_pAsBeforeCorrelationName, CB_AS_BEFORE_CORR_NAME, DSID_AS_BEFORE_CORRNAME, false }, + { &m_pEnableOuterJoin, CB_ENABLEOUTERJOIN, DSID_ENABLEOUTERJOIN, false }, + { &m_pIgnoreDriverPrivileges, CB_IGNOREDRIVER_PRIV, DSID_IGNOREDRIVER_PRIV, false }, + { &m_pParameterSubstitution, CB_PARAMETERNAMESUBST, DSID_PARAMETERNAMESUBST, false }, + { &m_pSuppressVersionColumn, CB_SUPPRESVERSIONCL, DSID_SUPPRESSVERSIONCL, true }, + { &m_pCatalog, CB_CATALOG, DSID_CATALOG, false }, + { &m_pSchema, CB_SCHEMA, DSID_SCHEMA, false }, + { &m_pIndexAppendix, CB_IGNOREINDEXAPPENDIX, DSID_INDEXAPPENDIX, false }, + { &m_pDosLineEnds, CB_DOSLINEENDS, DSID_DOSLINEENDS, false }, + { &m_pCheckRequiredFields, CB_CHECK_REQUIRED, DSID_CHECK_REQUIRED_FIELDS, false }, + { &m_pIgnoreCurrency, CB_IGNORECURRENCY, DSID_IGNORECURRENCY, false }, + { &m_pEscapeDateTime, CB_ESCAPE_DATETIME, DSID_ESCAPE_DATETIME, false }, + { &m_pPrimaryKeySupport, CB_PRIMARY_KEY_SUPPORT, DSID_PRIMARY_KEY_SUPPORT, false }, + { &m_pRespectDriverResultSetType, CB_RESPECTRESULTSETTYPE,DSID_RESPECTRESULTSETTYPE, false }, { NULL, 0, 0, false } }; diff --git a/dbaccess/source/ui/dlg/advancedsettings.hrc b/dbaccess/source/ui/dlg/advancedsettings.hrc index 320683897..389afea6a 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.hrc +++ b/dbaccess/source/ui/dlg/advancedsettings.hrc @@ -62,6 +62,7 @@ #define CB_IGNORECURRENCY 14 #define CB_ESCAPE_DATETIME 15 #define CB_PRIMARY_KEY_SUPPORT 16 +#define CB_RESPECTRESULTSETTYPE 17 #define ET_AUTOINCREMENTVALUE 1 #define ET_RETRIEVE_AUTO 2 diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx index 118b758e6..68c574d1c 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.hxx +++ b/dbaccess/source/ui/dlg/advancedsettings.hxx @@ -73,6 +73,7 @@ namespace dbaui CheckBox* m_pIgnoreCurrency; CheckBox* m_pEscapeDateTime; CheckBox* m_pPrimaryKeySupport; + CheckBox* m_pRespectDriverResultSetType; FixedText* m_pBooleanComparisonModeLabel; ListBox* m_pBooleanComparisonMode; diff --git a/dbaccess/source/ui/dlg/advancedsettings.src b/dbaccess/source/ui/dlg/advancedsettings.src index e056629f0..8243334ec 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.src +++ b/dbaccess/source/ui/dlg/advancedsettings.src @@ -217,6 +217,16 @@ Text [ en-US ] = "Supports primary keys"; \ }; +#define AUTO_RESPECTRESULTSETTYPE(AUTO_Y) \ + CheckBox CB_RESPECTRESULTSETTYPE \ + { \ + Pos = MAP_APPFONT ( 6 , AUTO_Y ) ; \ + Size = MAP_APPFONT ( ADVANCED_PAGE_X - 12 , CHECKBOX_HEIGHT ) ; \ + TabStop = TRUE ; \ + HelpId = HID_DSADMIN_RESPECTRESULTSETTYPE; \ + Text [ en-US ] = "Ignore the result set type from the database driver"; \ + }; + //------------------------------------------------------------------------- @@ -351,8 +361,9 @@ TabPage PAGE_ADVANCED_SETTINGS_SPECIAL AUTO_IGNORECURRENCY( 13*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 12*CHECKBOX_HEIGHT + RELATED_CONTROLS ) AUTO_ESCAPE_DATETIME( 14*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS ) AUTO_PRIMARY_KEY_SUPPORT( 15*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 15*CHECKBOX_HEIGHT + RELATED_CONTROLS ) - AUTO_BOOLEANCOMPARISON( 16*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) - AUTO_MAXROWSCAN( 17*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) + AUTO_RESPECTRESULTSETTYPE( 16*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 16*CHECKBOX_HEIGHT + RELATED_CONTROLS ) + AUTO_BOOLEANCOMPARISON( 17*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 15*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) + AUTO_MAXROWSCAN( 18*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 15*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) }; //------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx index 57960dc48..24e7ec9e5 100644 --- a/dbaccess/source/ui/dlg/dbadmin.cxx +++ b/dbaccess/source/ui/dlg/dbadmin.cxx @@ -411,6 +411,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp *pCounter++ = new SfxStringItem(DSID_NAMED_PIPE, String()); *pCounter++ = new OptionalBoolItem( DSID_PRIMARY_KEY_SUPPORT ); *pCounter++ = new SfxInt32Item(DSID_MAX_ROW_SCAN, 100); + *pCounter++ = new SfxBoolItem( DSID_RESPECTRESULTSETTYPE,sal_False ); // create the pool static SfxItemInfo __READONLY_DATA aItemInfos[DSID_LAST_ITEM_ID - DSID_FIRST_ITEM_ID + 1] = @@ -474,6 +475,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp {0,0}, {0,0}, {0,0}, + {0,0}, {0,0} }; diff --git a/dbaccess/source/ui/inc/dsitems.hxx b/dbaccess/source/ui/inc/dsitems.hxx index deb36c70e..6940812a9 100644 --- a/dbaccess/source/ui/inc/dsitems.hxx +++ b/dbaccess/source/ui/inc/dsitems.hxx @@ -93,6 +93,7 @@ typedef sal_Int32 ItemID; #define DSID_NAMED_PIPE 58 #define DSID_PRIMARY_KEY_SUPPORT 59 #define DSID_MAX_ROW_SCAN 60 +#define DSID_RESPECTRESULTSETTYPE 61 // don't forget to adjust DSID_LAST_ITEM_ID below! @@ -100,7 +101,7 @@ typedef sal_Int32 ItemID; //= item range. Adjust this if you introduce new items above #define DSID_FIRST_ITEM_ID DSID_NAME -#define DSID_LAST_ITEM_ID DSID_MAX_ROW_SCAN +#define DSID_LAST_ITEM_ID DSID_RESPECTRESULTSETTYPE #endif // _DBAUI_DATASOURCEITEMS_HXX_ diff --git a/dbaccess/source/ui/inc/dsmeta.hxx b/dbaccess/source/ui/inc/dsmeta.hxx index 9ed7afdd0..6e89515b4 100644 --- a/dbaccess/source/ui/inc/dsmeta.hxx +++ b/dbaccess/source/ui/inc/dsmeta.hxx @@ -133,6 +133,7 @@ namespace dbaui || has( DSID_ESCAPE_DATETIME ) || has( DSID_PRIMARY_KEY_SUPPORT ) || has( DSID_MAX_ROW_SCAN ) + || has( DSID_RESPECTRESULTSETTYPE ) ; } diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx index 4b3af7c59..cbadf1b4c 100644 --- a/dbaccess/source/ui/misc/dsmeta.cxx +++ b/dbaccess/source/ui/misc/dsmeta.cxx @@ -93,6 +93,7 @@ namespace dbaui { DSID_IGNORECURRENCY, "IgnoreCurrency" }, { DSID_ESCAPE_DATETIME, "EscapeDateTime" }, { DSID_PRIMARY_KEY_SUPPORT, "PrimaryKeySupport" }, + { DSID_RESPECTRESULTSETTYPE, "RespectDriverResultSetType" }, { DSID_MAX_ROW_SCAN, "MaxRowScan" }, { 0, NULL } }; |