MDEV-39196: SELECT from information schema fails when FederatedX loses underlying table#4876
Open
itzanway wants to merge 1 commit intoMariaDB:10.6from
Open
MDEV-39196: SELECT from information schema fails when FederatedX loses underlying table#4876itzanway wants to merge 1 commit intoMariaDB:10.6from
itzanway wants to merge 1 commit intoMariaDB:10.6from
Conversation
7a363d0 to
5aa46fe
Compare
…s underlying table When a remote table is unavailable, FederatedX was passing a hard error back to the SQL layer, causing INFORMATION_SCHEMA queries to abort entirely. This patch intercepts the remote error in ha_federatedx::info, downgrades it to a warning using push_warning_printf, and includes the local table name in the warning message so the user knows which table is inaccessible. Signed-off-by: Anway Durge <124391429+itzanway@users.noreply.github.com>
5aa46fe to
6041c66
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR resolves MDEV-39196 by fixing a bug where
SELECTqueries fromINFORMATION_SCHEMAfail completely when a FederatedX underlying remote table is unreachable.As noted in the issue, the storage engine was previously passing a hard error back to the SQL layer without specifying the guilty local table name, breaking the query and making debugging very difficult.
Implementation Details
ha_federatedx::info()instorage/federatedx/ha_federatedx.ccto catch remote connection and missing table errors, downgrading them from fatal errors to warnings usingpush_warning_printf.share->table_name) into the warning message so users can easily identify exactly which FederatedX table is inaccessible.error_code = 0;after pushing the warning, allowing theINFORMATION_SCHEMAloop to finish scanning the remaining tables in the database instead of aborting.Testing
federatedx_mdev39196.testand.result) to thefederatedsuite to simulate a dropped remote table and verify that the query succeeds while pushing the correct warning.