diff --git a/Sources/MySQL/Bind+Node.swift b/Sources/MySQL/Bind+Node.swift index eca1b780..14595477 100644 --- a/Sources/MySQL/Bind+Node.swift +++ b/Sources/MySQL/Bind+Node.swift @@ -23,7 +23,7 @@ extension Bind { func cast(_ buffer: UnsafeMutableRawPointer, _ type: T.Type) -> UnsafeMutablePointer { return buffer.bindMemory(to: type, capacity: 1) } - + func unwrap(_ buffer: UnsafeMutableRawPointer, _ type: T.Type) -> T { return buffer.load(as: type) @@ -97,6 +97,9 @@ extension Bind { case MYSQL_TYPE_DOUBLE: let double = unwrap(buffer, Double.self) return .number(.double(double)) + case MYSQL_TYPE_FLOAT: + let float = unwrap(buffer, Float.self) + return .number(.double(Double(float))) case MYSQL_TYPE_DATE: let time = unwrap(buffer, MYSQL_TIME.self) return .string("\(time.year.pad(4))-\(time.month.pad(2))-\(time.day.pad(2))")