[MDEV-32273] Broken queries are passed to the group by handler for execution Created: 2023-09-28 Updated: 2023-12-14 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 11.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Yuchen Pei | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
Probably affects other versions 10.4+. Consider the following query (see also [1] for a more detailed account):
The optimizer transforms it to
This query is unexecutable because t3.a is not a valid column in t1 left join t2. But the group by handler, if one is created, is expected to execute
According to psergei, this is a more general problem that the The group by handler is created at a later stage when the query has
Another, less problematic case is the introduction of semi join into SELECT a, b FROM t2 WHERE b IN (SELECT b FROM t2 WHERE a > 10); is transformed to select t1.a AS a,t1.b AS b from t1 semi join (t2) where t1.b = t2.b and t2.a > 10; This is less of an issue because it could be detected during handler One possibility of fixing this issue is to move the creation to |
| Comments |
| Comment by Yuchen Pei [ 2023-10-09 ] |
|
This issue is important because if it is left unaddressed, and there First, what should be the "components" of this bug? psergei said it |