[DBAL-453] PostgreSqlSchemaManager::getSchemaSearchPaths does not work for secondary schemas Created: 24/Feb/13  Updated: 01/May/13  Resolved: 01/May/13

Status: Resolved
Project: Doctrine DBAL
Component/s: Schema Managers
Affects Version/s: 2.3.2
Fix Version/s: 2.3.4
Security Level: All

Type: Bug Priority: Major
Reporter: Roger Hunwicks Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

Postgresql 9.1 on Ubuntu 12.04



 Description   

PostgreSqlSchemaManager::getSchemaSearchPaths() uses "SHOW search_path" to get the current search path for the connection and explodes it using a comma delimiter. On my installation Postgresql 9.1 on Ubuntu 12.04 "SHOW search__path" returns the schemas in the search path separated by ", " (i.e. a comma followed by a space). This means that the array of schemas returned by getSchemaSearchPaths() will including a leading space on the schema names for the second and subsequent schemas in the search list.

This is a particular problem if you call PostgreSqlSchemaManager::getExistingSchemaSearchPaths() because that calls determineExistingSchemaSearchPaths() which filters the list from getSchemaSearchPaths() to make sure they are in the list of schemas in the database (as returned from getSchemaNames(). The second and subsequent schemas in the search path still have a leading space when they are compared to the array of schema names, and consequently they do not match and are not included in the array returned by getExistingSchemaSearchPaths().

I think that getSchemaSearchPaths should trim the leading space from the schemas.



 Comments   
Comment by Benjamin Eberlei [ 01/May/13 ]

Fixed in 2.3.4

Generated at Mon Sep 01 11:54:50 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.