Column not found in Turkish locale because of toLowerCase()

Description

Because of the call to String.toLowerCase() without a locale in TableMetadata.addColumn(ResultSet), the name of a column can be incorrectly set when the default locale is Turkish.

Example:

  • the original column name is "id",

  • in addColumn(ResultSet), the name becomes ıd (note the first character is 'ı' (U+0131) instead of 'i' (U+0069) because of the String.toLowerCase() in line 154),

  • as a result, the construction of the SessionFactory fails with a HibernateException:

Attached is a test case for the problem:

  • test case:

  • ;

  • build file:

  • .

Owing the fix to in 4.2.7, it might be possible to fix the problem by switching the direct call to String.toLowerCase() by StringHelper.toLowerCase(String); i.e. from:

to:

Attachments

2

Activity

Show:

Brett Meyer December 11, 2013 at 2:20 AM

If everyone wrote ticket descriptions like you, I'd be a happy camper

I corrected all uses of #toLowerCase within HBM2DDL and added a regression test. I know it's obnoxious, but I'd like to keep treating these on a case-by-case basis. Searching for all instances of that will explain why...

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created December 4, 2013 at 2:59 AM
Updated April 18, 2015 at 6:47 PM
Resolved December 11, 2013 at 2:21 AM