IntIntMod cause tikv crash
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
create table t(a bigint not null, b bigint not null);
insert into t values(-9223372036854775808, -1);
select * from t where a % b = 0;
```
### 2. What did you expect to see? (Required)
query ok
### 3. What did you see instead (Required)
```sql
mysql> select * from t where a % b = 0;
ERROR 9005 (HY000): Region is unavailable
```
and log
```
[2024/11/06 14:25:00.482 +08:00] [FATAL] [lib.rs:478] ["attempt to calculate the remainder with overflow"] [backtrace=" 0: backtrace::capture::Backtrace::new\n 1: tikv_util::set_panic_hook::{{closure}}\n 2: std::panicking::rust_panic_with_hook\n 3: std::panicking::begin_panic_handler::{{closure}}\n 4: std::sys_common::backtrace::__rust_end_short_backtrace\n 5: _rust_begin_unwind\n 6: core::panicking::panic_fmt\n 7: core::panicking::panic\n 8: tidb_query_expr::impl_arithmetic::arithmetic_fn_meta::run\n 9: tidb_query_expr::types::expr_eval::::eval_decoded\n 10: as tidb_query_executors::interface::BatchExecutor>::next_batch::{{closure}}\n 11: as tidb_query_executors::interface::BatchExecutor>::next_batch::{{closure}}\n 12: as tidb_query_executors::interface::BatchExecutor>::next_batch::{{closure}}\n 13: tidb_query_executors::runner::BatchExecutorsRunner::internal_handle_request::{{closure}}\n 14: ::handle_request::{{closure}}\n 15: as core::future::future::Future>::poll\n 16: as core::future::future::Future>::poll\n 17: as core::future::future::Future>::poll\n 18: yatp::task::future::RawTask::poll\n 19: ::handle\n 20: as yatp::pool::runner::Runner>::handle\n 21: std::sys_common::backtrace::__rust_begin_short_backtrace\n 22: core::ops::function::FnOnce::call_once{{vtable.shim}}\n 23: std::sys::unix::thread::Thread::new::thread_start\n 24: __pthread_joiner_wake\n"] [location=components/tidb_query_expr/src/impl_arithmetic.rs:224] [thread_name=unified-read-pool-1] [thread_id=33]
```
### 4. What is your TiDB version? (Required)
```
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v8.3.0
Edition: Community
Git Commit Hash: 1a0c3ac3292fff7742faa0c00a662ccb66ba40db
Git Branch: HEAD
UTC Build Time: 2024-08-20 10:23:00
GoVersion: go1.21.10
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
Contributor guide
Assessment
This issue has not been assessed yet.