From: miker Date: Mon, 15 Dec 2008 16:17:45 +0000 (+0000) Subject: WHERE clause debugging X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f3ac519c7cf4cb9ace3cc4df8b98f93a632de1be;p=Evergreen.git WHERE clause debugging git-svn-id: svn://svn.open-ils.org/ILS/trunk@11577 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/c-apps/oils_cstore.c b/Open-ILS/src/c-apps/oils_cstore.c index 828ed08055..e15fa31198 100644 --- a/Open-ILS/src/c-apps/oils_cstore.c +++ b/Open-ILS/src/c-apps/oils_cstore.c @@ -674,6 +674,8 @@ int dispatchCRUDMethod ( osrfMethodContext* ctx ) { #endif obj = doFieldmapperSearch(ctx, class_obj, _p, &err); + + jsonObjectFree(_p); if(err) return err; jsonObject* cur; @@ -715,6 +717,7 @@ int dispatchCRUDMethod ( osrfMethodContext* ctx ) { free(_s); obj = doFieldmapperSearch(ctx, class_obj, _p, &err); + jsonObjectFree(_p); if(err) return err; @@ -2039,6 +2042,7 @@ static char* searchWHERE ( const jsonObject* search_hash, osrfHash* meta, int op int first = 1; if ( search_hash->type == JSON_ARRAY ) { + osrfLogDebug(OSRF_LOG_MARK, "%s: In WHERE clause, condition type is JSON_ARRAY", MODULENAME); jsonIterator* search_itr = jsonNewIterator( search_hash ); while ( (node = jsonIteratorNext( search_itr )) ) { if (first) { @@ -2055,6 +2059,7 @@ static char* searchWHERE ( const jsonObject* search_hash, osrfHash* meta, int op jsonIteratorFree(search_itr); } else if ( search_hash->type == JSON_HASH ) { + osrfLogDebug(OSRF_LOG_MARK, "%s: In WHERE clause, condition type is JSON_HASH", MODULENAME); jsonIterator* search_itr = jsonNewIterator( search_hash ); while ( (node = jsonIteratorNext( search_itr )) ) { @@ -3057,6 +3062,7 @@ static jsonObject* doFieldmapperSearch ( osrfMethodContext* ctx, osrfHash* meta, char* sql = buildSELECT( search_hash, order_hash, meta, ctx ); if (!sql) { + osrfLogDebug(OSRF_LOG_MARK, "Problem building query, returning NULL"); *err = -1; return NULL; }