[MDEV-24298] SELECT_LEX::find_select_handler() fails to find MCS table running INSERT..SELECT with a single derived at top level in SELECT Created: 2020-11-27 Updated: 2022-05-06 Resolved: 2021-01-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.5, 10.6 |
| Fix Version/s: | 10.5.9 |
| Type: | Bug | Priority: | Major |
| Reporter: | Roman | Assignee: | Roman |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
As of now MDB doesn't use Select Handler for queries like:
but Select Handler works for the SELECT part of the query. The reason why this happens is that join->tables_list doesn't have TABLE_LIST* for a real table but for a derived one. Here is the gdb snippet taken in the first iteration of the loop in SELECT_LEX::find_select_handler():
It doesn't matter if derived_merged is on or off.
Here is the code of the mentioned find_select_handler():
|
| Comments |
| Comment by Roman [ 2021-01-11 ] |
|
Closing an issue trying to address it from a different direction. |
| Comment by Chris Calender (Inactive) [ 2021-01-11 ] |
|
Alternative direction, if interested: MCOL-4490 |
| Comment by Roman [ 2021-01-22 ] |
|
The issue is caused by the fact that Smart Engines: MCS and Xpand can't handle derived_merge optimization thus disabling it in the very beginning of the query processing so that SELECT_LEX::join->tables_list has no leaf table at the moment where SELECT_LEX::find_select_handler() is called. |