-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Record search path failures on connect
Instead of ignoring them, record when the schema can't be added to the search path. Then use that value to avoid querying the database in `_sync_plan`. This prevents Sqitch from finding a valid project record when the search path contains a valid changes table and record for the project, which can happen when one starts using the current schema for the registry (the default on Oracle) and then tries to use a new registry. Resolves #668. To best make use of the new `_no_registry` attribute of Engine, rename the `initialized()` method to `_initialized()` and add a new `initialized()` method to check it before calling the engine-specific `_initialized()` method. Also rename the `initialize()` method to `_initialize()` and provide an `initialize()` implementation that sets `_no_registry` to false after a successful call to the engine-specific `_initialize()` method. Update the DBI `connected` callbacks to return anytime `$dbh->do` returns false, thereby always propagating errors. Previously errors were ignored in MySQL and Snowflake (and we had an invalid warehouse name in the tests that needed fixing!). For search path errors, call the new DBIEngine role `_handle_no_registry` method, which sets `_no_registry` to true and discards the error so that the DBI won't throw it once the callback function returns. Since the error handling is boolean-based, here, and the error handler is never called from inside the callback, remove the `try {}` block. It wasn't doing anything. While at it, require DBI 1.631 to ensure consistent behavior of error handling in callbacks and to eliminate a workaround for older versions in the mysql engine.
- Loading branch information
Showing
13 changed files
with
108 additions
and
76 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.