From 9d974e0a1d3cdf02326c61c8b3cdea8af40e0878 Mon Sep 17 00:00:00 2001 From: Michael Pendon Date: Sat, 3 Oct 2020 14:06:52 +0200 Subject: [PATCH] #343 Fixed the failing Integration Tests for SqLite and MySQL. --- RepoDb.MySql/RepoDb.MySql/DbHelpers/MySqlDbHelper.cs | 12 ++++++------ .../RepoDb.SqLite/DbHelpers/SqLiteDbHelper.cs | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/RepoDb.MySql/RepoDb.MySql/DbHelpers/MySqlDbHelper.cs b/RepoDb.MySql/RepoDb.MySql/DbHelpers/MySqlDbHelper.cs index 09fa02ee0..690aafc7f 100644 --- a/RepoDb.MySql/RepoDb.MySql/DbHelpers/MySqlDbHelper.cs +++ b/RepoDb.MySql/RepoDb.MySql/DbHelpers/MySqlDbHelper.cs @@ -135,16 +135,16 @@ private async Task ReaderToDbFieldAsync(DbDataReader reader, else { size = await reader.IsDBNullAsync(5, cancellationToken) ? (int?)null : - await reader.GetFieldValueAsync(5, cancellationToken); + Convert.ToInt32(await reader.GetFieldValueAsync(5, cancellationToken)); } return new DbField(await reader.GetFieldValueAsync(0, cancellationToken), - await reader.GetFieldValueAsync(1, cancellationToken), - await reader.GetFieldValueAsync(2, cancellationToken), - await reader.GetFieldValueAsync(1, cancellationToken), + Convert.ToBoolean(await reader.GetFieldValueAsync(1, cancellationToken)), + Convert.ToBoolean(await reader.GetFieldValueAsync(2, cancellationToken)), + Convert.ToBoolean(await reader.GetFieldValueAsync(1, cancellationToken)), DbTypeResolver.Resolve(columnType), size, - await reader.IsDBNullAsync(6, cancellationToken) ? (byte?)null : byte.Parse((await reader.GetFieldValueAsync(6, cancellationToken)).ToString()), - await reader.IsDBNullAsync(7, cancellationToken) ? (byte?)null : byte.Parse((await reader.GetFieldValueAsync(7, cancellationToken)).ToString()), + await reader.IsDBNullAsync(6, cancellationToken) ? (byte?)null : byte.Parse((await reader.GetFieldValueAsync(6, cancellationToken)).ToString()), + await reader.IsDBNullAsync(7, cancellationToken) ? (byte?)null : byte.Parse((await reader.GetFieldValueAsync(7, cancellationToken)).ToString()), await reader.GetFieldValueAsync(8, cancellationToken)); } diff --git a/RepoDb.SqLite/RepoDb.SqLite/DbHelpers/SqLiteDbHelper.cs b/RepoDb.SqLite/RepoDb.SqLite/DbHelpers/SqLiteDbHelper.cs index 6907836f1..d55f20d08 100644 --- a/RepoDb.SqLite/RepoDb.SqLite/DbHelpers/SqLiteDbHelper.cs +++ b/RepoDb.SqLite/RepoDb.SqLite/DbHelpers/SqLiteDbHelper.cs @@ -85,9 +85,9 @@ private async Task ReaderToDbFieldAsync(DbDataReader reader, CancellationToken cancellationToken = default) { return new DbField(await reader.GetFieldValueAsync(1, cancellationToken), - await reader.IsDBNullAsync(5, cancellationToken) ? false : reader.GetBoolean(5), + await reader.IsDBNullAsync(5, cancellationToken) ? false : Convert.ToBoolean(await reader.GetFieldValueAsync(5, cancellationToken)), string.Equals(await reader.GetFieldValueAsync(1, cancellationToken), identityFieldName, StringComparison.OrdinalIgnoreCase), - await reader.IsDBNullAsync(3, cancellationToken) ? true : await reader.GetFieldValueAsync(3, cancellationToken) == false, + await reader.IsDBNullAsync(3, cancellationToken) ? true : Convert.ToBoolean(await reader.GetFieldValueAsync(3, cancellationToken)) == false, await reader.IsDBNullAsync(2, cancellationToken) ? DbTypeResolver.Resolve("text") : DbTypeResolver.Resolve(await reader.GetFieldValueAsync(2, cancellationToken)), null, null,