mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-06 14:33:10 -06:00
fix
This commit is contained in:
parent
0791010dcc
commit
05aac3d0f1
|
|
@ -242,10 +242,10 @@ func newSQLiteDatabase(conMan *sqlutil.Connections, dbOpts *config.DatabaseOptio
|
|||
WHERE room_id = $1
|
||||
ORDER BY origin_server_ts
|
||||
`
|
||||
if d.selectChildrenByRoomIdForParentOldestFirstStmt, err = d.db.Prepare(selectChildrenByRoomIdQuery + " ASC"); err != nil {
|
||||
if d.selectChildrenByRoomIdForParentOldestFirstStmt, err = d.db.Prepare(selectChildrenByRoomIdQuery + " ASC LIMIT $2 OFFSET $3"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if d.selectChildrenByRoomIdForParentRecentFirstStmt, err = d.db.Prepare(selectChildrenByRoomIdQuery + " DESC"); err != nil {
|
||||
if d.selectChildrenByRoomIdForParentRecentFirstStmt, err = d.db.Prepare(selectChildrenByRoomIdQuery + " DESC LIMIT $2 OFFSET $3"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &d, nil
|
||||
|
|
@ -348,7 +348,7 @@ func (p *DB) GetChildrensByRoomId(ctx context.Context, roomID string, recentFirs
|
|||
var rows *sql.Rows
|
||||
var err error
|
||||
if recentFirst {
|
||||
rows, err = p.selectChildrenForParentRecentFirstStmt.QueryContext(ctx, roomID, limit, offset)
|
||||
rows, err = p.selectChildrenByRoomIdForParentRecentFirstStmt.QueryContext(ctx, roomID, limit, offset)
|
||||
} else {
|
||||
rows, err = p.selectChildrenByRoomIdForParentOldestFirstStmt.QueryContext(ctx, roomID, limit, offset)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue