Do not return null when PostgreSQL tablespaces are disabled - #1354
Merged
Merged
Conversation
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.
Problem
#1350 stops
CREATE_TABLESPACEfrom being scheduled when tablespace testing is disabled, which is the default on every platform other than Linux. QPG reaches the generator through a different path, so with--qpg-enable trueevery worker still dies with aNullPointerExceptiononQuery.getLogString()inGlobalState.executePrologue.Cause
ProviderAdapter.mutateTables()selects a mutation by reward andPostgresProvider.executeMutator()resolves it withAction.values()[index]. That path does not consultmapActions(), so the scheduling guard does not apply to it,PostgresTableSpaceGenerator.generate()returnsnull, andexecuteStatement()dereferences it.CREATE_TABLESPACEis the only one of the 28 PostgreSQL actions whose generator can returnnull, so this is the only action affected.Reproduction
On macOS or Windows:
With the default interval of 1000 the same failure needs a long run, and CI does not see it because it runs on Linux.
Fix
Throw
IgnoreMeExceptionfrom the generator.mutateTables()already catches it, so the QPG framework needs no change. The scheduling guard from #1350 stays as it is and remains the reason the generator is never called during database generation.Testing
mvn -Dtest=sqlancer.postgres.gen.TestPostgresTableSpaceGenerator testpasses. Verified on Windows with the reproduction command above: QPG runs to completion.