Skip to content

Commit

Permalink
Use exponent of 3 digits to fix compatibility issue with older Postgr…
Browse files Browse the repository at this point in the history
…eSQL server
  • Loading branch information
larskanis committed Mar 24, 2023
1 parent 0de9cc7 commit e23692d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/pg/basic_type_map_based_on_result_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@
row_encoder = PG::BinaryEncoder::CopyRow.new type_map: tm

@conn.copy_data( "COPY copytable FROM STDIN WITH (FORMAT binary)", row_encoder ) do |res|
@conn.put_copy_data ["\xff\x00\n\r'", 123, Time.utc(2023, 3, 17, 3, 4, 5.6789123), 12.345, -12.345e67]
@conn.put_copy_data ["\xff\x00\n\r'", 123, Time.utc(2023, 3, 17, 3, 4, 5.6789123), 12.345, -12.345e167]
@conn.put_copy_data [" xyz ", -444, Time.new(1990, 12, 17, 18, 44, 45, "+03:30"), -Float::INFINITY, Float::NAN]
end
res = @conn.exec( "SELECT * FROM copytable" )
expect( res.values ).to eq( [["\\xff000a0d27", "123", "2023-03-17 03:04:05.678912", "12.345", "-1.2345e+68"], ["\\x202078797a2020", "-444", "1990-12-17 15:14:45", "-Infinity", "NaN"]] )
expect( res.values ).to eq( [["\\xff000a0d27", "123", "2023-03-17 03:04:05.678912", "12.345", "-1.2345e+168"], ["\\x202078797a2020", "-444", "1990-12-17 15:14:45", "-Infinity", "NaN"]] )
end
end
end
Expand Down

0 comments on commit e23692d

Please sign in to comment.