mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-22 19:51:39 +00:00
Fix account data position
This commit is contained in:
parent
6892e0f0e0
commit
f6d07768a8
@ -105,6 +105,7 @@ func (s *accountDataStatements) SelectAccountDataInRange(
|
|||||||
accountDataEventFilter *gomatrixserverlib.EventFilter,
|
accountDataEventFilter *gomatrixserverlib.EventFilter,
|
||||||
) (data map[string][]string, pos types.StreamPosition, err error) {
|
) (data map[string][]string, pos types.StreamPosition, err error) {
|
||||||
data = make(map[string][]string)
|
data = make(map[string][]string)
|
||||||
|
pos = r.Low()
|
||||||
|
|
||||||
rows, err := s.selectAccountDataInRangeStmt.QueryContext(ctx, userID, r.Low(), r.High(),
|
rows, err := s.selectAccountDataInRangeStmt.QueryContext(ctx, userID, r.Low(), r.High(),
|
||||||
pq.StringArray(filterConvertTypeWildcardToSQL(accountDataEventFilter.Types)),
|
pq.StringArray(filterConvertTypeWildcardToSQL(accountDataEventFilter.Types)),
|
||||||
@ -118,7 +119,7 @@ func (s *accountDataStatements) SelectAccountDataInRange(
|
|||||||
|
|
||||||
var dataType string
|
var dataType string
|
||||||
var roomID string
|
var roomID string
|
||||||
id := r.From
|
var id types.StreamPosition
|
||||||
|
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
if err = rows.Scan(&id, &roomID, &dataType); err != nil {
|
if err = rows.Scan(&id, &roomID, &dataType); err != nil {
|
||||||
|
@ -96,6 +96,7 @@ func (s *accountDataStatements) SelectAccountDataInRange(
|
|||||||
r types.Range,
|
r types.Range,
|
||||||
filter *gomatrixserverlib.EventFilter,
|
filter *gomatrixserverlib.EventFilter,
|
||||||
) (data map[string][]string, pos types.StreamPosition, err error) {
|
) (data map[string][]string, pos types.StreamPosition, err error) {
|
||||||
|
pos = r.Low()
|
||||||
data = make(map[string][]string)
|
data = make(map[string][]string)
|
||||||
stmt, params, err := prepareWithFilters(
|
stmt, params, err := prepareWithFilters(
|
||||||
s.db, nil, selectAccountDataInRangeSQL,
|
s.db, nil, selectAccountDataInRangeSQL,
|
||||||
@ -114,7 +115,7 @@ func (s *accountDataStatements) SelectAccountDataInRange(
|
|||||||
|
|
||||||
var dataType string
|
var dataType string
|
||||||
var roomID string
|
var roomID string
|
||||||
id := r.From
|
var id types.StreamPosition
|
||||||
|
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
if err = rows.Scan(&id, &roomID, &dataType); err != nil {
|
if err = rows.Scan(&id, &roomID, &dataType); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user