Fix scan float4 into sql.Scanner

https://github.com/jackc/pgx/issues/1911
pull/1919/head
Jack Christensen 2024-02-23 18:18:03 -06:00
parent 654dcab93e
commit 85f15c4b3c
1 changed files with 2 additions and 2 deletions

View File

@ -297,12 +297,12 @@ func (c Float4Codec) DecodeDatabaseSQLValue(m *Map, oid uint32, format int16, sr
return nil, nil return nil, nil
} }
var n float64 var n float32
err := codecScan(c, m, oid, format, src, &n) err := codecScan(c, m, oid, format, src, &n)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return n, nil return float64(n), nil
} }
func (c Float4Codec) DecodeValue(m *Map, oid uint32, format int16, src []byte) (any, error) { func (c Float4Codec) DecodeValue(m *Map, oid uint32, format int16, src []byte) (any, error) {