UInt32 is too large for Int32
authorMatthew Leibowitz <mattleibowmail@gmail.com>
Tue, 21 Aug 2012 06:01:55 +0000 (09:01 +0300)
committerMatthew Leibowitz <mattleibowmail@gmail.com>
Tue, 21 Aug 2012 06:01:55 +0000 (09:01 +0300)
Fix for overflow exception as mapping a UInt32 to Int32 fails.
Changed mapping of UInt32 to Int64 instead.

Line 192 was moved to 184:
case `DbType.UInt32:` was moved to make it map to `_sql.Bind_Int64(...)`

mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite_2.0/SQLiteStatement.cs

index 3b41ae7f86c1c36937dc7bcc051e1fc6d80a1a61..77c52f67835bd9f1b9637f205bc8d528b7757735 100644 (file)
@@ -181,6 +181,7 @@ namespace Mono.Data.Sqlite
         case DbType.DateTime:\r
           _sql.Bind_DateTime(this, index, Convert.ToDateTime(obj, CultureInfo.CurrentCulture));\r
           break;\r
+        case DbType.UInt32:\r
         case DbType.Int64:\r
         case DbType.UInt64:\r
           _sql.Bind_Int64(this, index, Convert.ToInt64(obj, CultureInfo.CurrentCulture));\r
@@ -189,7 +190,6 @@ namespace Mono.Data.Sqlite
         case DbType.Int16:\r
         case DbType.Int32:\r
         case DbType.UInt16:\r
-        case DbType.UInt32:\r
         case DbType.SByte:\r
         case DbType.Byte:\r
           _sql.Bind_Int32(this, index, Convert.ToInt32(obj, CultureInfo.CurrentCulture));\r