fix: add missing nulls_not_distinct property to IndexStmt transformer#199
Merged
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Add nulls_not_distinct property handling in v15-to-v16 IndexStmt transformer - Enable previously skipped CREATE INDEX test cases with NULLS NOT DISTINCT - Fixes transformer failures for create_index-72.sql, create_index-83.sql, create_index-85.sql, create_index-184.sql Co-Authored-By: Dan Lynch <pyramation@gmail.com>
3c6ce29 to
07c0ab4
Compare
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.
fix: add missing nulls_not_distinct property to IndexStmt transformer
Summary
Fixed a transformer issue where CREATE INDEX statements with
NULLS NOT DISTINCTclause were failing in the PostgreSQL v15-to-v16 transformer. TheIndexStmttransformer was missing thenulls_not_distinctproperty handling, causing test cases likecreate_index-72.sqlto be skipped.Changes:
nulls_not_distinctproperty handling to theIndexStmttransformer inv15-to-v16.tstransformer-errors.tsReview & Testing Checklist for Human
Risk Level: 🟡 Medium - Simple change following established patterns, but limited validation of SQL syntax and type definitions
nulls_not_distinctproperty exists in both PG15 and PG16IndexStmttype definitions in the schema fileslatest/postgres/create_index-72.sql) to understand the exact CREATE INDEX syntax being transformedIndexStmttransformer with similar transformers (likeConstraint) to see if other properties are missingCREATE UNIQUE INDEX idx ON tbl (col) NULLS NOT DISTINCTsyntax and verify it transforms correctlyDiagram
%%{ init : { "theme" : "default" }}%% graph TD subgraph "Transform Package" V15ToV16["packages/transform/src/transformers/v15-to-v16.ts"]:::major-edit Errors["packages/transform/test-utils/skip-tests/transformer-errors.ts"]:::minor-edit Tests["packages/transform/__tests__/kitchen-sink/15-16/latest-postgres-create_index.test.ts"]:::context end subgraph "SQL Test Files" SQL72["latest/postgres/create_index-72.sql"]:::context SQL83["latest/postgres/create_index-83.sql"]:::context SQL85["latest/postgres/create_index-85.sql"]:::context SQL184["latest/postgres/create_index-184.sql"]:::context end V15ToV16 -->|"transforms"| SQL72 V15ToV16 -->|"transforms"| SQL83 V15ToV16 -->|"transforms"| SQL85 V15ToV16 -->|"transforms"| SQL184 Tests -->|"runs"| SQL72 Tests -->|"runs"| SQL83 Tests -->|"runs"| SQL85 Tests -->|"runs"| SQL184 Errors -->|"controls skipping"| Tests subgraph Legend L1["Major Edit"]:::major-edit (green) L2["Minor Edit"]:::minor-edit (blue) L3["Context/No Edit"]:::context (white) end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
Constrainttransformer wherenulls_not_distinctis already properly handledNULLS NOT DISTINCTis a PostgreSQL feature for unique indexes that treats NULL values as distinct from each other