MDEV-39196: SELECT from information schema fails when FederatedX loses underlying table#4876
MDEV-39196: SELECT from information schema fails when FederatedX loses underlying table#4876itzanway wants to merge 1 commit intoMariaDB:10.11from
Conversation
5aa46fe to
6041c66
Compare
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for your contribution! This is a preliminary review.
Please rebase to 10.11. 10.6 is almost out of the door and only "critical" bugs go into it.
|
Hi @gkodinov, thanks for the review! I've updated the PR with the requested changes: Rebased the branch to target 10.11. Updated the .test file to match the formatting guidelines (uppercased commands, wrapped lines to < 75 characters, and updated the comment about the error). Added the missing .result file. Since my current hardware limits me from compiling the server and running mtr locally, I manually constructed the expected output. I've pushed these as a single amended commit. Let me know if anything else is needed! |
gkodinov
left a comment
There was a problem hiding this comment.
LGTM. Thanks for your efforts so far.
Please stay tuned for the final review.
gkodinov
left a comment
There was a problem hiding this comment.
Missed the test failures. please fix as suggested
|
Hi @gkodinov, Thanks for catching that! I've made the requested updates: Added --source include/not_embedded.inc to fix the embedded test failures. Added the MDEV header to the top of the .test file. Updated the .result file to reflect the new --echo output. I have amended these changes and force-pushed them as a single commit. |
gkodinov
left a comment
There was a problem hiding this comment.
Some more tests are failing in the federated suite. Please fix:
federated.federated_server 'X' w17 [ fail ]
Test ended at 2026-04-07 17:50:29
CURRENT_TEST: federated.federated_server
mysqltest: At line 243: query 'select * from federated.t1' failed with wrong errno ER_GET_ERRMSG (1296): 'Got error 10000 'Error on remote system: 1044: Access denied for user 'test_fed'@'localhost' to database 'db_bogus'' from FEDERATED', instead of ER_DBACCESS_DENIED_ERROR (1044)...
03992bd to
0be6930
Compare
|
moving from #4976:
federatedx_mdev39196 is only added by this PR so it can't fail on other branches. PR #4939 and bb-10.11-midenok are the same - an no federated.* failures from this year.
11.8 federated errors aren't the same (MDEV-36387). They aren't there. Tip - use Change the federated test too. Your info change impacts more than just information _schema. |
0be6930 to
fbddc77
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>
fbddc77 to
67b0c4a
Compare
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.