diff --git a/Dapper/DefaultTypeMap.cs b/Dapper/DefaultTypeMap.cs
index 2e3423485..c936cce3f 100644
--- a/Dapper/DefaultTypeMap.cs
+++ b/Dapper/DefaultTypeMap.cs
@@ -97,7 +97,7 @@ private static FieldInfo[] GetSettableFields(Type t)
if (types[i] == typeof(byte[]) && ctorParameters[i].ParameterType.FullName == SqlMapper.LinqBinary)
continue;
var unboxedType = Nullable.GetUnderlyingType(ctorParameters[i].ParameterType) ?? ctorParameters[i].ParameterType;
- if ((unboxedType != types[i] && !SqlMapper.HasTypeHandler(unboxedType))
+ if ((unboxedType != types[i] && !SqlMapper.HasTypeHandler(unboxedType) && !SqlMapper.IsNumericConversion(types[i], unboxedType))
&& !(unboxedType.IsEnum && Enum.GetUnderlyingType(unboxedType) == types[i])
&& !(unboxedType == typeof(char) && types[i] == typeof(string))
&& !(unboxedType.IsEnum && types[i] == typeof(string)))
diff --git a/Dapper/SqlMapper.cs b/Dapper/SqlMapper.cs
index 8f3956cab..95e4b96dd 100644
--- a/Dapper/SqlMapper.cs
+++ b/Dapper/SqlMapper.cs
@@ -3220,6 +3220,22 @@ internal static bool IsDateTimeFamilyConversion(Type from, Type to)
=> false;
#endif
+ internal static bool IsNumericConversion(Type from, Type to)
+ {
+ static bool IsNumericOrBoolean(Type type)
+ {
+ return Type.GetTypeCode(type) switch
+ {
+ TypeCode.Boolean or TypeCode.Byte or TypeCode.SByte or TypeCode.Int16 or TypeCode.UInt16
+ or TypeCode.Int32 or TypeCode.UInt32 or TypeCode.Int64 or TypeCode.UInt64
+ or TypeCode.Single or TypeCode.Double => true,
+ _ => false,
+ };
+ }
+
+ return IsNumericOrBoolean(from) && IsNumericOrBoolean(to);
+ }
+
internal static bool TryConvertDateTimeFamily(object? value, Type to, [NotNullWhen(true)] out object? converted)
{
#if NET6_0_OR_GREATER
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 2f91a3cca..b1e42ba41 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -38,6 +38,7 @@
+
diff --git a/tests/Dapper.Tests/Dapper.Tests.csproj b/tests/Dapper.Tests/Dapper.Tests.csproj
index 93b498618..e9eab6b88 100644
--- a/tests/Dapper.Tests/Dapper.Tests.csproj
+++ b/tests/Dapper.Tests/Dapper.Tests.csproj
@@ -32,6 +32,7 @@
+
diff --git a/tests/Dapper.Tests/FakeDbTests.Issue1966.cs b/tests/Dapper.Tests/FakeDbTests.Issue1966.cs
new file mode 100644
index 000000000..ce65a6832
--- /dev/null
+++ b/tests/Dapper.Tests/FakeDbTests.Issue1966.cs
@@ -0,0 +1,27 @@
+#if !NET481
+using System.Collections.Generic;
+using pengdows.crud.fakeDb;
+using Xunit;
+
+namespace Dapper.Tests;
+
+public sealed class FakeDbIssue1966Tests
+{
+ [Fact]
+ public void ConstructorMappingConvertsNumericColumnToBoolean()
+ {
+ using var connection = new fakeDbConnection(new FakeDataStore());
+ connection.EnqueueReaderResult(new[]
+ {
+ new Dictionary { ["B"] = 1 },
+ });
+ connection.Open();
+
+ var result = connection.QuerySingle("select 1 as B");
+
+ Assert.True(result.B);
+ }
+
+ private sealed record InConstructor(bool B);
+}
+#endif