[fdo-commits] r201 - in branches/3.2.x/Providers/SDF/Src: Provider
Utils
svn_fdo at osgeo.org
svn_fdo at osgeo.org
Wed Feb 7 15:00:45 EST 2007
Author: danstoica
Date: 2007-02-07 15:00:45 -0500 (Wed, 07 Feb 2007)
New Revision: 201
Modified:
branches/3.2.x/Providers/SDF/Src/Provider/SdfDelete.cpp
branches/3.2.x/Providers/SDF/Src/Provider/SdfQueryOptimizer.cpp
branches/3.2.x/Providers/SDF/Src/Provider/SdfQueryOptimizer.h
branches/3.2.x/Providers/SDF/Src/Provider/SdfSelect.cpp
branches/3.2.x/Providers/SDF/Src/Provider/SdfUpdate.cpp
branches/3.2.x/Providers/SDF/Src/Utils/FilterExecutor.h
Log:
Misspelled property name in query causes crash
Modified: branches/3.2.x/Providers/SDF/Src/Provider/SdfDelete.cpp
===================================================================
--- branches/3.2.x/Providers/SDF/Src/Provider/SdfDelete.cpp 2007-02-07 00:53:17 UTC (rev 200)
+++ branches/3.2.x/Providers/SDF/Src/Provider/SdfDelete.cpp 2007-02-07 20:00:45 UTC (rev 201)
@@ -23,8 +23,8 @@
#include "SdfDeletingFeatureReader.h"
#include "DataDb.h"
#include "PropertyIndex.h"
+#include <FdoCommonFilterExecutor.h>
-
//-------------------------------------------------------
// Constructor / destructor
//-------------------------------------------------------
@@ -74,7 +74,7 @@
if( clas == NULL )
throw FdoException::Create(NlsMsgGetMain(FDO_NLSID(SDFPROVIDER_75_CLASS_NOTFOUND), m_className->GetName()));
if( m_filter != NULL )
- SdfQueryOptimizer::ValidateFilter( clas, m_filter );
+ FdoCommonFilterExecutor::ValidateFilter( clas, m_filter );
m_connection->FlushAll( clas, true );
Modified: branches/3.2.x/Providers/SDF/Src/Provider/SdfQueryOptimizer.cpp
===================================================================
--- branches/3.2.x/Providers/SDF/Src/Provider/SdfQueryOptimizer.cpp 2007-02-07 00:53:17 UTC (rev 200)
+++ branches/3.2.x/Providers/SDF/Src/Provider/SdfQueryOptimizer.cpp 2007-02-07 20:00:45 UTC (rev 201)
@@ -834,145 +834,3 @@
return false;
}
-
-
-void SdfQueryOptimizer::ValidateFilter( FdoClassDefinition *cls, FdoFilter *filter )
-{
- class SdfFilterValidator : public virtual FdoIExpressionProcessor, public virtual FdoIFilterProcessor
- {
- private:
- FdoClassDefinition* m_class;
-
- protected:
-
- void HandleExpr( FdoExpression *exp )
- {
- exp->Process( this );
- }
- void HandleFilter( FdoFilter *filter )
- {
- filter->Process( this );
- }
- public:
-
- SdfFilterValidator( FdoClassDefinition *cls )
- {
- m_class = cls;
- }
-
- virtual void Dispose() { delete this; }
-
- /// <summary>Increase the reference count.</summary>
- /// <returns>Returns the new reference count (value for debugging use only).</returns>
- FdoInt32 AddRef()
- {
- // NOTE: due to multiple inheritance, there is an ambiguity in which AddRef() method to call.
- // Calling BOTH AddRef() methods leads to instances of this class being prematurely released.
- return FdoIFilterProcessor::AddRef();
- }
-
- /// <summary>Decrease the reference count.</summary>
- /// <returns>Returns the new reference count (value for debugging use only).</returns>
- FdoInt32 Release ()
- {
- // NOTE: due to multiple inheritance, there is an ambiguity in which Release() method to call.
- // Calling BOTH Release() methods leads to instances of this class being prematurely released.
- return FdoIFilterProcessor::Release();
- }
-
- virtual void ProcessBinaryExpression(FdoBinaryExpression& expr)
- {
- HandleExpr( FdoPtr<FdoExpression>(expr.GetLeftExpression()) );
- HandleExpr( FdoPtr<FdoExpression>(expr.GetRightExpression()) );
- }
- virtual void ProcessBooleanValue(FdoBooleanValue& expr) { }
- virtual void ProcessByteValue(FdoByteValue& expr){ }
- virtual void ProcessDateTimeValue(FdoDateTimeValue& expr){ }
- virtual void ProcessDoubleValue(FdoDoubleValue& expr){ }
- virtual void ProcessDecimalValue(FdoDecimalValue& expr){ }
- virtual void ProcessInt16Value(FdoInt16Value& expr){ }
- virtual void ProcessInt32Value(FdoInt32Value& expr){ }
- virtual void ProcessInt64Value(FdoInt64Value& expr){ }
- virtual void ProcessSingleValue(FdoSingleValue& expr){ }
- virtual void ProcessStringValue(FdoStringValue& expr){ }
- virtual void ProcessBLOBValue(FdoBLOBValue& expr){ }
- virtual void ProcessCLOBValue(FdoCLOBValue& expr){ }
- virtual void ProcessFunction(FdoFunction& expr)
- {
- FdoPtr<FdoExpressionCollection>col = expr.GetArguments();
- for(int i=0; i<col->GetCount(); i++)
- HandleExpr( FdoPtr<FdoExpression>(col->GetItem( i ) ) );
- }
- virtual void ProcessGeometryValue(FdoGeometryValue& expr){ }
- virtual void ProcessParameter(FdoParameter& expr){ }
- virtual void ProcessUnaryExpression(FdoUnaryExpression& expr)
- {
- HandleExpr( FdoPtr<FdoExpression>(expr.GetExpression()) );
- }
- virtual void ProcessBinaryLogicalOperator(FdoBinaryLogicalOperator& filter)
- {
- HandleFilter( FdoPtr<FdoFilter>(filter.GetLeftOperand()) );
- HandleFilter( FdoPtr<FdoFilter>(filter.GetRightOperand()) );
- }
- virtual void ProcessComparisonCondition(FdoComparisonCondition& filter)
- {
- HandleExpr( FdoPtr<FdoExpression>(filter.GetLeftExpression()) );
- HandleExpr( FdoPtr<FdoExpression>(filter.GetRightExpression()) );
- }
- virtual void ProcessDistanceCondition(FdoDistanceCondition& filter){ }
-
- virtual void ProcessInCondition(FdoInCondition& filter)
- {
- ProcessIdentifier( *(FdoPtr<FdoIdentifier>(filter.GetPropertyName())) );
- }
- virtual void ProcessNullCondition(FdoNullCondition& filter)
- {
- ProcessIdentifier( *(FdoPtr<FdoIdentifier>(filter.GetPropertyName())) );
- }
- virtual void ProcessSpatialCondition(FdoSpatialCondition& filter){ }
-
- virtual void ProcessUnaryLogicalOperator(FdoUnaryLogicalOperator& filter)
- {
- HandleFilter( FdoPtr<FdoFilter>(filter.GetOperand()) );
- }
-
- virtual void ProcessIdentifier(FdoIdentifier& expr)
- {
- // This is used to validate the property names referenced in the filter.
- FdoPtr<FdoPropertyDefinitionCollection>props = m_class->GetProperties();
- FdoPtr<FdoReadOnlyPropertyDefinitionCollection>basePops = m_class->GetBaseProperties();
- FdoPtr<FdoPropertyDefinition> prop;
-
- int length;
- // If any of the identifiers is a decorated name of the form <obj proper>.<property>, then this is
- // an association or object proeperty; assume it exist for now.
- if( expr.GetScope( length ) && length > 0 )
- return;
-
- prop = props->FindItem( expr.GetName() );
- if( prop != NULL )
- return;
-
- try
- {
- prop = basePops->GetItem( expr.GetName() );
- if( prop != NULL )
- return;
- }
- catch(FdoException *exp )
- {
- exp->Release();
- }
-
- throw FdoException::Create(NlsMsgGetMain(FDO_NLSID(SDFPROVIDER_97_PROPERTY_NOTFOUND), expr.GetName(), m_class->GetName() ));
- }
-
- virtual void ProcessComputedIdentifier(FdoComputedIdentifier& expr)
- {
- HandleExpr( FdoPtr<FdoExpression>(expr.GetExpression()) );
- }
- };
-
- SdfFilterValidator validator(cls);
- filter->Process( &validator );
-}
Modified: branches/3.2.x/Providers/SDF/Src/Provider/SdfQueryOptimizer.h
===================================================================
--- branches/3.2.x/Providers/SDF/Src/Provider/SdfQueryOptimizer.h 2007-02-07 00:53:17 UTC (rev 200)
+++ branches/3.2.x/Providers/SDF/Src/Provider/SdfQueryOptimizer.h 2007-02-07 20:00:45 UTC (rev 201)
@@ -117,8 +117,6 @@
SDF_API virtual void ProcessGeometryValue(FdoGeometryValue& expr);
- static void ValidateFilter( FdoClassDefinition *cls, FdoFilter *filter );
-
public:
//-----------------------------------------------------------------
Modified: branches/3.2.x/Providers/SDF/Src/Provider/SdfSelect.cpp
===================================================================
--- branches/3.2.x/Providers/SDF/Src/Provider/SdfSelect.cpp 2007-02-07 00:53:17 UTC (rev 200)
+++ branches/3.2.x/Providers/SDF/Src/Provider/SdfSelect.cpp 2007-02-07 20:00:45 UTC (rev 201)
@@ -21,6 +21,7 @@
#include "SdfQueryOptimizer.h"
#include "SdfSimpleFeatureReader.h"
#include "FilterExecutor.h"
+#include <FdoCommonFilterExecutor.h>
//-------------------------------------------------------
// Constructor / destructor
@@ -117,7 +118,7 @@
throw FdoException::Create(NlsMsgGetMain(FDO_NLSID(SDFPROVIDER_75_CLASS_NOTFOUND), m_className->GetName()));
if( m_filter != NULL )
- SdfQueryOptimizer::ValidateFilter( clas, m_filter );
+ FdoCommonFilterExecutor::ValidateFilter( clas, m_filter, m_properties );
//get the R-Tree for this feature class...
SdfRTree* rt = m_connection->GetRTree(clas);
Modified: branches/3.2.x/Providers/SDF/Src/Provider/SdfUpdate.cpp
===================================================================
--- branches/3.2.x/Providers/SDF/Src/Provider/SdfUpdate.cpp 2007-02-07 00:53:17 UTC (rev 200)
+++ branches/3.2.x/Providers/SDF/Src/Provider/SdfUpdate.cpp 2007-02-07 20:00:45 UTC (rev 201)
@@ -21,8 +21,8 @@
#include "SdfUpdatingFeatureReader.h"
#include "SdfQueryOptimizer.h"
#include "DataDb.h"
+#include <FdoCommonFilterExecutor.h>
-
//-------------------------------------------------------
// Constructor / destructor
//-------------------------------------------------------
@@ -85,7 +85,7 @@
throw FdoException::Create(NlsMsgGetMain(FDO_NLSID(SDFPROVIDER_75_CLASS_NOTFOUND), m_className->GetName()));
if( m_filter != NULL )
- SdfQueryOptimizer::ValidateFilter( clas, m_filter );
+ FdoCommonFilterExecutor::ValidateFilter( clas, m_filter );
m_connection->FlushAll( clas, true );
Modified: branches/3.2.x/Providers/SDF/Src/Utils/FilterExecutor.h
===================================================================
--- branches/3.2.x/Providers/SDF/Src/Utils/FilterExecutor.h 2007-02-07 00:53:17 UTC (rev 200)
+++ branches/3.2.x/Providers/SDF/Src/Utils/FilterExecutor.h 2007-02-07 20:00:45 UTC (rev 201)
@@ -20,7 +20,7 @@
#include "DataValue.h"
#include "DataValueStack.h"
-typedef DataValueStack<DataValue> retval_stack;
+typedef DataValueStack<DataValue> sdf_retval_stack;
//forward declare
class DataValuePool;
@@ -130,7 +130,7 @@
protected:
//execution stack
- retval_stack m_retvals;
+ sdf_retval_stack m_retvals;
//feature reader
FdoIFeatureReader* m_reader;
More information about the fdo-commits
mailing list