** Fix for bug #544501
authorSrinivasa Ragavan <sragavan@novell.com>
Thu, 24 Jul 2008 13:43:27 +0000 (13:43 +0000)
committerSrinivasa Ragavan <sragavan@src.gnome.org>
Thu, 24 Jul 2008 13:43:27 +0000 (13:43 +0000)
2008-07-24  Srinivasa Ragavan  <sragavan@novell.com>

** Fix for bug #544501

* camel/camel-search-sql.c: Handle single node search queries.

svn path=/trunk/; revision=9178

camel/ChangeLog
camel/camel-search-sql.c

index d52c36a..6f11caa 100644 (file)
@@ -1,5 +1,11 @@
 2008-07-24  Srinivasa Ragavan  <sragavan@novell.com>
 
+       ** Fix for bug #544501
+
+       * camel/camel-search-sql.c: Handle single node search queries.
+
+2008-07-24  Srinivasa Ragavan  <sragavan@novell.com>
+
        ** Fix for bug #544528
 
        * camel/camel-search-sql.c: Ignore match-threads. It wont be supported
index bcd1c69..2a93852 100644 (file)
@@ -729,6 +729,16 @@ camel_sexp_to_sql (const char *txt)
 
        /* Time to operate on the stack. */
        tmp = all;
+       if (g_list_length (all) == 1) {
+               n1 = all->data;
+               
+               sql = g_strdup (n1->exact_token);
+               free_node(n1);
+               g_list_free (all);
+               g_scanner_destroy(scanner);
+               return sql;
+       }
+               
        while (all->next) {
                 n1 = tmp->data;
                 all = g_list_delete_link (all, all);
@@ -872,7 +882,8 @@ int main ()
        "(and (match-all (and (not (system-flag \"deleted\")) (not (system-flag \"junk\")))) (and   (or (match-all (not (= (get-sent-date) 1216146600))) )))",
        "(and (match-all (and (not (system-flag \"deleted\")) (not (system-flag \"junk\")))) (and   (or (match-all (= (get-sent-date) 1216146600)) )))" ,
        "(and (match-all (and (not (system-flag \"deleted\")) (not (system-flag \"junk\")))) (and   (and (match-all (header-contains \"Subject\"  \"mysubject\")) (match-all (not (header-matches \"From\"  \"mysender\"))) (match-all (= (get-sent-date) (+ (get-current-date) 1))) (match-all (= (get-received-date) (- (get-current-date) 604800))) (match-all (or (= (user-tag \"label\")  \"important\") (user-flag (+ \"$Label\"  \"important\")) (match-all (< (get-size) 7000)) (match-all (not (= (get-sent-date) 1216146600)))  (match-all (> (cast-int (user-tag \"score\")) 3))  (user-flag  \"important\"))) (match-all (system-flag  \"Deleted\")) (match-all (not (= (user-tag \"follow-up\") \"\"))) (match-all (= (user-tag \"completed-on\") \"\")) (match-all (system-flag \"Attachments\")) (match-all (header-contains \"x-camel-mlist\"  \"evo-hackers\")) )))",
-       "(match-threads \"all\"  (or (match-all (header-contains \"From\"  \"@edesvcs.com\")) (match-all (or (header-contains \"To\"  \"@edesvcs.com\") (header-contains \"Cc\"  \"@edesvcs.com\"))) ))"
+       "(match-threads \"all\"  (or (match-all (header-contains \"From\"  \"@edesvcs.com\")) (match-all (or (header-contains \"To\"  \"@edesvcs.com\") (header-contains \"Cc\"  \"@edesvcs.com\"))) ))",
+       "(match-all (not (system-flag \"deleted\")))"
 
        };