Repository navigation
SS-496 add option ALL COLUMNS NULLABLE to postgres CTFS - #39680
Conversation
52000bd to
e375178
Compare
QA LLM Review1. MEDIUM --
|
QA LLM Review1. HIGH -- The
|
martykulma
left a comment
There was a problem hiding this comment.
This should have a SHOW CREATE TABLE round trip test as well.
Otherwise, lgtm!
### Motivation #39680 added `EXCLUDE ALL NOT NULL CONSTRAINTS` to `CREATE TABLE .. FROM SOURCE`. The parser, option plumbing, and feature flag gate are source-agnostic, but only the Postgres purifier applied it, so MySQL tables silently kept their `NOT NULL` constraints. ### Description Thread the flag through the MySQL purifier and mark every column nullable, matching the Postgres behavior. The unsupported-source guard in `purify_create_table_from_source` now also covers this option, so source types without support reject it instead of ignoring it. Columns of a retained primary key stay NOT NULL. The planner declares them NOT NULL regardless of the purified desc, so marking them nullable disabled the decoder's NULL check for a column persist treats as non-nullable. MySQL schema verification compares keys by name and columns, so a key dropped and restored while the source was behind is not reported, and a NULL written in between panicked clusterd. Postgres compares keys by constraint OID, so a recreated key is reported before any such row is decoded, and its purifier is unchanged. ### Verification Extends `test/mysql-cdc/exclude-constraints.td` with the same cases #39680 added for Postgres: `SHOW CREATE` roundtrip, index key, column nullability, the combination with `EXCLUDE CONSTRAINTS ('PRIMARY')`, `DROP NOT NULL` as a non-event, and PRIMARY KEY and UNIQUE drops still erroring with the hint. Also adds the drop-and-restore-while-paused scenario from the review, which panicked clusterd before the second commit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Adds a new
WITHoptionALL COLUMNS NULLABLEto the PostgresCREATE TABLE FROM SOURCEsyntax, allowing users to specify that anyNOT NULLconstraints should be ignored, are droppable, and the corresponding Materialize columns are nullable.Adds sql-parser ddl test cases, and adds to the
pg-cdc/exclude-constraints.tdtestdrive file with cases covering this logic.