From 925bf0efaa522c8bf39f944d025b1c1248f9cfae Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Wed, 9 Aug 2023 23:47:31 +0100 Subject: [PATCH] Fix index tail leak (#1159) --- atuin-server-postgres/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atuin-server-postgres/src/lib.rs b/atuin-server-postgres/src/lib.rs index 3b001bb..9dc5031 100644 --- a/atuin-server-postgres/src/lib.rs +++ b/atuin-server-postgres/src/lib.rs @@ -437,7 +437,7 @@ impl Database for Postgres { } async fn tail_records(&self, user: &User) -> DbResult { - const TAIL_RECORDS_SQL: &str = "select host, tag, client_id from records rp where (select count(1) from records where parent=rp.client_id and user_id = $1) = 0;"; + const TAIL_RECORDS_SQL: &str = "select host, tag, client_id from records rp where (select count(1) from records where parent=rp.client_id and user_id = $1) = 0 and user_id = $1;"; let res = sqlx::query_as(TAIL_RECORDS_SQL) .bind(user.id)