Skip to content

Handle Db2 LUW string literals correctly - #115

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
jmp/db2_lexer_fixes
Oct 6, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
mainfrom
jmp/db2_lexer_fixes

Conversation

@jasonmp85

Copy link
Copy Markdown
Contributor

Db2 LUW treats backslashes as literal characters inside ordinary strings. With dbms: "ibm_db2", the lexer currently falls through to backslash-escape behavior: VALUES 'path\', 'probe_alpha' becomes VALUES ? probe_alpha ?, exposing the second literal.

Add explicit ibm_db2 dialect support and select the existing behavior that disables backslash escaping. The value matches the Agent integration's existing options; no collector configuration change is needed. Reuse the doubled-single-quote handling already present on main, and document the dialect in the README and CLI help.

Regression tests cover string token boundaries, literal removal, and identical normalized output when literal contents change, including doubled single quotes, backslashes, Unicode, empty strings, and truncated strings.

Validation:

  • Lexer suite and race checks passed, including with CI's Go 1.25.7; both prescribed 60-second fuzz runs passed; lint reported no new issues.
  • The real Agent obfuscator with a local lexer replacement passed all 13 corpus pairs and its full suite of 1,145 tests with race detection, using the collector's exact {"obfuscation_mode":"obfuscate_and_normalize","dbms":"ibm_db2"} options.
  • The original inputs and added Unicode/backslash pair executed successfully against Db2 LUW 12.1.5.0.

A lexer release and Agent dependency update are still required, followed by validation through the Python/native helper in the rebuilt Agent image. This PR does not update the Agent dependency or integration PR stack.

@jasonmp85
jasonmp85 requested a review from a team as a code owner October 5, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants