Repository navigation
Fix embedded restore-database-mapping by preserving original table names - #1659
Merged
Merged
Conversation
…mes so RESTORE emits "AS <target>" instead of failing with code 605
RESTORE TABLE src AS dst doesn't create the target database when it is absent in the backup, and for --tables=db.table restoreEmptyDatabase skips it, so embedded restore with --restore-database-mapping failed with code 81 even after the AS fix. Create mapped target databases in restoreSchemaEmbedded the same way restoreSchemaRegular does. Add testflows scenario generic/embedded_restore_mapping: embedded backup to S3, restore_remote with --restore-database-mapping and --restore-table-mapping, source table stays untouched. Fails on master with code 605, passes with this branch. Fixes Altinity#1658 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Slach
requested changes
Nov 1, 2026
…ded.py - move mapped target database creation out of restoreSchemaEmbedded into createMappedDatabasesForEmbedded - rename tests/embedded_on_cluster.py to tests/embedded.py and move embedded_restore_mapping there; new `embedded` feature runs the ON CLUSTER feature and the mapping scenario, ON CLUSTER scenarios are listed explicitly so the mapping scenario doesn't run with the ON CLUSTER config; the 23.3 gate lives once in `embedded` Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Slach
approved these changes
Nov 2, 2026
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.
fix #1658
Changes
OriginalDatabase/OriginalTablefields toTableMetadatato hold the names as they exist inside the backupchangeTableQueryToAdjustDatabaseMappingandchangeTableQueryToAdjustTableMappingbeforeDatabase/Tableare overwritten with the targetembeddedRestoreObjectSQL, which builds<kind> <origin> AS <target>whenever the original and target names differrestoreEmbedded, replacing the lookup keyed on the already-overwrittent.Database--restore-table-mappingwork for embedded backupsRESTORESQL for no mapping, database mapping, database + table mapping, and a dictionary