Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
8be5284e
Commit
8be5284e
authored
9 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Remove pointless join
parent
503e4d3d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/storage/state.py
+4
-5
4 additions, 5 deletions
synapse/storage/state.py
with
4 additions
and
5 deletions
synapse/storage/state.py
+
4
−
5
View file @
8be5284e
...
...
@@ -130,16 +130,15 @@ class StateStore(SQLBaseStore):
def
get_current_state
(
self
,
room_id
,
event_type
=
None
,
state_key
=
""
):
def
f
(
txn
):
sql
=
(
"
SELECT e.event_id FROM events as e
"
"
INNER JOIN current_state_events as c ON e.event_id = c.event_id
"
"
WHERE c.room_id = ?
"
"
SELECT event_id FROM current_state_events
"
"
WHERE room_id = ?
"
)
if
event_type
and
state_key
is
not
None
:
sql
+=
"
AND
c.
type = ? AND
c.
state_key = ?
"
sql
+=
"
AND type = ? AND state_key = ?
"
args
=
(
room_id
,
event_type
,
state_key
)
elif
event_type
:
sql
+=
"
AND
c.
type = ?
"
sql
+=
"
AND type = ?
"
args
=
(
room_id
,
event_type
)
else
:
args
=
(
room_id
,
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment