[Mono-dev] Review of Sql.Data.SqlClient Patches
Nagappan A
nagappan at gmail.com
Mon Oct 27 16:26:17 EDT 2008
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/20081027/ee609521/attachment-0001.html
More information about the Mono-devel-list
mailing list