summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Mazieres <dm@uun.org>2023-01-08 16:00:56 -0800
committerDavid Mazieres <dm@uun.org>2023-01-08 16:00:56 -0800
commita7dbca85ccd1c023f5298e22abb0cdf5701da5d0 (patch)
tree16fd4ef30dbbd79d9d3d0df50eb614c40190e7b6
parent9e2bcdca4d33b5522fb5275b1f06a38b850418c7 (diff)
parent8f62e01878574b2d06fd52e193d4e6b975db8358 (diff)
Merge branch 'master' of market.scs.stanford.edu:hack/repos/muchsync
-rw-r--r--NEWS12
-rw-r--r--protocol.cc8
2 files changed, 16 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index a7b3329..cd1b140 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,18 @@ Update to format man page with recent versions of pandoc.
Improve some error handing and error messages.
+Fixed a performance bug in which SQL queries used bitwise & instead of
+logical AND, which caused a linear scan of a database table when files
+were moved or deleted.
+
+* Changes in release 6
+
+Clarified that it's okay to link against OpenSSL libcrypto.
+
+Update to format man page with recent versions of pandoc.
+
+Improve some error handing and error messages.
+
* Changes in release 5
Fixed a race condition that could cause a core dump on fast networks
diff --git a/protocol.cc b/protocol.cc
index aad43be..35580cb 100644
--- a/protocol.cc
+++ b/protocol.cc
@@ -146,11 +146,11 @@ msg_sync::msg_sync (notmuch_db &nm, sqlite3 *db)
" (dir_docid, name, docid, mtime, inode, hash_id)"
" VALUES (?, ?, ?, ?, ?, ?);"),
del_file_(db, "DELETE FROM xapian_files"
- " WHERE (dir_docid = ?) & (name = ?);"),
+ " WHERE (dir_docid = ?) AND (name = ?);"),
set_link_count_(db_, "INSERT OR REPLACE INTO xapian_nlinks"
" (hash_id, dir_docid, link_count) VALUES (?, ?, ?);"),
delete_link_count_(db_, "DELETE FROM xapian_nlinks"
- " WHERE (hash_id = ?) & (dir_docid = ?);"),
+ " WHERE (hash_id = ?) AND (dir_docid = ?);"),
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"
@@ -593,7 +593,7 @@ send_links (sqlite3 *sqldb, const string &prefix, ostream &out)
SELECT h.hash_id, hash, size, message_id, h.replica, h.version,
dir_docid, link_count
FROM (peer_vector p JOIN maildir_hashes h
- ON ((p.replica = h.replica) & (p.known_version < h.version)))
+ ON ((p.replica = h.replica) AND (p.known_version < h.version)))
LEFT OUTER JOIN xapian_nlinks USING (hash_id);)");
i64 count = 0;
@@ -628,7 +628,7 @@ send_tags (sqlite3 *sqldb, const string &prefix, ostream &out)
sqlstmt_t changed (sqldb, R"(
SELECT m.docid, m.message_id, m.replica, m.version, tags.tag
FROM (peer_vector p JOIN message_ids m
- ON ((p.replica = m.replica) & (p.known_version < m.version)))
+ ON ((p.replica = m.replica) AND (p.known_version < m.version)))
LEFT OUTER JOIN tags USING (docid);)");
tag_info ti;