connectivity/source/parse/sqlbison.y | 16 +++++++++++++++- dbaccess/source/core/api/CacheSet.cxx | 2 +- dbaccess/source/core/api/KeySet.cxx | 24 ++++++++++++------------ dbaccess/source/core/api/OptimisticSet.cxx | 2 +- dbaccess/source/core/api/RowSet.cxx | 8 ++++---- dbaccess/source/core/api/RowSet.hxx | 4 ++-- svx/source/fmcomp/gridctrl.cxx | 1 + 7 files changed, 36 insertions(+), 21 deletions(-)
New commits: commit 8935f127d1dbe82c10db229d6cda1acfb964456c Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Jan 17 13:34:04 2012 +0100 DbGridControl::SeekCursor: show exception when seek fails (and debug build) diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 646bf9b..9548a81 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -2470,6 +2470,7 @@ sal_Bool DbGridControl::SeekCursor(long nRow, sal_Bool bAbsolute) catch(Exception&) { OSL_FAIL("DbGridControl::SeekCursor : failed ..."); + DBG_UNHANDLED_EXCEPTION(); m_nSeekPos = -1; // kein Datensatz mehr vorhanden } } commit a63d7020ce55c1b2970ba5a3ddd3f6f7067eac48 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Jan 17 09:27:40 2012 +0100 janitorial: typo in private member name diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 33d1f0c..a7f834b 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -162,7 +162,7 @@ ORowSet::ORowSet( const Reference< ::com::sun::star::lang::XMultiServiceFactory ,m_bCommandFacetsDirty( sal_True ) ,m_bModified(sal_False) ,m_bRebuildConnOnExecute(sal_False) - ,m_bIsBookmarable(sal_True) + ,m_bIsBookmarkable(sal_True) ,m_bNew(sal_False) ,m_bCanUpdateInsertedRows(sal_True) ,m_bOwnConnection(sal_False) @@ -197,7 +197,7 @@ ORowSet::ORowSet( const Reference< ::com::sun::star::lang::XMultiServiceFactory registerProperty(PROPERTY_SINGLESELECTQUERYCOMPOSER,PROPERTY_ID_SINGLESELECTQUERYCOMPOSER, nRT, &m_xComposer, ::getCppuType(reinterpret_cast< Reference< XSingleSelectQueryComposer >* >(NULL))); // sdbcx.ResultSet Properties - registerProperty(PROPERTY_ISBOOKMARKABLE, PROPERTY_ID_ISBOOKMARKABLE, nRT, &m_bIsBookmarable, ::getBooleanCppuType()); + registerProperty(PROPERTY_ISBOOKMARKABLE, PROPERTY_ID_ISBOOKMARKABLE, nRT, &m_bIsBookmarkable, ::getBooleanCppuType()); registerProperty(PROPERTY_CANUPDATEINSERTEDROWS,PROPERTY_ID_CANUPDATEINSERTEDROWS, nRT, &m_bCanUpdateInsertedRows, ::getBooleanCppuType()); // sdbc.ResultSet Properties registerProperty(PROPERTY_RESULTSETCONCURRENCY, PROPERTY_ID_RESULTSETCONCURRENCY, PropertyAttribute::TRANSIENT, &m_nResultSetConcurrency,::getCppuType(reinterpret_cast< sal_Int32*>(NULL))); @@ -2736,7 +2736,7 @@ ORowSetClone::ORowSetClone( const ::comphelper::ComponentContext& _rContext, ORo ,m_pParent(&rParent) ,m_nFetchDirection(rParent.m_nFetchDirection) ,m_nFetchSize(rParent.m_nFetchSize) - ,m_bIsBookmarable(sal_True) + ,m_bIsBookmarkable(sal_True) { DBG_CTOR(ORowSetClone, NULL); @@ -2813,7 +2813,7 @@ ORowSetClone::ORowSetClone( const ::comphelper::ComponentContext& _rContext, ORo registerProperty(PROPERTY_RESULTSETTYPE, PROPERTY_ID_RESULTSETTYPE, PropertyAttribute::READONLY, &m_nResultSetType, ::getCppuType(reinterpret_cast< sal_Int32*>(NULL))); registerProperty(PROPERTY_FETCHDIRECTION, PROPERTY_ID_FETCHDIRECTION, PropertyAttribute::TRANSIENT, &m_nFetchDirection, ::getCppuType(reinterpret_cast< sal_Int32*>(NULL))); registerProperty(PROPERTY_FETCHSIZE, PROPERTY_ID_FETCHSIZE, PropertyAttribute::TRANSIENT, &m_nFetchSize, ::getCppuType(reinterpret_cast< sal_Int32*>(NULL))); - registerProperty(PROPERTY_ISBOOKMARKABLE, PROPERTY_ID_ISBOOKMARKABLE, nRT, &m_bIsBookmarable, ::getBooleanCppuType()); + registerProperty(PROPERTY_ISBOOKMARKABLE, PROPERTY_ID_ISBOOKMARKABLE, nRT, &m_bIsBookmarkable, ::getBooleanCppuType()); } ORowSetClone::~ORowSetClone() diff --git a/dbaccess/source/core/api/RowSet.hxx b/dbaccess/source/core/api/RowSet.hxx index 891d4a2..40e1920 100644 --- a/dbaccess/source/core/api/RowSet.hxx +++ b/dbaccess/source/core/api/RowSet.hxx @@ -142,7 +142,7 @@ namespace dbaccess sal_Bool m_bCommandFacetsDirty; // any of the facets which define the active command is dirty sal_Bool m_bModified ; sal_Bool m_bRebuildConnOnExecute ; - sal_Bool m_bIsBookmarable ; + sal_Bool m_bIsBookmarkable ; sal_Bool m_bNew ; sal_Bool m_bCanUpdateInsertedRows; sal_Bool m_bOwnConnection; @@ -476,7 +476,7 @@ namespace dbaccess ORowSet* m_pParent; sal_Int32 m_nFetchDirection; sal_Int32 m_nFetchSize; - sal_Bool m_bIsBookmarable; + sal_Bool m_bIsBookmarkable; protected: // the clone can not insert anything commit d30ecc1a23405aefb7f53f3865b7f9d79aa6874f Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Jan 17 09:26:41 2012 +0100 janitorial: const iterator where may be, indentation diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index c3f4105..6024f3f 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -290,16 +290,16 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::O ::dbaccess::getColumnPositions(xQueryColumns,xSelColSup->getColumns()->getElementNames(),sSelectTableName,(*m_pForeignColumnNames)); - SelectColumnsMetaData::iterator aPosEnd = (*m_pForeignColumnNames).end(); + const SelectColumnsMetaData::iterator aPosEnd = (*m_pForeignColumnNames).end(); for(SelectColumnsMetaData::iterator aPosIter = (*m_pForeignColumnNames).begin();aPosIter != aPosEnd;++aPosIter) { // look for columns not in the source columns to use them as filter as well - if ( aFilter.getLength() ) - aFilter.append(aAnd); - aFilter.append(::dbtools::quoteName( aQuote,sSelectTableName)); - aFilter.append(s_sDot); - aFilter.append(::dbtools::quoteName( aQuote,aPosIter->second.sRealName)); - aFilter.append(s_sParam); + if ( aFilter.getLength() ) + aFilter.append(aAnd); + aFilter.append(::dbtools::quoteName( aQuote,sSelectTableName)); + aFilter.append(s_sDot); + aFilter.append(::dbtools::quoteName( aQuote,aPosIter->second.sRealName)); + aFilter.append(s_sParam); } break; } commit b713652b33b6eb180528016f81de59451e2e51f1 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Jan 17 15:21:41 2012 +0100 Also teach "foo IS [NOT] bar" to our SQL parser (when bar is not NULL) Syntax supported by at least SQLite. diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y index e32f22d..d77fb14 100755 --- a/connectivity/source/parse/sqlbison.y +++ b/connectivity/source/parse/sqlbison.y @@ -1282,6 +1282,12 @@ comparison: $$->append($3); $$->append($4); } + | SQL_TOKEN_IS sql_not + { + $$ = SQL_NEW_RULE; + $$->append($1); + $$->append($2); + } ; between_predicate_part_2: sql_not SQL_TOKEN_BETWEEN row_value_constructor SQL_TOKEN_AND row_value_constructor commit 6031d1285c510c893b77f87648e442bd12afba94 Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Tue Jan 17 09:03:17 2012 +0100 fdo#44813: teach "IS (NOT) DISTINCT FROM" to our SQL parser diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y index 19bb494..e32f22d 100755 --- a/connectivity/source/parse/sqlbison.y +++ b/connectivity/source/parse/sqlbison.y @@ -1268,12 +1268,20 @@ comparison_predicate: } ; comparison: - SQL_LESS + SQL_LESS | SQL_NOTEQUAL | SQL_EQUAL | SQL_GREAT | SQL_LESSEQ | SQL_GREATEQ + | SQL_TOKEN_IS sql_not SQL_TOKEN_DISTINCT SQL_TOKEN_FROM + { + $$ = SQL_NEW_RULE; + $$->append($1); + $$->append($2); + $$->append($3); + $$->append($4); + } ; between_predicate_part_2: sql_not SQL_TOKEN_BETWEEN row_value_constructor SQL_TOKEN_AND row_value_constructor commit a261e36481c80750ad7b10505e4b05b9873c328d Author: Lionel Elie Mamane <lio...@mamane.lu> Date: Mon Jan 16 19:38:01 2012 +0100 fdo#44813: don't replace NULLs given by the database by type-default values It makes no sense, because non-nullable columns can have NULL value. E.g. in "foo LEFT JOIN bar ON condition", the non-nullable columns of "bar" when it has no row matching "condition". Even when we are about to insert/update a row, we should not put a hard-coded value (that just happens to be the one constructed by the C++ default constructor for that type) in non-nullable columns: there is no guarantee that this value makes sense in that database's context. The database may or may not have a default value set for that column. If it has, we should leave it up to the database to set it automatically. If it has not, an error *is* the right reaction. Another place where this substitution does damage is when we refresh a row. We use the values we have read from the primary key to select the row again. So we should not mangle those, else the select returns no row and we mistakingly think the row has been deleted. diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx index 7b7b948..5a692fb 100644 --- a/dbaccess/source/core/api/CacheSet.cxx +++ b/dbaccess/source/core/api/CacheSet.cxx @@ -427,7 +427,7 @@ void OCacheSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition) for(sal_Int32 i=1;aIter != aEnd;++aIter,++i) { aIter->setSigned(m_aSignedFlags[i-1]); - aIter->fill(i,m_aColumnTypes[i-1],m_aNullable[i-1],this); + aIter->fill(i, m_aColumnTypes[i-1], this); } } diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 4e35e10..c3f4105 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -762,7 +762,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString #endif SelectColumnsMetaData::iterator aFind = m_pKeyColumnNames->find(*aAutoIter); if ( aFind != m_pKeyColumnNames->end() ) - (_rInsertRow->get())[aFind->second.nPosition].fill(i,aFind->second.nType,aFind->second.bNullable,xRow); + (_rInsertRow->get())[aFind->second.nPosition].fill(i, aFind->second.nType, xRow); } bAutoValuesFetched = sal_True; } @@ -822,7 +822,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString // we will only fetch values which are keycolumns SelectColumnsMetaData::iterator aFind = m_pKeyColumnNames->find(*aAutoIter); if ( aFind != aEnd ) - (_rInsertRow->get())[aFind->second.nPosition].fill(i,aFind->second.nType,aFind->second.bNullable,xRow); + (_rInsertRow->get())[aFind->second.nPosition].fill(i, aFind->second.nType, xRow); } } ::comphelper::disposeComponent(xStatement); @@ -1376,13 +1376,13 @@ sal_Bool OKeySet::fetchRow() { ORowSetRow aKeyRow = new connectivity::ORowVector< ORowSetValue >((*m_pKeyColumnNames).size() + m_pForeignColumnNames->size()); connectivity::ORowVector< ORowSetValue >::Vector::iterator aIter = aKeyRow->get().begin(); - // first fetch the values needed for the key column + // first fetch the values needed for the key columns SelectColumnsMetaData::const_iterator aPosIter = (*m_pKeyColumnNames).begin(); SelectColumnsMetaData::const_iterator aPosEnd = (*m_pKeyColumnNames).end(); for(;aPosIter != aPosEnd;++aPosIter,++aIter) { const SelectColumnDescription& rColDesc = aPosIter->second; - aIter->fill(rColDesc.nPosition,rColDesc.nType,rColDesc.bNullable,m_xDriverRow); + aIter->fill(rColDesc.nPosition, rColDesc.nType, m_xDriverRow); } // now fetch the values from the missing columns from other tables aPosIter = (*m_pForeignColumnNames).begin(); @@ -1390,7 +1390,7 @@ sal_Bool OKeySet::fetchRow() for(;aPosIter != aPosEnd;++aPosIter,++aIter) { const SelectColumnDescription& rColDesc = aPosIter->second; - aIter->fill(rColDesc.nPosition,rColDesc.nType,rColDesc.bNullable,m_xDriverRow); + aIter->fill(rColDesc.nPosition, rColDesc.nType, m_xDriverRow); } m_aKeyIter = m_aKeyMap.insert(OKeySetMatrix::value_type(m_aKeyMap.rbegin()->first+1,OKeySetValue(aKeyRow,::std::pair<sal_Int32,Reference<XRow> >(0,NULL)))).first; } diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx index 8228f95..801daeb 100644 --- a/dbaccess/source/core/api/OptimisticSet.cxx +++ b/dbaccess/source/core/api/OptimisticSet.cxx @@ -725,7 +725,7 @@ void OptimisticSet::fillMissingValues(ORowSetValueVector::Vector& io_aRow) const { if ( aColIter->second.sTableName == aSqlIter->first ) { - io_aRow[aColIter->second.nPosition].fill(i++,aColIter->second.nType,aColIter->second.bNullable,xRow); + io_aRow[aColIter->second.nPosition].fill(i++, aColIter->second.nType, xRow); io_aRow[aColIter->second.nPosition].setModified(); } } _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits