Skip to content

Adding support for TABLESPACE#2253

Open
LucaCappelletti94 wants to merge 2 commits intoapache:mainfrom
LucaCappelletti94:postgres-regression-8
Open

Adding support for TABLESPACE#2253
LucaCappelletti94 wants to merge 2 commits intoapache:mainfrom
LucaCappelletti94:postgres-regression-8

Conversation

@LucaCappelletti94
Copy link
Contributor

This PR adds cross-dialect TABLESPACE support by implementing PostgreSQL forms (CREATE/ALTER/DROP TABLESPACE) and MySQL forms (CREATE/ALTER/DROP [UNDO] TABLESPACE) with Generic dialect handling both syntaxes as a union parser, using explicit AST modeling instead of loose keyword parsing: CreateTablespace now carries dialect-specific definitions, MySQL ALTER TABLESPACE is represented as an ordered list of options to preserve multi-clause statements, and DROP TABLESPACE has a dedicated statement type to avoid over-accepting generic DROP behaviors and to keep dialect rules explicit (for example, PostgreSQL IF EXISTS vs MySQL-specific clauses)

Syntax and behavior were aligned against the official documentation for PostgreSQL CREATE TABLESPACE, PostgreSQL ALTER TABLESPACE, PostgreSQL DROP TABLESPACE, MySQL CREATE TABLESPACE, MySQL ALTER TABLESPACE, and MySQL DROP TABLESPACE, with coverage added in both MySQL and PostgreSQL parser tests.

If anybody's wondering where all of these PRs are coming from, I am running differential fuzzing against sqlparser vs postgres 18. It's a bit of a blood bath.

@LucaCappelletti94 LucaCappelletti94 marked this pull request as ready for review February 27, 2026 10:29
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.

1 participant