[MDEV-28691] Spider: fall back to usual handler if GROUP BY handler fails to generate query Created: 2022-05-29  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - Spider
Fix Version/s: 10.4, 10.5, 10.6

Type: Task Priority: Major
Reporter: Nayuta Yanagisawa (Inactive) Assignee: Yuchen Pei
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-26247 Spider: Valid LEFT JOIN results in ER... Closed
relates to MDEV-26361 Spider: Use GROUP BY handler only whe... Closed

 Description   

Validate (or reparse) an entire query generated by Spider's GROUP BY handler (GBH) and, if the query is invalid, fall back to the usual handler.

The GBH generates a query for so-called a direct execution from an instance of the Query class. Sadly, It is rare but possible that GBH generates a wrong query (e.g., MDEV-26247) because generating a entire query is a more difficult task than a query involving a single table, which is generated by Spider's usual handler.

To properly fall back to the usual handler on the GBH failures, we need to move the query generation in spider_group_by_handler::init_scan() into spider_create_group_by_handler(). This is because the server decides whether it uses GBH or not by the return value of spider_create_group_by_handler() and the decision cannot be reversed later.

The feature could hide query generation bugs of GBH. It is convenient for normal use of Spider but is not good for testing or debugging. Thus, we need to implement a switch to disable the fallback. We disable the fallback by default for community testing.

TODO: Once the issue is completed, check if the fix for MDEV-25116 can be reverted.


Generated at Thu Feb 08 10:02:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.