Skip to content

Commit 4b2a0c9

Browse files
fix: preserve num field in AlterTableCmd 14->15 transformation
- Add missing num field handling in AlterTableCmd transformation method - Enable create_index-345.sql test that was previously skipped - Fixes AST transformation mismatch for ALTER INDEX ... ALTER COLUMN ... SET STATISTICS Co-Authored-By: Dan Lynch <[email protected]>
1 parent a47f5d4 commit 4b2a0c9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,10 @@ export class V14ToV15Transformer {
786786
result.name = node.name;
787787
}
788788

789+
if (node.num !== undefined) {
790+
result.num = node.num;
791+
}
792+
789793
if (node.newowner !== undefined) {
790794
result.newowner = this.transform(node.newowner as any, context);
791795
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const transformerErrors: SkipTest[] = [
2222
[15, 16, "latest/postgres/create_index-326.sql", "15-16 transformer fails with syntax error at end of input"],
2323
[15, 16, "latest/postgres/create_index-184.sql", "15-16 transformer fails with missing nulls_not_distinct property"],
2424

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

2727
[13, 14, "original/upstream/rangetypes-300.sql", "AST transformer bug - converts FUNC_PARAM_DEFAULT to FUNC_PARAM_IN for function parameters"],
2828
[13, 14, "original/upstream/rangetypes-294.sql", "AST transformer bug - converts FUNC_PARAM_DEFAULT to FUNC_PARAM_IN for function parameters"],
@@ -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)