fix off-by-one on function literal construction (for function-in-from and literal...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Feb 2009 17:02:19 +0000 (17:02 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Feb 2009 17:02:19 +0000 (17:02 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12149 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index d166c9d..64b7428 100644 (file)
@@ -1683,7 +1683,7 @@ static char* searchValueTransform( const jsonObject* array ) {
        while ( (func_item = jsonObjectGetIndex(array, func_item_index++)) ) {
 
                // Add a separator comma, if we need one
-               if( func_item_index > 1 )
+               if( func_item_index > 2 )
                        buffer_add( sql_buf, ", " );
 
                // Add the current parameter
@@ -2357,8 +2357,9 @@ static char* SELECT (
                        return NULL;    // Malformed join_hash; extra entry
 
        } else if (join_hash->type == JSON_ARRAY) {
-        from_function = 1;
-        selhash = NULL;
+               from_function = 1;
+               core_class = jsonObjectToSimpleString( jsonObjectGetIndex(join_hash, 0) );
+               selhash = NULL;
 
        } else if (join_hash->type == JSON_STRING) {
                core_class = jsonObjectToSimpleString( join_hash );