[open-ils-commits] r13221 - trunk/Open-ILS/src/c-apps (scottmk)

svn at svn.open-ils.org svn at svn.open-ils.org
Sun May 24 18:22:22 EDT 2009


Author: scottmk
Date: 2009-05-24 18:22:18 -0400 (Sun, 24 May 2009)
New Revision: 13221

Modified:
   trunk/Open-ILS/src/c-apps/oils_cstore.c
Log:
In SELECT(): Eliminate a sanity check and error message because
they are now redundant.

We don't need to verify that a class in the SELECT clause is
defined in the IDL, because we also verify that the class is
referenced in the FROM clause, and all of those classes have
already been vetted against the IDL.


Modified: trunk/Open-ILS/src/c-apps/oils_cstore.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_cstore.c	2009-05-24 16:58:50 UTC (rev 13220)
+++ trunk/Open-ILS/src/c-apps/oils_cstore.c	2009-05-24 22:22:18 UTC (rev 13221)
@@ -2936,34 +2936,8 @@
 	    jsonIterator* selclass_itr = jsonNewIterator( selhash );
 	    while ( (selclass = jsonIteratorNext( selclass_itr )) ) {    // For each class
 
-		    // Make sure the class is defined in the IDL
 			const char* cname = selclass_itr->key;
-			osrfHash* idlClass = osrfHashGet( oilsIDL(), cname );
-		    if (!idlClass) {
-				osrfLogError(
-					OSRF_LOG_MARK,
-					"%s: Selected class \"%s\" not defined in IDL",
-					MODULENAME,
-					cname
-				);
 
-				if (ctx)
-					osrfAppSessionStatus(
-						ctx->session,
-						OSRF_STATUS_INTERNALSERVERERROR,
-						"osrfMethodException",
-						ctx->request,
-						"Selected class is not defined"
-					);
-				jsonIteratorFree( selclass_itr );
-				buffer_free( sql_buf );
-				buffer_free( select_buf );
-				buffer_free( group_buf );
-				if( defaultselhash ) jsonObjectFree( defaultselhash );
-				free( core_class );
-				return NULL;
-			}
-
 			// Make sure the target relation is in the FROM clause.
 			
 			// At this point join_hash is a step down from the join_hash we
@@ -3003,6 +2977,7 @@
 
 			// Look up some attributes of the current class, so that we 
 			// don't have to look them up again for each field
+			osrfHash* idlClass = osrfHashGet( oilsIDL(), cname );
 			osrfHash* class_field_set = osrfHashGet( idlClass, "fields" );
 			const char* class_pkey = osrfHashGet( idlClass, "primarykey" );
 			const char* class_tname = osrfHashGet( idlClass, "tablename" );



More information about the open-ils-commits mailing list