Просмотр исходного кода

Properly handle TDS 8 BigInt type
Proper handling of TDS 8 BigInt type

svn path=/trunk/mcs/; revision=130081

Veerapuram Varadhan 17 лет назад
Родитель
Сommit
f71d07b3df

+ 4 - 0
mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog

@@ -1,3 +1,7 @@
+2009-03-23  Veerapuram Varadhan  <[email protected]>
+
+	* Tds.cs: Properly handle TdsColumnType.BigInt as we support TDS 8 now.
+	
 2009-03-15  Veerapuram Varadhan  <[email protected]>
 
 	** Fixes #463011

+ 6 - 0
mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs

@@ -745,6 +745,7 @@ namespace Mono.Data.Tds.Protocol
 			case TdsColumnType.Int1 :
 			case TdsColumnType.Int2 :
 			case TdsColumnType.Int4 :
+			case TdsColumnType.BigInt :
 				element = GetIntValue (colType);
 				break;
 			case TdsColumnType.Image :
@@ -1127,6 +1128,9 @@ namespace Mono.Data.Tds.Protocol
 				throw new ArgumentNullException ("type");
 #endif
 			switch (type) {
+			case TdsColumnType.BigInt :
+				len = 8;
+				break;
 			case TdsColumnType.IntN :
 				len = comm.GetByte ();
 				break;
@@ -1320,6 +1324,7 @@ namespace Mono.Data.Tds.Protocol
 				case TdsColumnType.Int1 :
 				case TdsColumnType.Int2 :
 				case TdsColumnType.Int4 :
+				case TdsColumnType.BigInt :
 				case TdsColumnType.Float8 :
 				case TdsColumnType.DateTime :
 				case TdsColumnType.Bit :
@@ -1384,6 +1389,7 @@ namespace Mono.Data.Tds.Protocol
 				case TdsColumnType.Float8 :
 				case TdsColumnType.DateTime :
 				case TdsColumnType.Money :
+				case TdsColumnType.BigInt :
 					return 8;
 				default :
 					return 0;

+ 4 - 1
mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds80.cs

@@ -4,6 +4,7 @@
 // Author:
 //   Tim Coleman ([email protected])
 //	 Veerapuram Varadhan  ([email protected])
+//
 // Copyright (C) 2002 Tim Coleman
 // Copyright (C) 2008,2009 Novell Inc.
 //
@@ -191,8 +192,10 @@ namespace Mono.Data.Tds.Protocol {
 		protected override void ProcessOutputParam ()
 		{
 			// We are connected to a Sql 7.0 server
-			if (TdsVersion < TdsVersion.tds80)
+			if (TdsVersion < TdsVersion.tds80) {
 				base.ProcessOutputParam ();
+				return;
+			}
 
 			GetSubPacketLength ();
 			

+ 5 - 0
mcs/class/Mono.Data.Tds/Mono.Data.Tds/ChangeLog

@@ -1,3 +1,8 @@
+2009-03-23  Veerapuram Varadhan  <[email protected]>
+
+	* TdsMetaParameter.cs (GetMetaType): Return TdsColumnType.BigInt 
+	instead of TdsColumnType.IntN.
+	
 2009-03-14  Veerapuram Varadhan  <[email protected]>
 
 	* TdsMetaParameter.cs (ResizeValue): Return unmodified value 

+ 1 - 1
mcs/class/Mono.Data.Tds/Mono.Data.Tds/TdsMetaParameter.cs

@@ -335,7 +335,7 @@ namespace Mono.Data.Tds {
 					return TdsColumnType.BitN;
 				return TdsColumnType.Bit;
 			case "bigint":
-				return TdsColumnType.IntN;
+				return TdsColumnType.BigInt;
 			case "char":
 				return TdsColumnType.Char;
 			case "money":

+ 4 - 0
mcs/class/System.Data/System.Data.SqlClient/ChangeLog

@@ -1,3 +1,7 @@
+2009-03-23  Veerapuram Varadhan  <[email protected]>
+
+	* SqlDataReader.cs (GetSchemaRowType): Correctly handle Tds 8 BigInt type.
+	
 2009-02-02  Veerapuram Varadhan  <[email protected]>
 
 	* SqlConnection.cs: Use TDS 8 instead of TDS 7

+ 1 - 0
mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs

@@ -331,6 +331,7 @@ namespace System.Data.SqlClient
 				case TdsColumnType.Int2:
 				case TdsColumnType.Int4:
 				case TdsColumnType.IntN:
+				case TdsColumnType.BigInt:
 					switch (csize) {
 					case 1:
 						typeName = "tinyint";