New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CultureAwareCompare breaks driver in some languages [DNET167] #175
Comments
Commented by: @cincuranet Can you send me some turkish string? Because we're doing compare with this options: |
Modified by: @cincuranetstatus: Open [ 1 ] => In Progress [ 3 ] |
Modified by: @cincuranet |
Commented by: Jan Persson (jpersson) The strange thing is that there's nothing specific Turkish about the strings that fails. At least AFAIK. I don't know Turkish. In my case it fails when GetOrdinal is called like this: GetOrdinal("setting1_20_0_"); It then fails to compare it with the real name of the database column, which is
This is really easy to reproduce. In "Regional and Language Options" (Control Panel) just change "Standards and Formats" to Turkish and "Location" to Turkey and it will fail if you have a database with a column named "SETTING1_20_0_". |
Commented by: @cincuranet The problem is, that in turkish is also "big i with dot" (try string s = "settings".ToUpper(new CultureInfo("tr-TR"));). Adding there invariant culture can then break functionality when somebody is using culture specific behavior. I have to look how this behaves in ms sql client. |
Commented by: @cincuranet rev.608 |
Modified by: @cincuranetstatus: In Progress [ 3 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 2.5.0. Alpha 3 [ 10261 ] Fix Version: 2.5.0 [ 10170 ] |
Modified by: @cincuranetFix Version: 2.5.0 [ 10170 ] => |
Submitted by: Jan Persson (jpersson)
Is related to DNET166
We are using Firebird embedded together with NHibernate for of our product.
One of our Turkish customers had a problem starting our server and after some investigation I've found that the culprit was the method GetOrdinal in FbDataReader.cs. You are using a CultureAwareCompare when you compare the available column names with the column that the caller want to retrieve, but that does not work when the machine is set to have Regional Options as Turkish and I believe other languages will have similar problems for certain column names.
The snippet looks like this:
for (int i = 0; i < this.fields.Count; i++)
{
if (GlobalizationHelper.CultureAwareCompare(name, this.fields[i].Alias))
{
return i;
}
}
But it only works if I change it to do an ordinary string compare.
for (int i = 0; i < this.fields.Count; i++)
{
if (name.ToLowerInvariant() == this.fields[i].Alias.ToLowerInvariant())
{
return i;
}
}
Commits: d760d96
The text was updated successfully, but these errors were encountered: