In SELECT(): Eliminate a sanity check and error message because
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 24 May 2009 22:22:18 +0000 (22:22 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 24 May 2009 22:22:18 +0000 (22:22 +0000)
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.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@13221 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/c-apps/oils_cstore.c

index 1a5b549..d78a713 100644 (file)
@@ -2936,33 +2936,7 @@ char* SELECT (
            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.
                        
@@ -3003,6 +2977,7 @@ char* SELECT (
 
                        // 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" );