summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Mazieres <dm@uun.org>2014-01-30 03:50:06 -0800
committerDavid Mazieres <dm@uun.org>2014-01-30 03:50:06 -0800
commita17695703cf734c126236e32d88ced720028d26b (patch)
tree30ff9c8841543a6309956df200956936ff64caef
parente46763186be8262831057ec32f5bcc350a5a4df8 (diff)
precedence of & is way to high.
-rw-r--r--protocol.cc2
-rw-r--r--xapian_sync.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/protocol.cc b/protocol.cc
index 797fdde..445311e 100644
--- a/protocol.cc
+++ b/protocol.cc
@@ -462,7 +462,7 @@ msg_sync::msg_sync (const string &maildir, sqlite3 *db)
set_link_count_(db_, "INSERT OR REPLACE INTO maildir_links"
" (hash_id, dir_id, link_count) VALUES (?, ?, ?);"),
delete_link_count_(db_, "DELETE FROM maildir_links"
- " WHERE hash_id = ? & dir_id = ?;"),
+ " WHERE (hash_id = ?) & (dir_id = ?);"),
clear_tags_(db_, "DELETE FROM tags WHERE docid = ?;"),
add_tag_(db_, "INSERT OR IGNORE INTO tags (docid, tag) VALUES (?, ?);"),
update_message_id_stamp_(db_, "UPDATE message_ids SET"
diff --git a/xapian_sync.cc b/xapian_sync.cc
index dea48f5..3767755 100644
--- a/xapian_sync.cc
+++ b/xapian_sync.cc
@@ -138,7 +138,7 @@ xapian_scan_tags (sqlite3 *sqldb, Xapian::Database &xdb)
sqlstmt_t
scan (sqldb, "SELECT docid FROM tags WHERE tag = ? ORDER BY docid ASC;"),
add_tag (sqldb, "INSERT INTO tags (docid, tag) VALUES (?, ?);"),
- del_tag (sqldb, "DELETE FROM tags WHERE docid = ? & tag = ?;");
+ del_tag (sqldb, "DELETE FROM tags WHERE (docid = ?) & (tag = ?);");
for (Xapian::TermIterator ti = xdb.allterms_begin(notmuch_tag_prefix),
te = xdb.allterms_end(notmuch_tag_prefix); ti != te; ti++) {