Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Braswell <jbraswell@localhost.localdomain>2015-03-27 06:43:12 +0300
committerJonathan Braswell <jbraswell@localhost.localdomain>2015-03-27 06:43:12 +0300
commit7ed9d55b181b0199483734102dc203a1e629e46b (patch)
tree7736e7991bfe03f06df106855d261e0bdb5da526 /mcs/class/Mono.Data.Tds
parent059538c11a961b0a08d834d09d1e46cc427ebd4c (diff)
Fix issue with inserting null values into integer and datetime columns in Sql Server.
This resolves https://bugzilla.xamarin.com/show_bug.cgi?id=26546.
Diffstat (limited to 'mcs/class/Mono.Data.Tds')
-rw-r--r--mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
index f484b727fb5..54210049067 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
@@ -559,8 +559,10 @@ namespace Mono.Data.Tds.Protocol
* If the value is null, not setting the size to 0 will cause varchar
* fields to get inserted as an empty string rather than an null.
*/
- if (param.Value == null || param.Value == DBNull.Value)
- size = 0;
+ if (colType != TdsColumnType.IntN && colType != TdsColumnType.DateTimeN) {
+ if (param.Value == null || param.Value == DBNull.Value)
+ size = 0;
+ }
// Change colType according to the following table
/*