[gom] filter: Respect filter priorities
- From: Mathieu Bridon <mbridon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gom] filter: Respect filter priorities
- Date: Mon, 8 Dec 2014 18:18:48 +0000 (UTC)
commit ac381b1240093f93f1ff3e4c1b60f4c6dd9d8512
Author: Mathieu Bridon <bochecha daitauha fr>
Date: Thu Nov 27 19:38:51 2014 +0100
filter: Respect filter priorities
This adds parenthesis to the generated SQL queries where appropriate.
https://bugzilla.gnome.org/show_bug.cgi?id=740701
gom/gom-filter.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gom/gom-filter.c b/gom/gom-filter.c
index 59cb09d..8db1a0e 100644
--- a/gom/gom-filter.c
+++ b/gom/gom-filter.c
@@ -429,6 +429,12 @@ gom_filter_get_sql (GomFilter *filter,
f = g_queue_peek_nth(priv->subfilters, i);
s = gom_filter_get_sql(f, table_map);
+ if ((f->priv->mode == GOM_FILTER_AND) || (f->priv->mode == GOM_FILTER_OR)) {
+ gchar *tmp = g_strdup_printf("(%s)", s);
+ g_free(s);
+ s = tmp;
+ }
+
sqls[i] = s;
}
sqls[i] = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]