List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:November 30 2010 6:32pm
Subject:bzr commit into connector-net-6.2 branch (reggie.burnett:909)
View as plain text  
#At file:///C:/work/connector-net/6.2/ based on revid:reggie.burnett@stripped

  909 Reggie Burnett	2010-11-30 [merge]
      merged

    modified:
      CHANGES
      MySql.Data/Provider/Source/MySqlPacket.cs
      MySql.Data/Provider/Source/NativeDriver.cs
      MySql.Data/Provider/Source/Types/MySqlBinary.cs
      MySql.Data/Provider/Source/Types/MySqlBit.cs
      MySql.Data/Provider/Source/Types/MySqlDecimal.cs
      MySql.Data/Provider/Source/Types/MySqlGuid.cs
      MySql.Data/Provider/Source/Types/MySqlString.cs
      MySql.Data/Provider/Source/common/StreamCreator.cs
      MySql.Data/Tests/Source/DataTypeTests.cs
=== modified file 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES	2010-11-22 17:22:24 +0000
+++ b/CHANGES	2010-11-30 18:32:09 +0000
@@ -10,6 +10,7 @@
 - return default values for text columns as quoted (bug #58167)
 - fixed our DDEX code so that dragging tables from server explorer onto a typed data set
   preserves the table name (bug #57894)
+- fixed ReadFieldLength to return a long so bigint autoincrement columns can work (bug #58373)
 
 Version 6.2.4
 - Fix authorization popup after modifying stored procedure in VS (Bug #44715)

=== modified file 'MySql.Data/Provider/Source/MySqlPacket.cs'
--- a/MySql.Data/Provider/Source/MySqlPacket.cs	2010-08-18 19:48:34 +0000
+++ b/MySql.Data/Provider/Source/MySqlPacket.cs	2010-11-30 18:32:09 +0000
@@ -148,7 +148,7 @@
 
         #region Integer methods
 
-        public int ReadFieldLength()
+        public long ReadFieldLength()
         {
             byte c = ReadByte();
 
@@ -157,7 +157,7 @@
                 case 251: return -1;
                 case 252: return ReadInteger(2);
                 case 253: return ReadInteger(3);
-                case 254: return ReadInteger(8);
+                case 254: return ReadLong(8);
                 default: return c;
             }
         }

=== modified file 'MySql.Data/Provider/Source/NativeDriver.cs'
--- a/MySql.Data/Provider/Source/NativeDriver.cs	2010-08-18 19:48:34 +0000
+++ b/MySql.Data/Provider/Source/NativeDriver.cs	2010-11-30 18:32:09 +0000
@@ -658,7 +658,7 @@
             int length = -1;
             if (nullMap == null)
             {
-                length = packet.ReadFieldLength();
+                length = (int)packet.ReadFieldLength();
                 if (length == -1) return;
             }
             if (length > -1)

=== modified file 'MySql.Data/Provider/Source/Types/MySqlBinary.cs'
--- a/MySql.Data/Provider/Source/Types/MySqlBinary.cs	2010-08-18 19:48:34 +0000
+++ b/MySql.Data/Provider/Source/Types/MySqlBinary.cs	2010-11-30 18:32:09 +0000
@@ -177,7 +177,7 @@
 
 		void IMySqlValue.SkipValue(MySqlPacket packet)
 		{
-            int len = packet.ReadFieldLength();
+            int len = (int)packet.ReadFieldLength();
             packet.Position += len;
 		}
 

=== modified file 'MySql.Data/Provider/Source/Types/MySqlBit.cs'
--- a/MySql.Data/Provider/Source/Types/MySqlBit.cs	2010-10-06 20:39:51 +0000
+++ b/MySql.Data/Provider/Source/Types/MySqlBit.cs	2010-11-30 18:32:09 +0000
@@ -111,7 +111,7 @@
 
 		public void SkipValue(MySqlPacket packet)
 		{
-            int len = packet.ReadFieldLength();
+            int len = (int)packet.ReadFieldLength();
             packet.Position += len;
 		}
 

=== modified file 'MySql.Data/Provider/Source/Types/MySqlDecimal.cs'
--- a/MySql.Data/Provider/Source/Types/MySqlDecimal.cs	2010-08-18 19:48:34 +0000
+++ b/MySql.Data/Provider/Source/Types/MySqlDecimal.cs	2010-11-30 18:32:09 +0000
@@ -134,7 +134,7 @@
 
         void IMySqlValue.SkipValue(MySqlPacket packet)
 		{
-            int len = packet.ReadFieldLength();
+            int len = (int)packet.ReadFieldLength();
             packet.Position += len;
 		}
 

=== modified file 'MySql.Data/Provider/Source/Types/MySqlGuid.cs'
--- a/MySql.Data/Provider/Source/Types/MySqlGuid.cs	2010-08-18 19:48:34 +0000
+++ b/MySql.Data/Provider/Source/Types/MySqlGuid.cs	2010-11-30 18:32:09 +0000
@@ -202,7 +202,7 @@
 
 		void IMySqlValue.SkipValue(MySqlPacket packet)
 		{
-            int len = packet.ReadFieldLength();
+            int len = (int)packet.ReadFieldLength();
             packet.Position += len;
 		}
 

=== modified file 'MySql.Data/Provider/Source/Types/MySqlString.cs'
--- a/MySql.Data/Provider/Source/Types/MySqlString.cs	2010-08-18 19:48:34 +0000
+++ b/MySql.Data/Provider/Source/Types/MySqlString.cs	2010-11-30 18:32:09 +0000
@@ -116,7 +116,7 @@
 
 		void IMySqlValue.SkipValue(MySqlPacket packet)
 		{
-            int len = packet.ReadFieldLength();
+            int len = (int)packet.ReadFieldLength();
             packet.Position += len;
 		}
 

=== modified file 'MySql.Data/Provider/Source/common/StreamCreator.cs'
--- a/MySql.Data/Provider/Source/common/StreamCreator.cs	2010-11-09 20:32:49 +0000
+++ b/MySql.Data/Provider/Source/common/StreamCreator.cs	2010-11-30 18:32:09 +0000
@@ -162,7 +162,9 @@
 
 		private static EndPoint CreateUnixEndPoint(string host)
 		{
-			// first we need to load the Mono.posix assembly			Assembly a = Assembly.Load(@"Mono.Posix, Version=2.0.0.0, 				Culture=neutral, PublicKeyToken=0738eb9f132ed756");
+			// first we need to load the Mono.posix assembly			
+            Assembly a = Assembly.Load(@"Mono.Posix, Version=2.0.0.0, 				
+                Culture=neutral, PublicKeyToken=0738eb9f132ed756");
 
 			// then we need to construct a UnixEndPoint object
 			EndPoint ep = (EndPoint)a.CreateInstance("Mono.Posix.UnixEndPoint",

=== modified file 'MySql.Data/Tests/Source/DataTypeTests.cs'
--- a/MySql.Data/Tests/Source/DataTypeTests.cs	2010-08-18 19:48:34 +0000
+++ b/MySql.Data/Tests/Source/DataTypeTests.cs	2010-11-30 18:32:09 +0000
@@ -1088,5 +1088,24 @@
                 Assert.AreEqual(d, double.MaxValue);
             }
         }
+
+        /// <summary>
+        /// Bug #58373	ReadInteger problem
+        /// </summary>
+        [Test]
+        public void BigIntAutoInc()
+        {
+            execSQL("DROP TABLE IF EXISTS test");
+            execSQL("CREATE TABLE test(ID bigint unsigned AUTO_INCREMENT NOT NULL PRIMARY KEY, name VARCHAR(20))");
+
+            MySqlCommand cmd = new MySqlCommand("INSERT INTO test VALUES (@id, 'boo')", conn);
+            ulong val = UInt64.MaxValue;
+            val -= 100;
+            cmd.Parameters.AddWithValue("@id", val);
+            cmd.ExecuteNonQuery();
+
+            cmd.CommandText = "INSERT INTO test (name) VALUES ('boo2')";
+            cmd.ExecuteNonQuery();
+        }
     }
 }


Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20101130183209-dmi48sroz4wrfapi.bundle
Thread
bzr commit into connector-net-6.2 branch (reggie.burnett:909) Reggie Burnett30 Nov