NUMERIC column type is not handled correctly on DB2

Description

org.hibernate.test.schemavalidation.NumericValidationTest.testValidation fails with DB2

This patch fixes it, although I'm not sure if it's correct.

Environment

DB2

Activity

Show:
Guillaume Smet
July 18, 2018, 4:06 PM

I checked and it seems that numeric and decimal are the exact same thing for DB2.

The question is: did they change the name of the type returned by the driver/server at some point?

Do you know if these tests used to work for older DB2 versions with older version of the driver?

Guillaume Smet
July 18, 2018, 4:13 PM

could you add a breakpoint and check the value of column.getSqlTypeCode( metadata ) and columnInformation.getTypeCode() when the exception is thrown (they are just in the {{boolean typesMatch = }} line)?

I would have expected them to be the same so that we don't have to default to the name comparison.

Martin Simka
July 19, 2018, 9:41 AM

oldest driver I tried is 4.14.122 (coming from DB2 9.7 dist), originally I reported this with 4.24.92 (coming from DB2 11.1 dist). The same failure with used databases versions 9.7, 10.5, 11.1.

Guillaume Smet
July 19, 2018, 9:54 AM

Could you try the breakpoint and giving me the value of both type codes?

There's something fishy.

Martin Simka
July 19, 2018, 9:58 AM

column.getSqlTypeCode( metadata ) returns 2, columnInformation.getTypeCode() returns 3

Assignee

Guillaume Smet

Reporter

Martin Simka

Fix versions

Labels

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

Components

Affects versions

Priority

Major
Configure