[open-ils-commits] r12149 - trunk/Open-ILS/src/c-apps (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Feb 11 12:02:21 EST 2009


Author: miker
Date: 2009-02-11 12:02:19 -0500 (Wed, 11 Feb 2009)
New Revision: 12149

Modified:
   trunk/Open-ILS/src/c-apps/oils_cstore.c
Log:
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

Modified: trunk/Open-ILS/src/c-apps/oils_cstore.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_cstore.c	2009-02-11 14:38:25 UTC (rev 12148)
+++ trunk/Open-ILS/src/c-apps/oils_cstore.c	2009-02-11 17:02:19 UTC (rev 12149)
@@ -1683,7 +1683,7 @@
 	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 @@
 			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 );



More information about the open-ils-commits mailing list