Skip to content

Commit 3bc99f1

Browse files
Fix over-transformation of zero values in INSERT statements
- Remove broad Integer transformation fallback that was catching zero values - Make A_Const transformation more conservative for INSERT VALUES context - Zero values in INSERT statements should remain as empty objects {} - Test pass rate improved from 184 to 193 passing tests Co-Authored-By: Dan Lynch <[email protected]>
1 parent 9dd4960 commit 3bc99f1

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,7 @@ export class V15ToV16Transformer {
547547
if (typeof result.ival === 'object' && Object.keys(result.ival).length === 0) {
548548
const parentTypes = childContext.parentNodeTypes || [];
549549
if (parentTypes.includes('TypeName') ||
550-
(parentTypes.includes('DefineStmt') && !(context as any).defElemName) ||
551-
(parentTypes.includes('InsertStmt') && parentTypes.includes('SelectStmt') && parentTypes.includes('List'))) {
550+
(parentTypes.includes('DefineStmt') && !(context as any).defElemName)) {
552551
result.ival = this.Integer(result.ival as any, childContext).Integer;
553552
}
554553
} else {
@@ -912,9 +911,6 @@ export class V15ToV16Transformer {
912911
result.ival = -1; // v14-to-v15 line 473: !defElemName && (ival === -1 || ival === 0), default to -1
913912
}
914913
}
915-
else {
916-
result.ival = -3; // Based on CI failure showing expected ival: -3
917-
}
918914
}
919915

920916
return { Integer: result };

0 commit comments

Comments
 (0)