[fdo-commits] r174 - in branches/3.2.x/Providers/SHP/Src: Message Provider

svn_fdo at osgeo.org svn_fdo at osgeo.org
Wed Feb 7 15:02:47 EST 2007


Author: danstoica
Date: 2007-02-07 15:02:47 -0500 (Wed, 07 Feb 2007)
New Revision: 174

Modified:
   branches/3.2.x/Providers/SHP/Src/Message/ShpMessage.mc
   branches/3.2.x/Providers/SHP/Src/Provider/ShpDeleteCommand.cpp
   branches/3.2.x/Providers/SHP/Src/Provider/ShpSelectCommand.cpp
   branches/3.2.x/Providers/SHP/Src/Provider/ShpUpdateCommand.cpp
Log:
Misspelled property name in query causes crash

Modified: branches/3.2.x/Providers/SHP/Src/Message/ShpMessage.mc
===================================================================
--- branches/3.2.x/Providers/SHP/Src/Message/ShpMessage.mc	2007-02-07 00:52:17 UTC (rev 173)
+++ branches/3.2.x/Providers/SHP/Src/Message/ShpMessage.mc	2007-02-07 20:02:47 UTC (rev 174)
@@ -392,7 +392,7 @@
 MessageId=4039
 SymbolicName=SHP_DEFAULT_SCHEMA_NAME
 Language=English
-Default
+Deffffft
 .
 MessageId=4040
 SymbolicName=SHP_DEFAULT_SCHEMA_DESCRIPTION

Modified: branches/3.2.x/Providers/SHP/Src/Provider/ShpDeleteCommand.cpp
===================================================================
--- branches/3.2.x/Providers/SHP/Src/Provider/ShpDeleteCommand.cpp	2007-02-07 00:52:17 UTC (rev 173)
+++ branches/3.2.x/Providers/SHP/Src/Provider/ShpDeleteCommand.cpp	2007-02-07 20:02:47 UTC (rev 174)
@@ -78,7 +78,16 @@
 		connection->SetLastEditedFileSet(fileset);
 
 		featid = ShpSchemaUtilities::GetIdentityPropertyName (mConnection, class_name);
+
+		// Validate the filter
+		if( mFilter != NULL )
+		{
+			FdoPtr<FdoClassDefinition> clas = ShpSchemaUtilities::GetLogicalClassDefinition (connection, class_name, NULL);
+			FdoCommonFilterExecutor::ValidateFilter( clas, mFilter );
+		}
+
         reader = new ShpFeatureReader (FdoPtr<ShpConnection> ((ShpConnection*)GetConnection ()), class_name, mFilter, NULL);
+
         while (reader->ReadNext ())
         {
             id = (int)reader->GetInt32 (featid);

Modified: branches/3.2.x/Providers/SHP/Src/Provider/ShpSelectCommand.cpp
===================================================================
--- branches/3.2.x/Providers/SHP/Src/Provider/ShpSelectCommand.cpp	2007-02-07 00:52:17 UTC (rev 173)
+++ branches/3.2.x/Providers/SHP/Src/Provider/ShpSelectCommand.cpp	2007-02-07 20:02:47 UTC (rev 174)
@@ -95,6 +95,14 @@
     id = GetFeatureClassName ();
     class_name = id->GetText ();
     FdoPtr<ShpConnection> shpConn = (ShpConnection*)GetConnection ();
+
+	// Validate the filter. The filter may contain computed expressions involving not selected properties 
+	if( mFilter != NULL )
+	{
+		FdoPtr<FdoClassDefinition> clas = ShpSchemaUtilities::GetLogicalClassDefinition (shpConn, class_name, NULL);
+        FdoCommonFilterExecutor::ValidateFilter( clas, mFilter, mPropertiesToSelect );
+	}
+
     ret = new ShpFeatureReader (shpConn, class_name, mFilter, mPropertiesToSelect);
 
     return (FDO_SAFE_ADDREF (ret.p));

Modified: branches/3.2.x/Providers/SHP/Src/Provider/ShpUpdateCommand.cpp
===================================================================
--- branches/3.2.x/Providers/SHP/Src/Provider/ShpUpdateCommand.cpp	2007-02-07 00:52:17 UTC (rev 173)
+++ branches/3.2.x/Providers/SHP/Src/Provider/ShpUpdateCommand.cpp	2007-02-07 20:02:47 UTC (rev 174)
@@ -89,8 +89,14 @@
 		connection->SetLastEditedFileSet(fileset);
 
 		featid = ShpSchemaUtilities::GetIdentityPropertyName (mConnection, class_name);
+
+		// Validate the filter
+		if( mFilter != NULL )
+			FdoCommonFilterExecutor::ValidateFilter( logicalClass, mFilter );
+
         reader = new ShpFeatureReader (FdoPtr<ShpConnection> ((ShpConnection*)GetConnection ()), class_name, mFilter, NULL);
-        while (reader->ReadNext ())
+        
+		while (reader->ReadNext ())
         {
             id = reader->GetInt32 (featid);
             id--; // featid are 0-based within the provider and 1-based outside the FDO API.



More information about the fdo-commits mailing list