diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2023-08-09 23:47:31 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-09 23:47:31 +0100 |
| commit | 925bf0efaa522c8bf39f944d025b1c1248f9cfae (patch) | |
| tree | 038180c54719eed161f09c97a0d3102bc78a8057 /atuin-server-postgres/src | |
| parent | Bump lukemathwalker/cargo-chef (#1154) (diff) | |
| download | atuin-925bf0efaa522c8bf39f944d025b1c1248f9cfae.zip | |
Fix index tail leak (#1159)
Diffstat (limited to '')
| -rw-r--r-- | atuin-server-postgres/src/lib.rs | 2 |
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) |
