Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix negated introduced:x search #2306

Merged
merged 1 commit into from Jan 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions rslib/src/search/sqlwriter.rs
Expand Up @@ -578,11 +578,11 @@ impl SqlWriter<'_> {
write!(
self.sql,
concat!(
"(SELECT min(id) > {cutoff} FROM revlog WHERE cid = c.id ",
"((SELECT coalesce(min(id) > {cutoff}, false) FROM revlog WHERE cid = c.id ",
// Exclude manual reschedulings
"AND ease != 0) ",
// Logically redundant, speeds up query
"AND c.id IN (SELECT cid FROM revlog WHERE id > {cutoff})"
"AND c.id IN (SELECT cid FROM revlog WHERE id > {cutoff}))"
),
cutoff = cutoff,
)
Expand Down Expand Up @@ -785,8 +785,8 @@ mod test {
s(ctx, "introduced:3").0,
format!(
concat!(
"((SELECT min(id) > {cutoff} FROM revlog WHERE cid = c.id AND ease != 0) ",
"AND c.id IN (SELECT cid FROM revlog WHERE id > {cutoff}))"
"(((SELECT coalesce(min(id) > {cutoff}, false) FROM revlog WHERE cid = c.id AND ease != 0) ",
"AND c.id IN (SELECT cid FROM revlog WHERE id > {cutoff})))"
),
cutoff = (timing.next_day_at.0 - (86_400 * 3)) * 1_000,
)
Expand Down