[open-ils-commits] [GIT] Evergreen ILS branch master updated. 6349068fe22ff9431fca5ad9f1adadd6a5d0aea6
Evergreen Git
git at git.evergreen-ils.org
Tue Dec 13 11:38:17 EST 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via 6349068fe22ff9431fca5ad9f1adadd6a5d0aea6 (commit)
from 88e8361ec62eff973dfe757cecf92281db052f17 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6349068fe22ff9431fca5ad9f1adadd6a5d0aea6
Author: Bill Erickson <berick at esilibrary.com>
Date: Tue Dec 13 11:03:23 2011 -0500
json_query boolean function param support
Solves the following problem when passing boolean parameter values to
json_query functions using the 'from' construct.
E.g. {"from" : ["some_func_name", true]}
oils_sql.c:2568 open-ils.cstore: Error quoting key string [(null)]
Signed-off-by: Bill Erickson <berick at esilibrary.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/c-apps/oils_sql.c b/Open-ILS/src/c-apps/oils_sql.c
index b79c579..e0b545c 100644
--- a/Open-ILS/src/c-apps/oils_sql.c
+++ b/Open-ILS/src/c-apps/oils_sql.c
@@ -2560,16 +2560,24 @@ static char* searchValueTransform( const jsonObject* array ) {
if( func_item->type == JSON_NULL ) {
buffer_add( sql_buf, "NULL" );
} else {
- char* val = jsonObjectToSimpleString( func_item );
- if( dbi_conn_quote_string( dbhandle, &val )) {
- OSRF_BUFFER_ADD( sql_buf, val );
- free( val );
+ if( func_item->type == JSON_BOOL ) {
+ if( jsonBoolIsTrue(func_item) ) {
+ buffer_add( sql_buf, "TRUE" );
+ } else {
+ buffer_add( sql_buf, "FALSE" );
+ }
} else {
- osrfLogError( OSRF_LOG_MARK, "%s: Error quoting key string [%s]",
- modulename, val );
- buffer_free( sql_buf );
- free( val );
- return NULL;
+ char* val = jsonObjectToSimpleString( func_item );
+ if( dbi_conn_quote_string( dbhandle, &val )) {
+ OSRF_BUFFER_ADD( sql_buf, val );
+ free( val );
+ } else {
+ osrfLogError( OSRF_LOG_MARK,
+ "%s: Error quoting key string [%s]", modulename, val );
+ buffer_free( sql_buf );
+ free( val );
+ return NULL;
+ }
}
}
}
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/c-apps/oils_sql.c | 26 +++++++++++++++++---------
1 files changed, 17 insertions(+), 9 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list