MDL-37420 rework pg schema (partial backport take2)
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Fri, 11 Jan 2013 10:36:48 +0000 (11:36 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Fri, 11 Jan 2013 10:36:48 +0000 (11:36 +0100)
enrol/database/tests/adodb_test.php

index 7f30c07..7c1393a 100644 (file)
@@ -67,7 +67,11 @@ class core_adodb_testcase extends advanced_testcase {
 
             case 'pgsql_native_moodle_database':
                 set_config('dbtype', 'postgres7', 'enrol_database');
-                set_config('dbsetupsql', 'SET NAMES \'UTF-8\'', 'enrol_database');
+                $setupsql = "SET NAMES 'UTF-8'";
+                if (!empty($CFG->dboptions['dbschema'])) {
+                    $setupsql .= "; SET search_path = '".$CFG->dboptions['dbschema']."'";
+                }
+                set_config('dbsetupsql', $setupsql, 'enrol_database');
                 set_config('dbsybasequoting', '0', 'enrol_database');
                 if (!empty($CFG->dboptions['dbsocket']) and ($CFG->dbhost === 'localhost' or $CFG->dbhost === '127.0.0.1')) {
                     if (strpos($CFG->dboptions['dbsocket'], '/') !== false) {