Skip to content

Commit

Permalink
Merge pull request #607 from mikependon/cancellation-token
Browse files Browse the repository at this point in the history
#343 Fixed the failing Integration Tests for SqLite and MySQL.
  • Loading branch information
mikependon authored Oct 3, 2020
2 parents 4361beb + 9d974e0 commit a05466a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions RepoDb.MySql/RepoDb.MySql/DbHelpers/MySqlDbHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,16 @@ private async Task<DbField> ReaderToDbFieldAsync(DbDataReader reader,
else
{
size = await reader.IsDBNullAsync(5, cancellationToken) ? (int?)null :
await reader.GetFieldValueAsync<int>(5, cancellationToken);
Convert.ToInt32(await reader.GetFieldValueAsync<long>(5, cancellationToken));
}
return new DbField(await reader.GetFieldValueAsync<string>(0, cancellationToken),
await reader.GetFieldValueAsync<bool>(1, cancellationToken),
await reader.GetFieldValueAsync<bool>(2, cancellationToken),
await reader.GetFieldValueAsync<bool>(1, cancellationToken),
Convert.ToBoolean(await reader.GetFieldValueAsync<int>(1, cancellationToken)),
Convert.ToBoolean(await reader.GetFieldValueAsync<int>(2, cancellationToken)),
Convert.ToBoolean(await reader.GetFieldValueAsync<int>(1, cancellationToken)),
DbTypeResolver.Resolve(columnType),
size,
await reader.IsDBNullAsync(6, cancellationToken) ? (byte?)null : byte.Parse((await reader.GetFieldValueAsync<int>(6, cancellationToken)).ToString()),
await reader.IsDBNullAsync(7, cancellationToken) ? (byte?)null : byte.Parse((await reader.GetFieldValueAsync<int>(7, cancellationToken)).ToString()),
await reader.IsDBNullAsync(6, cancellationToken) ? (byte?)null : byte.Parse((await reader.GetFieldValueAsync<ulong>(6, cancellationToken)).ToString()),
await reader.IsDBNullAsync(7, cancellationToken) ? (byte?)null : byte.Parse((await reader.GetFieldValueAsync<ulong>(7, cancellationToken)).ToString()),
await reader.GetFieldValueAsync<string>(8, cancellationToken));
}

Expand Down
4 changes: 2 additions & 2 deletions RepoDb.SqLite/RepoDb.SqLite/DbHelpers/SqLiteDbHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ private async Task<DbField> ReaderToDbFieldAsync(DbDataReader reader,
CancellationToken cancellationToken = default)
{
return new DbField(await reader.GetFieldValueAsync<string>(1, cancellationToken),
await reader.IsDBNullAsync(5, cancellationToken) ? false : reader.GetBoolean(5),
await reader.IsDBNullAsync(5, cancellationToken) ? false : Convert.ToBoolean(await reader.GetFieldValueAsync<long>(5, cancellationToken)),
string.Equals(await reader.GetFieldValueAsync<string>(1, cancellationToken), identityFieldName, StringComparison.OrdinalIgnoreCase),
await reader.IsDBNullAsync(3, cancellationToken) ? true : await reader.GetFieldValueAsync<bool>(3, cancellationToken) == false,
await reader.IsDBNullAsync(3, cancellationToken) ? true : Convert.ToBoolean(await reader.GetFieldValueAsync<long>(3, cancellationToken)) == false,
await reader.IsDBNullAsync(2, cancellationToken) ? DbTypeResolver.Resolve("text") : DbTypeResolver.Resolve(await reader.GetFieldValueAsync<string>(2, cancellationToken)),
null,
null,
Expand Down

0 comments on commit a05466a

Please sign in to comment.