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

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

    modified:
      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 'MySql.Data/Provider/Source/MySqlPacket.cs'
=== modified file 'MySql.Data/Provider/Source/MySqlPacket.cs'
--- a/MySql.Data/Provider/Source/MySqlPacket.cs	2010-08-18 19:52:04 +0000
+++ b/MySql.Data/Provider/Source/MySqlPacket.cs	2010-11-30 18:33:23 +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:52:04 +0000
+++ b/MySql.Data/Provider/Source/NativeDriver.cs	2010-11-30 18:33:23 +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:52:04 +0000
+++ b/MySql.Data/Provider/Source/Types/MySqlBinary.cs	2010-11-30 18:33:23 +0000
@@ -175,7 +175,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:52:04 +0000
+++ b/MySql.Data/Provider/Source/Types/MySqlGuid.cs	2010-11-30 18:33:23 +0000
@@ -200,7 +200,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:52:04 +0000
+++ b/MySql.Data/Tests/Source/DataTypeTests.cs	2010-11-30 18:33:23 +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] reggie.burnett@oracle.com-20101130183406-3kua33yw1ih12qxb.bundle
Thread
bzr commit into connector-net-trunk branch (reggie.burnett:945)Reggie Burnett30 Nov