-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix get_last_event_in_room_before_stream_ordering(...)
finding the wrong last event
#17295
Fix get_last_event_in_room_before_stream_ordering(...)
finding the wrong last event
#17295
Commits on Jun 12, 2024
-
Fix
get_last_event_in_room_before_stream_ordering(...)
not finding ……the last event Previously, it would use the event with the lowest `stream_ordering` that was fetched (we want the highest `stream_ordering. `union` does not work how you might think at first and does not preserve the ordering of the operand queries. `union all` also doesn't necessarily have that gurantee but it does behave that way. See https://dba.stackexchange.com/questions/316818/are-results-from-union-all-clauses-always-appended-in-order/316835#316835
Configuration menu - View commit details
-
Copy full SHA for 87ad458 - Browse repository at this point
Copy the full SHA 87ad458View commit details -
Add actual guranteed order for UNION
We use `union all` because we don't need any of the deduplication logic (`union` is really a union + distinct). `UNION ALL`` does preserve the ordering of the operand queries but there is no actual gurantee that it has this behavior in all scenarios so we need the extra `ORDER BY` at the bottom. See https://dba.stackexchange.com/questions/316818/are-results-from-union-all-clauses-always-appended-in-order/316835#316835
Configuration menu - View commit details
-
Copy full SHA for 431b31e - Browse repository at this point
Copy the full SHA 431b31eView commit details -
Configuration menu - View commit details
-
Copy full SHA for d7f40ae - Browse repository at this point
Copy the full SHA d7f40aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for a8056ae - Browse repository at this point
Copy the full SHA a8056aeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f317a9 - Browse repository at this point
Copy the full SHA 3f317a9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 54bdc0c - Browse repository at this point
Copy the full SHA 54bdc0cView commit details -
Merge branch 'develop' into madlittlemods/fix-and-tests-for-get_last_…
…event_in_room_before_stream_ordering
Configuration menu - View commit details
-
Copy full SHA for 4d585b6 - Browse repository at this point
Copy the full SHA 4d585b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for d3ba660 - Browse repository at this point
Copy the full SHA d3ba660View commit details -
Merge branch 'develop' into madlittlemods/fix-and-tests-for-get_last_…
…event_in_room_before_stream_ordering
Configuration menu - View commit details
-
Copy full SHA for 8a9cc2b - Browse repository at this point
Copy the full SHA 8a9cc2bView commit details