(src []byte, dst any)
| 784 | type scanPlanTextAnyToNumericScanner struct{} |
| 785 | |
| 786 | func (scanPlanTextAnyToNumericScanner) Scan(src []byte, dst any) error { |
| 787 | scanner := (dst).(NumericScanner) |
| 788 | |
| 789 | if src == nil { |
| 790 | return scanner.ScanNumeric(Numeric{}) |
| 791 | } |
| 792 | |
| 793 | switch string(src) { |
| 794 | case "NaN": |
| 795 | return scanner.ScanNumeric(Numeric{NaN: true, Valid: true}) |
| 796 | case "Infinity": |
| 797 | return scanner.ScanNumeric(Numeric{InfinityModifier: Infinity, Valid: true}) |
| 798 | case "-Infinity": |
| 799 | return scanner.ScanNumeric(Numeric{InfinityModifier: NegativeInfinity, Valid: true}) |
| 800 | } |
| 801 | |
| 802 | num, exp, err := parseNumericString(string(src)) |
| 803 | if err != nil { |
| 804 | return err |
| 805 | } |
| 806 | |
| 807 | return scanner.ScanNumeric(Numeric{Int: num, Exp: exp, Valid: true}) |
| 808 | } |
| 809 | |
| 810 | func (c NumericCodec) DecodeDatabaseSQLValue(m *Map, oid uint32, format int16, src []byte) (driver.Value, error) { |
| 811 | if src == nil { |
nothing calls this directly
no test coverage detected