Fix sqlancer#1249: Postgres REINDEX now generate only one index name per statement#1250
Open
albertZhangTJ wants to merge 1 commit intosqlancer:mainfrom
Open
Fix sqlancer#1249: Postgres REINDEX now generate only one index name per statement#1250albertZhangTJ wants to merge 1 commit intosqlancer:mainfrom
albertZhangTJ wants to merge 1 commit intosqlancer:mainfrom
Conversation
mrigger
reviewed
Jun 30, 2025
| throw new IgnoreMeException(); | ||
| } | ||
| sb.append(indexes.stream().map(i -> i.getIndexName()).collect(Collectors.joining())); | ||
| sb.append(indexes.stream().skip(Randomly.getNotCachedInteger(0, indexes.size())).findFirst().map(i -> i.getIndexName()).orElse("")); |
Contributor
There was a problem hiding this comment.
Thanks! That looks quite complex. Could we use the Randomly class to get a random element of the indexes list and obtain the name of the index?
Also, I think we should investigate why this code currently does not trigger any bugs. There might be a more fundamental issue. For example, do we only generate one index at most?
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In Postgres, each REINDEX statement can only work on one index, as can be seen here.
The previous edition will instead generate all index names, concatenated without delimiter.