evolution-data-server r9915 - trunk/camel
- From: msuman svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r9915 - trunk/camel
- Date: Mon, 12 Jan 2009 03:57:14 +0000 (UTC)
Author: msuman
Date: Mon Jan 12 03:57:14 2009
New Revision: 9915
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9915&view=rev
Log:
Patch from Matt McCutchen 2 <matt mattmccutchen net>: Fix for bug #564954 (Fix SQL-ization of booleans and immediate-function confusion).
Modified:
trunk/camel/ChangeLog
trunk/camel/camel-search-sql-sexp.c
Modified: trunk/camel/camel-search-sql-sexp.c
==============================================================================
--- trunk/camel/camel-search-sql-sexp.c (original)
+++ trunk/camel/camel-search-sql-sexp.c Mon Jan 12 03:57:14 2009
@@ -297,11 +297,11 @@
ESExpResult *r;
d(printf("executing match-all: %d", argc));
- if (argv[0]->type != ESEXP_TERM_TIME)
+ if (argv[0]->type != ESEXP_TERM_BOOL)
r = e_sexp_term_eval(f, argv[0]);
else {
r = e_sexp_result_new(f, ESEXP_RES_STRING);
- r->value.string = g_strdup("");
+ r->value.string = g_strdup(argv[0]->value.bool ? "1" : "0");
}
return r;
@@ -562,7 +562,7 @@
static struct {
char *name;
ESExpFunc *func;
- int builtin :1;
+ int immediate :1;
} symbols[] = {
{ "and", (ESExpFunc *) func_and, 1 },
{ "or", (ESExpFunc *) func_or, 1},
@@ -571,8 +571,8 @@
{ ">", (ESExpFunc *)eval_gt, 1},
{ "<", (ESExpFunc *)eval_lt, 1},
- { "match-all", (ESExpFunc *)match_all, 0 },
- { "match-threads", (ESExpFunc *)match_threads, 0 },
+ { "match-all", (ESExpFunc *)match_all, 1 },
+ { "match-threads", (ESExpFunc *)match_threads, 1 },
/* { "body-contains", body_contains}, */ /* We don't store body on the db. */
{ "header-contains", header_contains, 0},
{ "header-matches", header_matches, 0},
@@ -603,8 +603,12 @@
sexp = e_sexp_new();
for(i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
- e_sexp_add_function(sexp, 0, symbols[i].name,
- symbols[i].func, NULL);
+ if (symbols[i].immediate)
+ e_sexp_add_ifunction(sexp, 0, symbols[i].name,
+ symbols[i].func, NULL);
+ else
+ e_sexp_add_function(sexp, 0, symbols[i].name,
+ symbols[i].func, NULL);
}
e_sexp_input_text (sexp, sql, strlen (sql));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]