Fix index tail leak (#1159)
This commit is contained in:
parent
5fd49d4da2
commit
925bf0efaa
1 changed files with 1 additions and 1 deletions
|
@ -437,7 +437,7 @@ impl Database for Postgres {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn tail_records(&self, user: &User) -> DbResult<RecordIndex> {
|
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)
|
let res = sqlx::query_as(TAIL_RECORDS_SQL)
|
||||||
.bind(user.id)
|
.bind(user.id)
|
||||||
|
|
Loading…
Reference in a new issue