[Mono-bugs] [Bug 522465] New: Inserting Double.MaxValue or Double.MinValues throws and overflow exception

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jul 15 17:26:31 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=522465


           Summary: Inserting Double.MaxValue or Double.MinValues throws
                    and overflow exception
    Classification: Mono
           Product: Mono: Class Libraries
           Version: unspecified
          Platform: x86-64
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Data
        AssignedTo: bnc-blr-team-mono at forge.provo.novell.com
        ReportedBy: basheer.islam at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Description of Problem:

Inserting Double.MaxValue or Double.MinValue into any float column will result
in a similar exception

Inner Exception: System.Data.SqlClient.SqlException: The floating point value
'1.79769313486232E+308' is out of the range of computer representation (8
bytes).
Source: Mono SqlClient Data Provider
Target Site: Void ErrorHandler(System.Object,
Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
Stack Trace:   at System.Data.SqlClient.SqlConnection.ErrorHandler
(System.Object sender, Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs
e) [0x00000] 
  at Mono.Data.Tds.Protocol.Tds.OnTdsErrorMessage
(Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs e) [0x00000] 
  at Mono.Data.Tds.Protocol.Tds.ProcessMessage (TdsPacketSubType subType)
[0x00000] 
  at Mono.Data.Tds.Protocol.Tds.ProcessSubPacket () [0x00000] 
  at Mono.Data.Tds.Protocol.Tds.NextResult () [0x00000] 
  at Mono.Data.Tds.Protocol.Tds.SkipToEnd () [0x00000] 
  at Mono.Data.Tds.Protocol.Tds.ExecuteQuery (System.String sql, Int32 timeout,
Boolean wantResults) [0x00000] 
  at Mono.Data.Tds.Protocol.Tds70.Execute (System.String commandText,
Mono.Data.Tds.TdsMetaParameterCollection parameters, Int32 timeout, Boolean
wantResults) [0x00000] 
  at System.Data.SqlClient.SqlCommand.Execute (Boolean wantResults) [0x00000] 
  at System.Data.SqlClient.SqlCommand.ExecuteNonQuery () [0x00000] 
  at NHibernate.Impl.BatcherImpl.ExecuteNonQuery (IDbCommand cmd) [0x00000] 
  at NHibernate.Impl.NonBatchingBatcher.AddToBatch (IExpectation expectation)
[0x00000] 
  at NHibernate.Persister.Entity.AbstractEntityPersister.Insert (System.Object
id, System.Object[] fields, System.Boolean[] notNull, Int32 j,
NHibernate.SqlCommand.SqlCommandInfo sql, System.Object obj,
ISessionImplementor session) [0x00000] 




Steps to reproduce the problem:
1. Insert Double.MaxValue or Double.MinValue into a float column. This results
in and exception. Inner Exception: System.Data.SqlClient.SqlException: The
floating point value '1.79769313486232E+308' is out of the range of computer
representation (8 bytes).

Actual Results:
When running trace on Sql server shows the actual value getting inserted as
1.79769313486232E+308 or -1.79769313486232E+308 

Expected Results:


How often does this happen? 
every time


Additional Information:

This is how I patched 
file   - ./mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
class  - Tds70
Method - private string FormatParameter (TdsMetaParameter parameter)

Added following for - case "float":
                           object paramV = parameter.Value;
                           value = ((double)paramV).ToString ("r");
                           break;

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list