Skip to content

Generated Db2Dates.parseTimestamp accepts Arabic-Indic / full-width digits in the time (Integer.parseInt) #3946

Closed

Description

@squid-protocol

What: the generated Db2Dates.parseTimestamp reads the time part with Integer.parseInt. Integer.parseInt accepts any Unicode decimal digit, so a timestamp whose time is written in Arabic-Indic digits parses:

Db2Dates.parseTimestamp("2026-09-26-١٤.٣٠.٠٥.000000")  // -> 2026-09-26T14:30:05

DB2 rejects that string: its datetime string representations take the digits 0-9 only (SQLCODE -180 / -181). The COBOL program would have got an SQL error, but the port accepts the value. This is the #3831 class of bug (Java parsers accept digits that COBOL and DB2 reject), in the one parse CobolRecords does not cover. The date part is safe: parseDate uses DateTimeFormatter, and DecimalStyle.STANDARD there reads ASCII digits only.

Found by: the Cultural Gauntlet, part 3, dimension E (#3834), --run. The generated Db2Dates runs under all 15 JVM environments, for the DB2 formats EUR, USA and ISO:

  • parse-foreign fails: want invalid invalid invalid, got invalid invalid 2026-09-26T14:30:05.
  • 24 input_*|*|runtime-run cells fail.
  • Everything else in those cells passes and is identical across the environments: the EUR/USA/ISO character forms, parsing all three DB2 formats, and NUMVAL/zoned rejecting full-width, Arabic-Indic, Thai and Devanagari digits.

Fix: check [0-9] before parseInt (as CobolRecords.isAsciiDigits does), or parse the time with a strict DateTimeFormatter.

Where: gitgalaxy/tools/cobol_to_java/cobol_to_java_db2_forge.py, _DB2_DATES, parseTimestamp.

Ledgered in: tests/cultural_gauntlet/baseline.txt (input_*|*|runtime-run).

🤖 Generated with Claude Code

Activity

  1. added
    bug
    legacy-modernization
    priority: low
    on Sep 28, 2026
  2. added 2 commits that reference this issue on Sep 28, 2026
  3. added
    status: pending-release
    on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglegacy-modernizationpriority: lowstatus: pending-release

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions