Skip to content

Commit 3baee86

Browse files
committed
Explicitly cast double values down to float in Row.GetFloat().
Supports casting to float in Pomelo.EntityFramworkCore.MySql for MySQL < 8.0.17. Signed-off-by: Laurents Meyer <[email protected]>
1 parent c28126e commit 3baee86

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/MySqlConnector/Core/Row.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,8 @@ public double GetDouble(int ordinal)
353353
public float GetFloat(int ordinal)
354354
{
355355
var value = GetValue(ordinal);
356-
return value is decimal decimalValue ? (float) decimalValue :
356+
return value is double doubleValue ? (float) doubleValue :
357+
value is decimal decimalValue ? (float) decimalValue :
357358
(float) value;
358359
}
359360

0 commit comments

Comments
 (0)