- Notifications
You must be signed in to change notification settings - Fork515
Open
Description
When constructingtime
types using out-of-range values, panic occurs.
This affects most of theFromSql
andToSql
implementations fortime
0.2 and 0.3.
let row = client.query_one("SELECT 'infinity'::timestamp",&[])?;let res = row.try_get::<_, time::PrimitiveDateTime>(0);// this panics
Minimal example here -->allan2/postgres-time-overflow
The fix is to use fallible operations likechecked_add
andtry_from
.
An infinity test liketest_special_params_without_wrapper
should also be added fortime
.[1].
I have a PR in the works but I will wait for#1164 and#1170 first.
Metadata
Metadata
Assignees
Labels
No labels