Skip to content

Commit 2a92baf

Browse files
committed
fix: filter args of postgres
1 parent 1328e0b commit 2a92baf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

store/db/postgres/memo_relation.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func (d *DB) ListMemoRelations(ctx context.Context, find *store.FindMemoRelation
5656
return nil, err
5757
}
5858
convertCtx := filter.NewConvertContext()
59+
convertCtx.ArgsOffset = len(args)
5960
// ConvertExprToSQL converts the parsed expression to a SQL condition string.
6061
if err := d.ConvertExprToSQL(convertCtx, parsedExpr.GetExpr()); err != nil {
6162
return nil, err
@@ -64,7 +65,7 @@ func (d *DB) ListMemoRelations(ctx context.Context, find *store.FindMemoRelation
6465
if condition != "" {
6566
where = append(where, fmt.Sprintf("memo_id IN (SELECT id FROM memo WHERE %s)", condition))
6667
where = append(where, fmt.Sprintf("related_memo_id IN (SELECT id FROM memo WHERE %s)", condition))
67-
args = append(args, append(convertCtx.Args, convertCtx.Args...)...)
68+
args = append(args, convertCtx.Args...)
6869
}
6970
}
7071

0 commit comments

Comments
 (0)