[Mono-bugs] [Bug 608491] New: OdbcCommand Parameters Collection fails to set size when setting Value

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon May 24 21:28:33 EDT 2010


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

http://bugzilla.novell.com/show_bug.cgi?id=608491#c0


           Summary: OdbcCommand Parameters Collection fails to set size
                    when setting Value
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.4.x
          Platform: x86
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: io-layer
        AssignedTo: lupus at novell.com
        ReportedBy: bobbywhitenc at yahoo.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=364356)
 --> (http://bugzilla.novell.com/attachment.cgi?id=364356)
A short sample program to reproduce the bug

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9)
Gecko/20100315 (CK-IBM) Firefox/3.5.9 ( .NET CLR 3.5.30729; .NET4.0E)

Using the System.Data.Odbc package in the Mono 2.4.2 runtime

When running any SQL the requires Parameter markers and parameter binding,  the
call to set the Value of the parameter fails to properly set the length causing
the Value to be truncated.

OdbcConnection myConnection = new OdbcConnection(connectString);
myConnection.Open();
OdbcCommand cmd = myConnection.CreateCommand();
cmd.CommandText = "INSERT INTO myTable (col1) VALUES(?);

cmd.Parameters.Add("@col1Value",OdbcType.VarChar).Value(myNewValue);

// the above should have set the Size, but it doesn't



Reproducible: Always

Steps to Reproduce:
1. Open an OdbcConnection
2. Create an OdbcCommand
3. Set the CommandText to an SQL statement with a Parameter marker ?
4. Add a parameter to the OdbcCommand.Parameters collection
5. Set the value of that Parameter (but dont' explicitly set the length)
Actual Results:  
With the Informix database, you get an Exception:
Odbc Parameter Test
OdbcException: ERROR [22001] [unixODBC][String data right truncation.]
ErrorCode: -2147467259
SQL State: 22001
Native Error: -11023


Expected Results:  
A valid OdbcDataReader() containing results.

-- 
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