Skip to content

Commit

Permalink
Fix tinyint datatype (#338)
Browse files Browse the repository at this point in the history
* fix tinyint datatype

* add test
  • Loading branch information
yukiwongky authored Dec 3, 2019
1 parent e17f170 commit 0e97cac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@
<ProviderDbType>20</ProviderDbType>
<ColumnSize>3</ColumnSize>
<CreateFormat>tinyint</CreateFormat>
<DataType>System.SByte</DataType>
<DataType>System.Byte</DataType>
<IsAutoIncrementable>true</IsAutoIncrementable>
<IsBestMatch>true</IsBestMatch>
<IsCaseSensitive>false</IsCaseSensitive>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@
<ProviderDbType>20</ProviderDbType>
<ColumnSize>3</ColumnSize>
<CreateFormat>tinyint</CreateFormat>
<DataType>System.SByte</DataType>
<DataType>System.Byte</DataType>
<IsAutoIncrementable>true</IsAutoIncrementable>
<IsBestMatch>true</IsBestMatch>
<IsCaseSensitive>false</IsCaseSensitive>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.ComponentModel;
using System.Data;
using System.Data.Common;
using System.Linq;
using Xunit;

namespace Microsoft.Data.SqlClient.ManualTesting.Tests
Expand All @@ -32,6 +33,12 @@ public static void TestGetSchema()

DataTable metaDataTypes = conn.GetSchema(DbMetaDataCollectionNames.DataTypes);
Assert.True(metaDataTypes != null && metaDataTypes.Rows.Count > 0);

var tinyintRow = metaDataTypes.Rows.OfType<DataRow>().Where(p => (string)p["TypeName"] == "tinyint");
foreach (var row in tinyintRow)
{
Assert.True((String)row["TypeName"] == "tinyint" && (String)row["DataType"] == "System.Byte" && (bool)row["IsUnsigned"]);
}
}
}

Expand Down

0 comments on commit 0e97cac

Please sign in to comment.