This repository was archived by the owner on Sep 30, 2024. It is now read-only.
packages: fix package ref listing query with limit#47442
Merged
Conversation
efritz
approved these changes
Feb 8, 2023
Contributor
|
I tend to use 'rank' for row number (not a bit, just a fun fact) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The list package repo refs query accidentally worked under the assumption of what the data should ideally look like (unique
(scheme,name)tuples). This is not true in stage 1 of the migration, where there is still one(scheme,name)tuple for every version of that tuple.Continuing: in step 1 of the migration, we copy for every row in lsif_dependency_repos into package_repo_versions, using the smallest ID for every
(scheme,name)as the "canonical" package repo entry ID (this is so when we collapse n into 1, every entry in package_repo_versions still points to an existing package repo reference).Thus when joining the two tables, every entry besides the first for every
(scheme,name)would not have an accompanying entry in the latter table, thus not being in the final result set. This happens after the limit factor, so we would end up with <= limit.There was also a bug with the count section that was fixed here, because the reduce happens in-application instead of in SQL :^)
Test plan
Added extra part in existing unit test and tested the extra part with before and after