-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[9.x] Fix parsing config('database.connections.pgsql.search_path')
The given PostgresConnector regex doesn't consider the full range of characters allowed in a schema or variable name - specifically '-' and accented characters. e.g., 'test-db' was being parsed as `set search_path to "test", "db"` instead of `set search_path to "test-db"` Replace the 'search_path' regex allowlist of characters with a blocklist of delimiters when config('database.connections.pgsql.search_path') is a string value. Technically Postgres _does_ allow our config delimiter characters (spaces, comma, quotes) in symbols so an array configuration can instead be used for such schema names. However single/double quote characters in such array configs aren't supported. --- * Roll methods testPostgresSearchPathCommaSeparatedValueSupported() & testPostgresSearchPathVariablesSupported() into testPostgresSearchPathIsSet() with the provideSearchPaths() data set. * testPostgresSearchPathArraySupported() is repurposed to show config('database.connections.pgsql.schema') from versions < 9.x is used when the 'search_path' config key is absent. * Fix PostgresConnector::quoteSearchPath() docblock since passing in a string value would throw an exception for being un-Countable. Its only use is being given parseSearchPath()'s return value which is an array.
- Loading branch information
Showing
2 changed files
with
83 additions
and
39 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