FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Do not return null when PostgreSQL tablespaces are disabled by splf-jojo · Pull Request #1354 · sqlancer/sqlancer · GitHub

Do not return null when PostgreSQL tablespaces are disabled - #1354

Merged
mrigger merged 1 commit into
sqlancer:mainfrom
splf-jojo:fix/postgres-tablespace-qpg-path
Aug 3, 2026
Merged

Do not return null when PostgreSQL tablespaces are disabled#1354
mrigger merged 1 commit into
sqlancer:mainfrom
splf-jojo:fix/postgres-tablespace-qpg-path

Conversation

Copy link
Copy Markdown
Contributor

Problem

#1350 stops CREATE_TABLESPACE from 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 true every worker still dies with a NullPointerException on Query.getLogString() in GlobalState.executePrologue.

Cause

ProviderAdapter.mutateTables() selects a mutation by reward and PostgresProvider.executeMutator() resolves it with Action.values()[index]. That path does not consult mapActions(), so the scheduling guard does not apply to it, PostgresTableSpaceGenerator.generate() returns null, and executeStatement() dereferences it.

CREATE_TABLESPACE is the only one of the 28 PostgreSQL actions whose generator can return null, so this is the only action affected.

Reproduction

On macOS or Windows:

java -jar target/sqlancer-2.0.0.jar --num-threads 1 --num-queries 20 postgres --oracle NOREC --qpg-enable true --qpg-max-interval 1

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 IgnoreMeException from 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 test passes. Verified on Windows with the reproduction command above: QPG runs to completion.

mrigger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Great, thanks!

mrigger merged commit 781b1e6 into sqlancer:main Aug 3, 2026
22 of 25 checks passed
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL