Bug #55644 | Value was either too large or too small for a Double | ||
---|---|---|---|
Submitted: | 30 Jul 2010 6:18 | Modified: | 12 Aug 2010 16:38 |
Reporter: | Bogdan Degtyariov | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 6.2.3 | OS: | Any |
Assigned to: | Vladislav Vaintroub | CPU Architecture: | Any |
Tags: | double |
[30 Jul 2010 6:18]
Bogdan Degtyariov
[3 Aug 2010 15:56]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/114949 830 Vladislav Vaintroub 2010-08-03 Bug#55644 : catch OverflowException when parsing double values returned by server, convert such values to double.minValue or double.maxValue dependent on sign.
[3 Aug 2010 16:06]
Vladislav Vaintroub
fixed in 6.0.7, 6.1.5, 6.2.4, 6.3.4
[10 Aug 2010 10:25]
Bogdan Degtyariov
Reading data from server should be as (MySqlDouble.cs:104): string s = packet.ReadString(length); // not just packet.ReadString(); double d; try { d = Double.Parse(s, CultureInfo.InvariantCulture); } catch (OverflowException) ... Otherwise the string for parsing contains some stuff that causes parsing errors.
[10 Aug 2010 10:33]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/115388 832 Vladislav Vaintroub 2010-08-10 post-push fix for Bug#55644 (length parameter in ReadString was lost the original push)
[12 Aug 2010 16:38]
Tony Bedford
An entry has been added to the 6.0.7, 6.1.5, 6.2.4, 6.3.4 changelog: Attempting to read Double.MinValue from a DOUBLE column in MySQL table generated the following exception: System.OverflowException : Value was either too large or too small for a Double. --OverflowException at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt) at MySql.Data.Types.MySqlDouble.MySql.Data.Types.IMySqlValue.ReadValue(MySqlPacket packet, Int64 length, Boolean nullVal) at MySql.Data.MySqlClient.NativeDriver.ReadColumnValue(Int32 index, MySqlField field, IMySqlValue valObject) at MySql.Data.MySqlClient.ResultSet.ReadColumnData(Boolean outputParms) at MySql.Data.MySqlClient.ResultSet.NextRow(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlDataReader.Read()