Repository navigation
fix(export): keep tables and schemas whose names differ only in Unicode form apart - #4359
Merged
Merged
Conversation
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.
Summary
Stringequates them. The SQL export and the Data Dictionary keyed their schema-wide reads byString, so such tables took each other's columns, keys and indexes.SQLExportGroupReads. They are still read by group from every source; a group read that fails, reaches the row limit or holds the name in another spelling now reads that table alone instead of dropping its metadata.SQLExportGroupReadstoapple/Plugins/Shared/PluginExportSpelling.swift, shared by both plugins and the iOS app.fetchAllColumnsForExport,fetchAllForeignKeysForExportandfetchAllIndexesForExportonPluginDatabaseDriver, defaulting to the shared reads.ExportDataSourceAdapterand the iOS export catalogs call them.apple/scripts/probes/check-postgres-export-unicode-names.sh. The P20 probe and the column type corpus probe link the new shared file.Test plan
ExportUnicodeNameTests(FormatPluginTests): two such tables both dumped with their own columns, keys and order, from a source that throws or merges; two such schemas read and qualified apart; two such sequences and types each created; a failed column group read falls back per table; another spelling in an answer reads alone; Data Dictionary schemas, relations, anchors and qualification. 9 of 9 failed on main's plugin sources, the merging-source cases also on the first commit here.PostgreSQLExportSchemaReadTests,ExportDataSourceAdapterCatalogTests,PostgreSQLExportCatalogTests(iOS) andPluginExportReadDefaultsTests(PluginKit).fiftyschema) through a counting proxy: 209 queries on main and here, the same dump.