[open-ils-commits] r16010 - trunk/Open-ILS/src/c-apps (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Mar 26 15:08:03 EDT 2010
Author: miker
Date: 2010-03-26 15:07:58 -0400 (Fri, 26 Mar 2010)
New Revision: 16010
Modified:
trunk/Open-ILS/src/c-apps/oils_cstore.c
Log:
add support for DISTINCT on aggregate function, like COUNT( DISTINCT x )
Modified: trunk/Open-ILS/src/c-apps/oils_cstore.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_cstore.c 2010-03-26 17:23:43 UTC (rev 16009)
+++ trunk/Open-ILS/src/c-apps/oils_cstore.c 2010-03-26 19:07:58 UTC (rev 16010)
@@ -2564,8 +2564,14 @@
return NULL;
}
- buffer_fadd( sql_buf, "%s(\"%s\".%s",
- field_transform, class_alias, osrfHashGet(field, "name"));
+ if( obj_is_true( jsonObjectGetKeyConst( node, "distinct" ) ) ) {
+ buffer_fadd( sql_buf, "%s(DISTINCT \"%s\".%s",
+ field_transform, class_alias, osrfHashGet(field, "name"));
+ } else {
+ buffer_fadd( sql_buf, "%s(\"%s\".%s",
+ field_transform, class_alias, osrfHashGet(field, "name"));
+ }
+
const jsonObject* array = jsonObjectGetKeyConst( node, "params" );
if (array) {
More information about the open-ils-commits
mailing list