Bug #118398 | Using temporary with avg cause wrong result | ||
---|---|---|---|
Submitted: | 9 Jun 8:00 | Modified: | 11 Jun 12:39 |
Reporter: | haizhen xue | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | 8.0.41 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[9 Jun 8:00]
haizhen xue
[9 Jun 8:04]
haizhen xue
tar -zxvf tbl_1_in_list.rar create database test; use test; source tbl_1_in_list.sql SELECT tt2.bool_col,AVG(tt2.time_col) col2 FROM (select distinct bool_col, time_col from tbl_1_in_list where bool_col=0 or bool_col =2) tt1 join tbl_1_in_list tt2 on tt1.bool_col=tt2.bool_col GROUP BY 1; SELECT bool_col,AVG(time_col) col2 FROM tbl_1_in_list WHERE bool_col IN (0,2) GROUP BY 1;
[11 Jun 12:39]
MySQL Verification Team
Hello haizhen xue, Thank you for the report and test case. regards, Umesh