[Mono-bugs] [Bug 49553][Maj] New - Fix for problems in OdbcParameter

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 11 Oct 2003 11:02:53 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by seifert@everybody.org.

http://bugzilla.ximian.com/show_bug.cgi?id=49553

--- shadow/49553	2003-10-11 11:02:53.000000000 -0400
+++ shadow/49553.tmp.19742	2003-10-11 11:02:53.000000000 -0400
@@ -0,0 +1,33 @@
+Bug#: 49553
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 000 No more required
+Priority: Major
+Component: System.Data
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: seifert@everybody.org               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Summary: Fix for problems in OdbcParameter
+
+In the current version, it is possible to have a situation where the
+OdbcParameter is not properly initialized before calling the Bind method.  
+
+Example:
+
+OdbcCommand command = conn.CreateCommand();
+command.CommandText = "SELECT FOO FROM TABLE WHERE BAR=?";
+command.Parameters.Add("@BAR", barValue);
+OdbcDataReader reader = command.ExecuteReader();
+
+The attached patch solves this issue by encoding the value buffer right
+before binding.
+
+In addition, I used a different version of the call to
+System.Text.Encoding.ASCII.GetBytes to avoid having to allocate the byte
+array twice.