mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-17 03:43:11 -06:00
Fix constants in SQLite event state keys table
This commit is contained in:
parent
d94b1c2eb9
commit
f7556e0431
|
|
@ -47,14 +47,14 @@ const selectEventStateKeyNIDSQL = `
|
||||||
|
|
||||||
// Bulk lookup from string state key to numeric ID for that state key.
|
// Bulk lookup from string state key to numeric ID for that state key.
|
||||||
// Takes an array of strings as the query parameter.
|
// Takes an array of strings as the query parameter.
|
||||||
const bulkSelectEventStateKeyNIDSQL = `
|
const bulkSelectEventStateKeySQL = `
|
||||||
SELECT event_state_key, event_state_key_nid FROM roomserver_event_state_keys
|
SELECT event_state_key, event_state_key_nid FROM roomserver_event_state_keys
|
||||||
WHERE event_state_key IN ($1)
|
WHERE event_state_key IN ($1)
|
||||||
`
|
`
|
||||||
|
|
||||||
// Bulk lookup from numeric ID to string state key for that state key.
|
// Bulk lookup from numeric ID to string state key for that state key.
|
||||||
// Takes an array of strings as the query parameter.
|
// Takes an array of strings as the query parameter.
|
||||||
const bulkSelectEventStateKeySQL = `
|
const bulkSelectEventStateKeyNIDSQL = `
|
||||||
SELECT event_state_key, event_state_key_nid FROM roomserver_event_state_keys
|
SELECT event_state_key, event_state_key_nid FROM roomserver_event_state_keys
|
||||||
WHERE event_state_key_nid IN ($1)
|
WHERE event_state_key_nid IN ($1)
|
||||||
`
|
`
|
||||||
|
|
@ -110,7 +110,7 @@ func (s *eventStateKeyStatements) bulkSelectEventStateKeyNID(
|
||||||
for k, v := range eventStateKeys {
|
for k, v := range eventStateKeys {
|
||||||
iEventStateKeys[k] = v
|
iEventStateKeys[k] = v
|
||||||
}
|
}
|
||||||
selectOrig := strings.Replace(bulkSelectEventStateKeyNIDSQL, "($1)", common.QueryVariadic(len(eventStateKeys)), 1)
|
selectOrig := strings.Replace(bulkSelectEventStateKeySQL, "($1)", common.QueryVariadic(len(eventStateKeys)), 1)
|
||||||
|
|
||||||
rows, err := txn.QueryContext(ctx, selectOrig, iEventStateKeys...)
|
rows, err := txn.QueryContext(ctx, selectOrig, iEventStateKeys...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -136,7 +136,7 @@ func (s *eventStateKeyStatements) bulkSelectEventStateKey(
|
||||||
for k, v := range eventStateKeyNIDs {
|
for k, v := range eventStateKeyNIDs {
|
||||||
iEventStateKeyNIDs[k] = v
|
iEventStateKeyNIDs[k] = v
|
||||||
}
|
}
|
||||||
selectOrig := strings.Replace(bulkSelectEventStateKeySQL, "($1)", common.QueryVariadic(len(eventStateKeyNIDs)), 1)
|
selectOrig := strings.Replace(bulkSelectEventStateKeyNIDSQL, "($1)", common.QueryVariadic(len(eventStateKeyNIDs)), 1)
|
||||||
|
|
||||||
rows, err := txn.QueryContext(ctx, selectOrig, iEventStateKeyNIDs...)
|
rows, err := txn.QueryContext(ctx, selectOrig, iEventStateKeyNIDs...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue