-
-
Notifications
You must be signed in to change notification settings - Fork 685
Description
Description
When calling from_query_result_to_proxy_row on a postgres row that contains a TIMESTAMPTZ, sea-orm panics:
thread 'test_single_row' (266363) panicked at /usr/local/share/rust/git/checkouts/sea-orm-90fbe3eeeb085334/0c1e7ac/src/driver/sqlx_postgres.rs:818:34:
Failed to get timestamptz: ColumnDecode { index: "3", source: "mismatched types; Rust type `core::option::Option<time::primitive_date_time::PrimitiveDateTime>` (as SQL type `TIMESTAMP`) is not compatible with SQL type `TIMESTAMPTZ`" }
stack backtrace:
0: __rustc::rust_begin_unwind
at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library/std/src/panicking.rs:689:5
1: core::panicking::panic_fmt
at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library/core/src/panicking.rs:80:14
2: core::result::unwrap_failed
at /rustc/4a4ef493e3a1488c6e321570238084b38948f6db/library/core/src/result.rs:1867:5
3: core::result::Result<T,E>::expect
at /usr/local/share/rust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1185:23
4: sea_orm::driver::sqlx_postgres::from_sqlx_postgres_row_to_proxy_row::{{closure}}
at /usr/local/share/rust/git/checkouts/sea-orm-90fbe3eeeb085334/0c1e7ac/src/driver/sqlx_postgres.rs:818:34
5: core::iter::adapters::map::map_fold::{{closure}}
at /usr/local/share/rust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/map.rs:88:28
6: <core::slice::iter::Iter<T> as core::iter::traits::iterator::Iterator>::fold
at /usr/local/share/rust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:279:27
7: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
at /usr/local/share/rust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/map.rs:128:19
8: core::iter::traits::iterator::Iterator::for_each
at /usr/local/share/rust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:832:14
9: alloc::vec::Vec<T,A>::extend_trusted
at /usr/local/share/rust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:3937:26
10: <alloc::vec::Vec<T,A> as alloc::vec::spec_extend::SpecExtend<T,I>>::spec_extend
at /usr/local/share/rust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/spec_extend.rs:27:14
11: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter
at /usr/local/share/rust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/spec_from_iter_nested.rs:60:16
12: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
at /usr/local/share/rust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/spec_from_iter.rs:33:9
13: <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter
at /usr/local/share/rust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:3801:9
14: core::iter::traits::iterator::Iterator::collect
at /usr/local/share/rust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:2035:9
15: <alloc::collections::btree::map::BTreeMap<K,V> as core::iter::traits::collect::FromIterator<(K,V)>>::from_iter
at /usr/local/share/rust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/collections/btree/map.rs:2385:51
16: core::iter::traits::iterator::Iterator::collect
at /usr/local/share/rust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:2035:9
17: sea_orm::driver::sqlx_postgres::from_sqlx_postgres_row_to_proxy_row
at /usr/local/share/rust/git/checkouts/sea-orm-90fbe3eeeb085334/0c1e7ac/src/driver/sqlx_postgres.rs:924:14
18: sea_orm::database::proxy::from_query_result_to_proxy_row
at /usr/local/share/rust/git/checkouts/sea-orm-90fbe3eeeb085334/0c1e7ac/src/database/proxy.rs:151:46
[...]
Steps to Reproduce
- Create a table with a
TIMESTAMPTZvalue - Query a row from that table
- Call
from_query_result_to_proxy_row
Expected Behavior
No panic
Actual Behavior
Panic
Reproduces How Often
Always
Workarounds
None I know
Versions
1.1.x branch with #3000 applied
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels