Skip to content

Commit 07c0ab4

Browse files
committed
fix: add missing nulls_not_distinct property to IndexStmt transformer
- 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 <[email protected]>
1 parent a47f5d4 commit 07c0ab4

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

packages/transform/src/transformers/v15-to-v16.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2131,6 +2131,9 @@ export class V15ToV16Transformer {
21312131
result.unique = node.unique;
21322132
}
21332133

2134+
if (node.nulls_not_distinct !== undefined) {
2135+
result.nulls_not_distinct = node.nulls_not_distinct;
2136+
}
21342137

21352138
if (node.primary !== undefined) {
21362139
result.primary = node.primary;

packages/transform/test-utils/skip-tests/transformer-errors.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export const transformerErrors: SkipTest[] = [
1616

1717
[15, 16, "original/upstream/json-102.sql", "15-16 transformer fails with function name transformation - adds pg_catalog schema qualification"],
1818
[15, 16, "latest/postgres/create_view-281.sql", "15-16 transformer fails with AST transformation mismatch"],
19-
[15, 16, "latest/postgres/create_index-85.sql", "15-16 transformer fails with missing nulls_not_distinct property"],
20-
[15, 16, "latest/postgres/create_index-83.sql", "15-16 transformer fails with missing nulls_not_distinct property"],
21-
[15, 16, "latest/postgres/create_index-72.sql", "15-16 transformer fails with missing nulls_not_distinct property"],
19+
// [15, 16, "latest/postgres/create_index-85.sql", "15-16 transformer fails with missing nulls_not_distinct property"],
20+
// [15, 16, "latest/postgres/create_index-83.sql", "15-16 transformer fails with missing nulls_not_distinct property"],
21+
// [15, 16, "latest/postgres/create_index-72.sql", "15-16 transformer fails with missing nulls_not_distinct property"],
2222
[15, 16, "latest/postgres/create_index-326.sql", "15-16 transformer fails with syntax error at end of input"],
23-
[15, 16, "latest/postgres/create_index-184.sql", "15-16 transformer fails with missing nulls_not_distinct property"],
23+
// [15, 16, "latest/postgres/create_index-184.sql", "15-16 transformer fails with missing nulls_not_distinct property"],
2424

2525
[14, 15, "latest/postgres/create_index-345.sql", "AST transformation mismatch (extra \"num\": 1 field)"],
2626

@@ -93,4 +93,4 @@ export const transformerErrors: SkipTest[] = [
9393
[13, 14, "latest/postgres/create_function_sql-91.sql", "AST transformer bug - converts FUNC_PARAM_DEFAULT to FUNC_PARAM_IN in CREATE FUNCTION statements with default parameter values"],
9494
[13, 14, "latest/postgres/create_function_sql-90.sql", "AST transformer bug - converts FUNC_PARAM_DEFAULT to FUNC_PARAM_IN in CREATE FUNCTION statements with default parameter values"],
9595
[13, 14, "latest/postgres/create_function_sql-115.sql", "AST transformer bug - incorrectly adds parameter names to objfuncargs in DROP FUNCTION statements"],
96-
];
96+
];

0 commit comments

Comments
 (0)