diff options
author | tilpner | 2020-06-11 12:00:12 +0200 |
---|---|---|
committer | tilpner | 2020-06-11 12:00:12 +0200 |
commit | 3282a2762adc1b67ec97266a3cd6f2e0c00641d8 (patch) | |
tree | b8e842a27a47f7197f4fe00708213d7ed96cdcad /src | |
parent | 4b0b4d064cb0106bb2c5d4f4858fcea21600333e (diff) | |
download | github-label-feed-3282a2762adc1b67ec97266a3cd6f2e0c00641d8.tar.gz github-label-feed-3282a2762adc1b67ec97266a3cd6f2e0c00641d8.tar.xz github-label-feed-3282a2762adc1b67ec97266a3cd6f2e0c00641d8.zip |
generate: fix bad join
Diffstat (limited to 'src')
-rw-r--r-- | src/generate.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/generate.rs b/src/generate.rs index 4ed1de0..edb1ffa 100644 --- a/src/generate.rs +++ b/src/generate.rs @@ -56,7 +56,7 @@ async fn query_issues_for_label<'conn>(conn: &'conn mut Conn, repo_id: i64, label: &str, state_mask: i64) -> impl Stream<Item=sqlx::Result<Issue>> + 'conn { sqlx::query_as::<_, Issue>(r#" SELECT issues.number, state, title, body, user_login, html_url, updated_at FROM issues - INNER JOIN is_labeled ON is_labeled.issue=issues.number + INNER JOIN is_labeled ON is_labeled.repo=issues.repo AND is_labeled.issue=issues.number WHERE is_labeled.label=(SELECT id FROM labels WHERE repo=? AND name=?) AND issues.state & ? != 0 ORDER BY issues.number DESC @@ -175,7 +175,7 @@ pub async fn run(mut conn: &mut Conn, opts: GenerateOpts) -> Result<()> { let labels_of_issue = sqlx::query_as::<_, (String,)>( "SELECT labels.name FROM is_labeled JOIN labels ON is_labeled.label=labels.id - JOIN issues ON (is_labeled.issue=issues.number AND is_labeled.repo=issues.repo) + JOIN issues ON is_labeled.repo=issues.repo AND is_labeled.issue=issues.number WHERE is_labeled.repo=? AND is_labeled.issue=?" ).bind(repo_id).bind(issue.number) .fetch(&mut *conn) |