mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
fix(prql): Robust panic handler
This commit is contained in:
parent
0f6a1b451b
commit
1a5afa90a1
2
.gitignore
vendored
2
.gitignore
vendored
@ -165,7 +165,7 @@ tests/queries/0_stateless/*.expect.history
|
|||||||
tests/integration/**/_gen
|
tests/integration/**/_gen
|
||||||
|
|
||||||
# rust
|
# rust
|
||||||
/rust/**/target
|
/rust/**/target*
|
||||||
# It is autogenerated from *.in
|
# It is autogenerated from *.in
|
||||||
/rust/**/.cargo/config.toml
|
/rust/**/.cargo/config.toml
|
||||||
/rust/**/vendor
|
/rust/**/vendor
|
||||||
|
@ -57,14 +57,8 @@ pub unsafe extern "C" fn prql_to_sql(
|
|||||||
out: *mut *mut u8,
|
out: *mut *mut u8,
|
||||||
out_size: *mut u64,
|
out_size: *mut u64,
|
||||||
) -> i64 {
|
) -> i64 {
|
||||||
let ret = panic::catch_unwind(|| {
|
// NOTE: using cxxbridge we can return proper Result<> type.
|
||||||
return prql_to_sql_impl(query, size, out, out_size);
|
panic::catch_unwind(|| prql_to_sql_impl(query, size, out, out_size)).unwrap_or(1)
|
||||||
});
|
|
||||||
return match ret {
|
|
||||||
// NOTE: using cxxbridge we can return proper Result<> type.
|
|
||||||
Err(_err) => 1,
|
|
||||||
Ok(res) => res,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
Loading…
Reference in New Issue
Block a user