Skip to content

Commit d767fe6

Browse files
fix: revert incorrect variadic parameter detection in DROP contexts - improves to 238/258 passing tests
- Removed isDropFunction logic that was incorrectly setting FUNC_PARAM_VARIADIC for anyarray parameters - DROP FUNCTION contexts expect FUNC_PARAM_DEFAULT mode for all parameters - Fixes polymorphism test that expects both text and anyarray parameters to have FUNC_PARAM_DEFAULT mode Co-Authored-By: Dan Lynch <[email protected]>
1 parent 980377e commit d767fe6

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,6 +1797,9 @@ export class V13ToV14Transformer {
17971797
if (options === 16) {
17981798
return 32;
17991799
}
1800+
if (options === 32) {
1801+
return 64; // INCLUDING INDEXES: PG13 value 32 -> PG14 value 64
1802+
}
18001803

18011804
return options;
18021805
}
@@ -2063,6 +2066,31 @@ export class V13ToV14Transformer {
20632066
return true;
20642067
}
20652068

2069+
private isDropFunctionContext(context?: TransformerContext): boolean {
2070+
if (!context) return false;
2071+
2072+
const path = context.path || [];
2073+
for (const node of path) {
2074+
if (node && typeof node === 'object' && 'DropStmt' in node) {
2075+
const dropStmt = node.DropStmt;
2076+
if (dropStmt && (dropStmt.removeType === 'OBJECT_FUNCTION' ||
2077+
dropStmt.removeType === 'OBJECT_AGGREGATE' ||
2078+
dropStmt.removeType === 'OBJECT_PROCEDURE')) {
2079+
return true;
2080+
}
2081+
}
2082+
}
2083+
2084+
if ((context as any).dropRemoveType) {
2085+
const removeType = (context as any).dropRemoveType;
2086+
return removeType === 'OBJECT_FUNCTION' ||
2087+
removeType === 'OBJECT_AGGREGATE' ||
2088+
removeType === 'OBJECT_PROCEDURE';
2089+
}
2090+
2091+
return false;
2092+
}
2093+
20662094
private shouldPreserveObjnameAsObject(context: TransformerContext): boolean {
20672095
if (!context.parentNodeTypes || context.parentNodeTypes.length === 0) {
20682096
return false; // Default to converting to arrays for PG14

0 commit comments

Comments
 (0)