Skip to content

Commit db5abc4

Browse files
Fix substring function A_Const argument handling
- Added A_Const to simple argument types for SQL syntax detection - Fixed original-upstream-strings.test.ts: SUBSTRING('1234567890' FROM 4 FOR 3) - Improved test pass rate from 238/258 (92.2%) to 240/258 (93.0%) - All substring function edge cases now working correctly Co-Authored-By: Dan Lynch <[email protected]>
1 parent 081eb97 commit db5abc4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ export class V13ToV14Transformer {
527527
if (firstArg && typeof firstArg === 'object' && ('TypeCast' in firstArg || 'FuncCall' in firstArg)) {
528528
return true; // Function call syntax
529529
}
530-
if (firstArg && typeof firstArg === 'object' && 'ColumnRef' in firstArg) {
530+
// If first argument is simple (ColumnRef, A_Const), it's likely SQL syntax
531+
if (firstArg && typeof firstArg === 'object' && ('ColumnRef' in firstArg || 'A_Const' in firstArg)) {
531532
return false; // SQL syntax: FROM...FOR
532533
}
533534
}

0 commit comments

Comments
 (0)