Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

time types panic on overflow #1171

Open
@allan2

Description

@allan2

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp