In corlib/System.Runtime.InteropServices:
[mono.git] / mcs / class / FirebirdSql.Data.Firebird / FirebirdSql.Data.Common / TypeHelper.cs
index 11d83938ae208135803e2765f6203a55681304a5..d0ebf1c241ae5a8860e5816ea1b960840feb2ec3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *     Firebird ADO.NET Data provider for .NET and     Mono 
+ *     Firebird ADO.NET Data provider for .NET and Mono 
  * 
  *        The contents of this file are subject to the Initial 
  *        Developer's Public License Version 1.0 (the "License"); 
@@ -205,20 +205,28 @@ namespace FirebirdSql.Data.Common
                                        return DbDataType.Text;
 
                                case IscCodes.blr_short:
-                                       if (scale < 0)
-                                       {
-                                               return DbDataType.Decimal;
-                                       }
+                    if (subType == 2)
+                    {
+                        return DbDataType.Decimal;
+                    }
+                    else if (subType == 1)
+                    {
+                        return DbDataType.Numeric;
+                    }
                                        else
                                        {
                                                return DbDataType.SmallInt;
                                        }
 
                                case IscCodes.blr_long:
-                                       if (scale < 0)
-                                       {
-                                               return DbDataType.Decimal;
-                                       }
+                    if (subType == 2)
+                    {
+                        return DbDataType.Decimal;
+                    }
+                    else if (subType == 1)
+                    {
+                        return DbDataType.Numeric;
+                    }
                                        else
                                        {
                                                return DbDataType.Integer;
@@ -227,10 +235,14 @@ namespace FirebirdSql.Data.Common
                                case IscCodes.blr_quad:
                                case IscCodes.blr_int64:
                                case IscCodes.blr_blob_id:
-                                       if (scale < 0)
-                                       {
-                                               return DbDataType.Decimal;
-                                       }
+                    if (subType == 2)
+                    {
+                        return DbDataType.Decimal;
+                    }
+                    else if (subType == 1)
+                    {
+                        return DbDataType.Numeric;
+                    }
                                        else
                                        {
                                                return DbDataType.BigInt;