Repository navigation
Reserved words as generated column / table names are quoted (#4037); tools import their own checkout - #4066
Merged
Conversation
refraction_snapshot.py, tool_regex_redos.py and span_anchor_audit.py imported gitgalaxy before inserting their repository root. Run as a script, sys.path starts at tests/tools, so the import resolved to whatever gitgalaxy the interpreter had installed -- another checkout's editable install -- and the tool measured that one. Found by `refraction_snapshot.py update`: it "blessed" the other checkout's generator output, and `check` then agreed with it, while pytest (which imports this checkout) failed. CI installs its own checkout, so only local runs were affected. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
A COBOL item or record named CURRENT-DATE, USER, ORDER, KEY or YEAR became a column or table of that name, and the database refused the DDL: every CardDemo project logged "Error executing DDL ... current_date integer ... expected identifier" on H2, so PENDING_AUTH_DETAILS was never created and any repository call on it would fail. - cobol_to_java_names.SQL_RESERVED: the words reserved, or keywords an identifier may not be, in the databases the generator targets (the SQL standard's core, H2 2.x -- KEY, VALUE, YEAR, MONTH, DAY --, PostgreSQL, and DB2 / MySQL / Oracle words a COBOL data name plausibly takes). - sql_name(): such a name is quoted in the annotation (`@Column(name = "\"CURRENT_DATE\"")`); the database takes it as a plain identifier and Hibernate uses the quoted name in every statement. Every other name is unchanged. - Both entity forges (the schema entities and the VSAM entities) use it for columns, tables and collection tables. Verified on H2: the CardDemo dateutil proof logs 0 DDL errors (2 before) and stays proven. The CardDemo full-corpus snapshot is re-blessed: the one column, and that file's hash in the guardrail inventory. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4037.
A COBOL item or record named
CURRENT-DATE,USER,ORDER,KEYorYEARbecame a column or table with that exact name, and the database refused the DDL. Every CardDemo project loggedError executing DDL ... current_date integer ... expected identifieron H2. As a resultPENDING_AUTH_DETAILSwas never created, and any repository call on it would have failed.Fix
cobol_to_java_names.SQL_RESERVED: 175 words that are reserved, or are keywords an identifier may not be, in the databases the generator targets: the SQL standard's core; H2 2.x (KEY,VALUE,YEAR,MONTH,DAY); PostgreSQL; and the DB2, MySQL and Oracle words a COBOL data name plausibly takes.sql_name()quotes such a name in the annotation (@Column(name = "\"CURRENT_DATE\"")). The database then takes it as a plain identifier, and Hibernate uses the quoted name in every statement. Every other name is unchanged.Verified on H2: the CardDemo
dateutilproof logs 0 DDL errors (2 before) and stays proven. The CardDemo full-corpus snapshot is re-blessed: the one column changes, plus that file's hash in the guardrail inventory.A tool bug this exposed (separate commit)
refraction_snapshot.py,tool_regex_redos.pyandspan_anchor_audit.pyimportedgitgalaxybefore putting their own checkout onsys.path. Run as a script, the import resolved to whatever gitgalaxy the interpreter had installed, here another checkout's editable install. Sorefraction_snapshot.py update"blessed" the other checkout's output,checkagreed with it, and pytest failed. CI installs its own checkout, so only local runs were affected. The fix moves those imports after the insert.Tests:
tests/cobol_mainframe/test_sql_reserved_names.pycovers quoting versus no quoting, the issue's words, and an entity with a reserved table and columns. The snapshot and ReDoS tool tests pass, andaudit_checkis clear.🤖 Generated with Claude Code
https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ