Skip to content

[OPENJPA-2966] Use a dedicated cast target type for long values - #157

Open
rzo1 wants to merge 1 commit into
masterfrom
OPENJPA-2966
Open

[OPENJPA-2966] Use a dedicated cast target type for long values#157
rzo1 wants to merge 1 commit into
masterfrom
OPENJPA-2966

Conversation

@rzo1

@rzo1 rzo1 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Fixes OPENJPA-2966: casting to long used the DDL decimalTypeName, which is DECIMAL(10,0) on MySQL/MariaDB and silently clamps any value past ten billion. Long casts now go through a new longCastTypeName, resolved lazily from bigintTypeName (so per-dictionary overrides assigned in constructors or connectedConfiguration() are picked up) and set to SIGNED in MySQLDictionary and MariaDBDictionary; no DDL type name is touched, so schema generation is unchanged. The second half of the report is fixed too: TypecastAsNumber and TypecastAsString now share the size-suffix stripping via DBDictionary, which changes exactly one dictionary's output (FoxPro no longer emits the literal CAST(x AS CHARACTER{0})).

Long values are now cast via a lazily resolved longCastTypeName (SIGNED on
MySQL/MariaDB) instead of the DDL decimalTypeName, which defaults to
DECIMAL(10,0) there and silently truncates, and both cast paths now strip the
size suffix through the same DBDictionary helpers.
@rzo1 rzo1 self-assigned this Aug 20, 2026
@rzo1
rzo1 requested a review from solomax August 20, 2026 15:51
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.

1 participant