[OPENJPA-2966] Use a dedicated cast target type for long values - #157
Open
rzo1 wants to merge 1 commit into
Open
[OPENJPA-2966] Use a dedicated cast target type for long values#157rzo1 wants to merge 1 commit into
rzo1 wants to merge 1 commit into
Conversation
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.
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.
Fixes OPENJPA-2966: casting to
longused the DDLdecimalTypeName, which isDECIMAL(10,0)on MySQL/MariaDB and silently clamps any value past ten billion. Long casts now go through a newlongCastTypeName, resolved lazily frombigintTypeName(so per-dictionary overrides assigned in constructors orconnectedConfiguration()are picked up) and set toSIGNEDinMySQLDictionaryandMariaDBDictionary; no DDL type name is touched, so schema generation is unchanged. The second half of the report is fixed too:TypecastAsNumberandTypecastAsStringnow share the size-suffix stripping viaDBDictionary, which changes exactly one dictionary's output (FoxPro no longer emits the literalCAST(x AS CHARACTER{0})).