Skip to content

Fix parsing of host variables in obfuscated procedures and functions - #570

Merged
SanjulaGanepola merged 2 commits into
mainfrom
fix/wrapped-statements
Aug 25, 2026
Merged

Fix parsing of host variables in obfuscated procedures and functions#570
SanjulaGanepola merged 2 commits into
mainfrom
fix/wrapped-statements

Conversation

@SanjulaGanepola

Copy link
Copy Markdown
Member

Changes

WRAPPED statements have an obfuscated body that may contain colons as part of the encoding. Previously running this procedure/function like this would incorrectly detect host variables which would also cause a truncation issue.

https://www.ibm.com/docs/en/i/7.6.0?topic=functions-wrap

How to test this PR

  1. Generate an obfuscated function:
VALUES SYSIBMADM.WRAP('CREATE FUNCTION salary(wage DECFLOAT) RETURNS DECFLOAT 
                                RETURN wage * 40 * 52');
  1. Run the function it generates:
CREATE FUNCTION SALARY ( WAGE DECFLOAT )  WRAPPED QSQ07040 aacxW8plW8VzG8pHG8VvG8Fv68Vn68Fbl8pJY8pJ1qpdW8pdW8pdW9pjaqebaqebakZuBeEd5uFkq8KJqqYsjm:1m0gyYOktd1gfJbJ0J8Pq1JRTtWhZ7eZZ7e4aa
  1. Observe that the statement ran successfully.

Checklist

  • have tested my change
  • have created one or more test cases

Signed-off-by: Sanjula Ganepola <Sanjula.Ganepola@ibm.com>
Signed-off-by: Sanjula Ganepola <Sanjula.Ganepola@ibm.com>
@SanjulaGanepola
SanjulaGanepola requested review from a team and forstie August 25, 2026 19:24
@github-actions

Copy link
Copy Markdown
Contributor

👋 A new build is available for this PR based on d3299cb.

@forstie

forstie commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

worked like an absolute champ for me, thanks!

@forstie forstie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works great

@SanjulaGanepola
SanjulaGanepola merged commit 4dc8cf4 into main Aug 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants