From e2d7761806c78a680d74a8bd0d8dbeca0829aea1 Mon Sep 17 00:00:00 2001 From: miker Date: Wed, 11 Feb 2009 17:02:19 +0000 Subject: [PATCH] fix off-by-one on function literal construction (for function-in-from and literal value transforms); use the function name as the from clause alias, avoiding "(null)" as the alias git-svn-id: svn://svn.open-ils.org/ILS/trunk@12149 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/c-apps/oils_cstore.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/c-apps/oils_cstore.c b/Open-ILS/src/c-apps/oils_cstore.c index d166c9d7fc..64b742802d 100644 --- a/Open-ILS/src/c-apps/oils_cstore.c +++ b/Open-ILS/src/c-apps/oils_cstore.c @@ -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 ); -- 2.11.0