[Mono-dev] Review of Sql.Data.SqlClient Patches

John Mortlock johnm at hlaustralia.com.au
Mon Oct 27 18:32:50 EDT 2008


Thanks for your time.

 

I don’t have commit privileges so can you please commit for me.

 

Thanks

John

 

From: Nagappan A [mailto:nagappan at gmail.com] 
Sent: Tuesday, 28 October 2008 6:56 AM
To: John Mortlock
Cc: mono-devel-list at lists.ximian.com
Subject: Re: [Mono-dev] Review of Sql.Data.SqlClient Patches

 

Hello Mortlock,

The patch looks OK to commit.

Thanks
Nagappan

2008/10/27 John Mortlock <johnm at hlaustralia.com.au>

Hi

Can someone please take a look at the following patches for two current bug reports.

First is for bug #428139 - Negative Money Stored Procedure Parameter
https://bugzilla.novell.com/show_bug.cgi?id=428139

--- Tds70.cs    (revision 113639)
+++ Tds70.cs    (working copy)
@@ -1,4 +1,4 @@
-//
+//
 // Mono.Data.Tds.Protocol.Tds70.cs
 //
 // Author:
@@ -463,9 +463,14 @@
                                case "money" : {
                                        Decimal val = (decimal) param.Value;
                                        int[] arr = Decimal.GetBits (val);
-                                       int sign = (val>0 ? 1: -1);
-                                       Comm.Append (sign * arr[1]);
-                                       Comm.Append (sign * arr[0]);
+                                       if (val >= 0) {
+                                               Comm.Append (arr[1]);
+                                               Comm.Append (arr[0]);
+                                       }
+                                       else {
+                                               Comm.Append (~arr[1]);
+                                               Comm.Append (~arr[0] + 1);                                     
+                                       }
                                        break;
                                }
                                case "smallmoney": {


Next is for Bug 360750 - Empty string being send instead of dbnull
https://bugzilla.novell.com/show_bug.cgi?id=360750

Index: SqlParameter.cs
===================================================================
--- SqlParameter.cs     (revision 112723)
+++ SqlParameter.cs     (working copy)
@@ -1,4 +1,4 @@
-//
+//
 // System.Data.SqlClient.SqlParameter.cs
 //
 // Author:
@@ -865,7 +865,7 @@
                                return value;
                       
                        if (value is string && ((string)value).Length == 0)
-                               return DBNull.Value;
+                               return String.Empty;
                       
                        switch (sqlDbType)  {
                        case SqlDbType.BigInt :


--- Tds70.cs    (revision 113127)
+++ Tds70.cs    (working copy)
@@ -1,4 +1,4 @@
-//
+//
 // Mono.Data.Tds.Protocol.Tds70.cs
 //
 // Author:
@@ -446,7 +446,9 @@
                        }

                        size = param.GetActualSize ();
-                       if (IsLargeType (colType))
+                       if (size == 0 && (param.TypeName == "varchar" || param.TypeName == "nvarchar") && (param.Value == DBNull.Value || param.Value == null))
+                               Comm.Append((ushort)0xFFFF);                   
+                       else if (IsLargeType (colType))
                                Comm.Append ((short)size);
                        else if (IsBlobType (colType))
                                Comm.Append (size);


Thanks
John Mortlock 


_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list




-- 
Linux Desktop (GUI Application) Testing Project - http://ldtp.freedesktop.org
http://nagappanal.blogspot.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20081028/50fadc0a/attachment.html 


More information about the Mono-devel-list mailing list