Bug #116895 | View using IN(SELECT LIMIT) has wrong result | ||
---|---|---|---|
Submitted: | 6 Dec 2024 11:45 | Modified: | 6 Dec 2024 14:30 |
Reporter: | Guilhem Bichot | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | 9.0,8.0, 8.0.40, 8.4.3 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | regression |
[6 Dec 2024 11:45]
Guilhem Bichot
[6 Dec 2024 11:54]
MySQL Verification Team
Hello Guilhem, Thank you for the report and test case. regards, Umesh
[6 Dec 2024 14:30]
Guilhem Bichot
Same problem if LIMIT 1,1 is replaced with LIMIT 0.
[25 Dec 2024 3:09]
huahua xu
The bug might be traced back to the commit: https://github.com/mysql/mysql-server/commit/cedf0269d5b698278067397392bd57633c1a66d5. @@ -2270,20 +2267,7 @@ void st_select_lex::print_limit(THD *thd, if (subs_type == Item_subselect::EXISTS_SUBS || subs_type == Item_subselect::IN_SUBS || subs_type == Item_subselect::ALL_SUBS) - { - DBUG_ASSERT(!item->fixed || - /* - If not using materialization both: - select_limit == 1, and there should be no offset_limit. - */ - (((subs_type == Item_subselect::IN_SUBS) && - ((Item_in_subselect*)item)->exec_method == - Item_in_subselect::EXEC_MATERIALIZATION) ? - TRUE : - (select_limit->val_int() == LL(1)) && - offset_limit == 0)); return; - } } if (explicit_limit) {