unhelpful error message when aggregate function is used in where clause
- Dominant language
- Go
- Stars
- 24.4k
- Forks
- 873
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 120
Description
dolt
```
stocks/master> select max(date) as latest_date from ohlcv where max(date) < date_sub(curdate(), interval 7 day);
Error 1105 (HY000): unable to find field with index 8 in row of 1 columns
```
mysql
```
mysql> select max(date) as latest_date from ohlcv where max(date) < date_sub(curdate, interval 7 day);
ERROR 1111 (HY000): Invalid use of group function
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the Dolt query and compare its error with the MySQL result shown in the issue. Trace the SQL aggregation and WHERE-clause validation path responsible for the invalid field-index error. Done means the query returns a clear, appropriate invalid-use-of-group-function error instead of the internal field-index message.
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