Field “id” not found, the The Turkish-İ/I/i/ı and case conversion and case folding – Update on the dasBlog Turkish-I bug and a reminder to me on Globalization – Scott Hanselman
Posted by jpluimers on 2018/06/05
Reminder to self: in Turkey, they have more than just the lowercase i and uppercase I. In fact these are the i characters you can get:
- U+0049 – I – dotless uppercase – [WayBack] Unicode Character ‘LATIN CAPITAL LETTER I’ (U+0049)
- U+0069 – i – dotted lowercase – [WayBack] Unicode Character ‘LATIN SMALL LETTER I’ (U+0069)
- U+0130 – İ – dotted uppercase – [WayBack] Unicode Character ‘LATIN CAPITAL LETTER I WITH DOT ABOVE’ (U+0130)
- U+0131 – ı – dotless lowercase – [WayBack] Unicode Character ‘LATIN SMALL LETTER DOTLESS I’ (U+0131)
Note there are more non-US latin characters in Turkey, see the links below for some lists.
The Turkish case conversion is inside the same group of dotted. The English case conversion is from dotted lowercase i to dotless uppercase I as shown in [WayBack] Internationalizing Turkish: Dotted and Dotless Turkish Letter “I”:
English vs. Turkish Case Mappings Language Letter Lowercase
MapUppercase
MapEnglish i i I Turkish dotted i i İ Turkish dotless ı ı I
In general, this problem is called [WayBack] Case Folding and many environments do not have good and ready to use solutions for this.
In my case, I was getting Field "id" not found
messages for all tables that had an ID field. The reason was that somewhere in the path from my code to the database, either a comparison or case conversion wasn’t taking into account the above mappings.
Though the underlying database indicates I shouldn’t in [WayBack] Do I have to use UPPERCASE identifiers?, it appears that something in the path from my code via IBX to the Firebird 2.5 database has issues on Turkish machines. The good thing: Database WorkBench 5.x doesn’t have that issue for a regular query.
Usually databases are only cases sensitive with quoted identifiers, but not all are: [WayBack] Lorenzo Alberton – Articles – Database identifiers, quoting and case sensitivity
Later I managed to get a stack trace on the Turkish system:
IBX.IBUtils.FormatIdentifierValue(1,'id')
IBX.IBSQL.TIBXSQLDA.GetSQLVARByName('id')
IBX.IBSQL.TIBXSQLDA.ByName('id')
IBX.IBSQL.TIBSQL.ParamByName('id')
IBX.IBCustomDataSet.TIBDataSet.ParamByName('id')
References:
- [WayBack] Internationalizing Turkish: Dotted and Dotless Turkish Letter “I”
- [WayBack] Update on the dasBlog Turkish-I bug and a reminder to me on Globalization – Scott Hanselman
- [WayBack] Dotted and dotless I – Wikipedia
- [WayBack] Unicodes of the Turkish characters | Kaan Mutlu’s Blog
- What’s the Delphi equivalent of doing UpperCase with an InvariantCulture in Unicode Delphi versions? (XE and up)Background: an inherited Delphi projec… – Jeroen Wiert Pluimers – Google+
note so self: some DAC layers hard-code quoted case sensitive identifier names: [WayBack] ado.net – Firebird and Entity Framework case sensitve table/column names – Stack Overflow
–jeroen
Leave a Reply