mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Fix the typo in the SQL (#26)
* - Ensure the correct ID is returned from the Max statements as the NullInt64 was not working as expected - Check before creating the nextAccountDataID * - Set the pos output var correctly and fix typo in the SQL Co-authored-by: alexf@example.com <alexf@example.com>
This commit is contained in:
parent
6d27770a69
commit
66cfcca1cb
|
|
@ -67,7 +67,7 @@ const selectAccountDataInRangeSQL = "" +
|
||||||
"select * from c where c._cn = @x1 " +
|
"select * from c where c._cn = @x1 " +
|
||||||
"and c.mx_syncapi_account_data_type.user_id = @x2 " +
|
"and c.mx_syncapi_account_data_type.user_id = @x2 " +
|
||||||
"and c.mx_syncapi_account_data_type.id > @x3 " +
|
"and c.mx_syncapi_account_data_type.id > @x3 " +
|
||||||
"and c.mx_syncapi_account_data_type.id < @x4 " +
|
"and c.mx_syncapi_account_data_type.id <= @x4 " +
|
||||||
"order by c.mx_syncapi_account_data_type.id "
|
"order by c.mx_syncapi_account_data_type.id "
|
||||||
|
|
||||||
// "SELECT MAX(id) FROM syncapi_account_data_type"
|
// "SELECT MAX(id) FROM syncapi_account_data_type"
|
||||||
|
|
@ -137,6 +137,7 @@ func (s *accountDataStatements) InsertAccountData(
|
||||||
|
|
||||||
dbData, _ := getAccountDataType(s, ctx, s.getPartitionKey(), cosmosDocId)
|
dbData, _ := getAccountDataType(s, ctx, s.getPartitionKey(), cosmosDocId)
|
||||||
if dbData != nil {
|
if dbData != nil {
|
||||||
|
pos = types.StreamPosition(dbData.AccountDataType.ID)
|
||||||
dbData.SetUpdateTime()
|
dbData.SetUpdateTime()
|
||||||
} else {
|
} else {
|
||||||
pos, err = s.streamIDStatements.nextAccountDataID(ctx, txn)
|
pos, err = s.streamIDStatements.nextAccountDataID(ctx, txn)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue