mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
A multi-table DELETE on a FEDERATED or FederatedX table went wrong when a primary key lookup made the target a const table. The optimizer reads a const table's row through index_read_idx_map(), whose default implementation ends the index scan and frees the result set. The server asks for the row's position later, during execution, so the saved position was empty. FederatedX skipped the row and FEDERATED crashed in rnd_pos(). Both engines now override index_read_idx_map() so that the lookup leaves its result set open, as index_read() does. position() then records a valid position, and the result set is freed at the end of the statement. FEDERATED's reset() now also clears stored_result, which otherwise pointed at a freed result set and was freed again when the table was closed. Tests include a multitable UPDATE with a const target, which crashed both engines before the fix. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>