TiFlash pow/power function doesn't return null when invalid arguments
- 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)
prepare data
```sql
drop table if exists t0;
CREATE TABLE t0(c0 DOUBLE UNSIGNED);
INSERT INTO t0 VALUES (0.1), (0.2);
ALTER TABLE t0 SET TIFLASH REPLICA 1;
```
execute query
```sql
SELECT /*+ read_from_storage(tikv[t0]) */ t0.c0 FROM t0 WHERE POWER(-1, t0.c0);
SELECT /*+ read_from_storage(tiflash[t0]) */ t0.c0 FROM t0 WHERE POWER(-1, t0.c0);
```
### 2. What did you expect to see? (Required)
The results of the two queries are equal.
### 3. What did you see instead (Required)
Query1: empty
Query2:

### 4. What is your TiDB version? (Required)
Release Version: v8.4.0
Edition: Community
Git Commit Hash: 1a9f0fa25580907d3266dc3edf000ba24379a600
Git Branch: HEAD
UTC Build Time: 2024-11-07 15:18:43
GoVersion: go1.23.2
Race Enabled: false
Check Table Before Drop: false
Store: tikv
Contributor guide
Research direction
Start by running the two POWER(-1, c0) queries from the report against TiKV and TiFlash on the stated v8.4.0 setup, then trace how invalid POWER arguments are evaluated in each storage path. Done means both queries return equivalent results, with a regression test covering the invalid-argument case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100