BigIntegerSequenceGeneratorTest.testBasics fails on MS SQL Server 2012

Description

org.hibernate.test.idgen.biginteger.sequence.BigIntegerSequenceGeneratorTest.testBasics

dialect: org.hibernate.dialect.SQLServer2012Dialect

Stacktrace:

Environment

MS SQL Server 2012

Activity

Show:
Gail Badner
September 2, 2015, 8:35 PM

The fix for was not correct and has been reverted by HHH-10053.

will cover the actual fix for the underlying issue.

Gail Badner
April 21, 2015, 12:56 AM

Fixed in master, 4.3, and 4.2 branches.

Gail Badner
April 21, 2015, 12:50 AM

I've left BigIntegerSequenceGeneratorTest using a mapping with the default scale (2), but explicitly excluded SQLServer2012Dialect.

I added a mapping with scale="0" and created a new test, BigIntegerSequenceGeneratorZeroScaleTest, that uses the new mapping.

Gail Badner
April 21, 2015, 12:12 AM

The fix for this issue will only involve setting scale="0" in the test as a workaround.

will cover the actual fix that will set scale="0" by default for big_integer properties.

Gail Badner
April 2, 2015, 5:27 AM
Edited

The reason why this is happening is because for SQL Server, a bigint sequence ranges from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.

By default, the first sequence value returned by SQL Server is -9,223,372,036,854,775,808.

I think that for a property of type java.sql.Types.BIGINT, the scale for the column should be 0 by default (not 2). There should be no need to add scale="0".

FWIW, I confirmed that this also works:

Fixed

Assignee

Gail Badner

Reporter

Martin Simka

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major