aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@elliehuxtable.com>2023-08-09 23:47:31 +0100
committerGitHub <noreply@github.com>2023-08-09 23:47:31 +0100
commit925bf0efaa522c8bf39f944d025b1c1248f9cfae (patch)
tree038180c54719eed161f09c97a0d3102bc78a8057
parentBump lukemathwalker/cargo-chef (#1154) (diff)
downloadatuin-925bf0efaa522c8bf39f944d025b1c1248f9cfae.zip
Fix index tail leak (#1159)
-rw-r--r--atuin-server-postgres/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/atuin-server-postgres/src/lib.rs b/atuin-server-postgres/src/lib.rs
index 3b001bbb..9dc50312 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<RecordIndex> {
- 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)