fskorgen opened a new pull request, #8242: URL: https://github.com/apache/hop/pull/8242
numericLength() took the scale off the precision the database reports, so decimal(5,2) arrived as Hop length 3. Every getFieldDefinition writes a scaled column as DECIMAL(length, precision), and a length typed into a transform dialog means the same total — so the length read off a column matched neither. A table re-created from a read stopped round-tripping: decimal(24,15) becomes DECIMAL(9,15), which SQL Server refuses, and decimal(5,2) becomes DECIMAL(3,2), which is valid DDL that then rejects valid data. The subtraction is kept as integerDigits() for the two rules that test whether a declaration is possible at all, so no dialect rule changes behaviour. Oracle's two require scale <= 0, where it never applied. JdbcTypeMappingCharacterizationTest: 63 diverging lines become 16, and the live path now agrees with the legacy mapper on every numeric case. New MsSqlServerNumericRoundTripTest fails without this change with expected: <DECIMAL(5,2)> but was: <DECIMAL(3,2)>. Fixes [#8216](https://github.com/apache/hop/issues/8216) ------------------------ Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily: - [ ] Run `mvn clean install apache-rat:check` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] If you have a group of commits related to the same change, please squash your commits into one and force push your branch using `git rebase -i`. - [ ] Mention the appropriate issue in your description (for example: `addresses #123`), if applicable. To make clear that you license your contribution under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) you have to acknowledge this by using the following check-box. - [ ] I hereby declare this contribution to be licensed under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) - [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
