2

Closed

SqlServerDetector.TryGetLocalDBVersionInstalled returns wrong version whith hungarian culture [FixedIn6.1.0-alpha1] [AffectedLastRTM]

description

Decimal.TryParse(subKey, out decimalVersion) is incorrect it SqlServerDetector.TryGetLocalDBVersionInstalled method.
CultureInfo parameter should be specified. for example:
Decimal.TryParse(subKey, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out decimalVersion)

C:!entityframework\efxx\EF.xunit.targets(14,9): error : EntityFramework.PowerShell.UnitTests.ConnectionFactoryConfigTests.SqlServerDetector_ignores_LocalDB_versions_that_are_not_numeric_when_multiple_versions_are_installed: Assert.Equal() Failure
C:!entityframework\efxx\EF.xunit.targets(14,9): error : Expected: 12.0
C:!entityframework\efxx\EF.xunit.targets(14,9): error : Actual: (null)
Closed Jan 13 at 7:29 PM by maumar
trivial fix, no need for more verification - closing

comments

RoMiller wrote Jan 31, 2013 at 11:15 PM

EF Team Triage: Assigning to consider for EF6 release.

RoMiller wrote Dec 12, 2013 at 10:05 PM

EF Team Triage: Moving issues with Impact set to Low out of the 6.1.0 release as we only have time to address High and Medium issues in this release. We will re-triage these issues for future releases.

This does not exclude someone outside of the Microsoft EF team from contributing the change/fix in 6.1.0.

zgabi wrote Dec 13, 2013 at 8:13 AM

The fix is in the description:

Decimal.TryParse(subKey, out decimalVersion)
Should be cahanged to
Decimal.TryParse(subKey, NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out decimalVersion)

ErikEJ wrote Dec 15, 2013 at 12:49 PM

Running the test suite with Hungary culture makes the following two tests fail:
SqlServerDetector_detects_the_highest_orderable_version_of_LocalDB_in_the_registry_when_multiple_versions_are_installed
SqlServerDetector_ignores_LocalDB_versions_that_are_not_numeric_when_multiple_versions_are_installed

zgabi wrote Dec 15, 2013 at 2:21 PM

Yes, 2 tests fail. The fix mentioned above fixes both problems.

ErikEJ wrote Dec 15, 2013 at 3:07 PM

I have just submitted a Pull Request for the fix, so hopefully it will be 6.1 nightly builds soon

ajcvickers wrote Dec 16, 2013 at 6:27 PM

Fixed in f490e088887b by ErikEJ

AlsoWorksInHungary
Fix for issue https://entityframework.codeplex.com/workitem/833
Improved decimal parsing to make code work in all cultures