MDL-32029 fix get_tables() when prefix empty in external database
This commit is contained in:
@@ -297,10 +297,12 @@ class pgsql_native_moodle_database extends moodle_database {
|
||||
if ($result) {
|
||||
while ($row = pg_fetch_row($result)) {
|
||||
$tablename = reset($row);
|
||||
if (strpos($tablename, $this->prefix) !== 0) {
|
||||
continue;
|
||||
if ($this->prefix !== '') {
|
||||
if (strpos($tablename, $this->prefix) !== 0) {
|
||||
continue;
|
||||
}
|
||||
$tablename = substr($tablename, strlen($this->prefix));
|
||||
}
|
||||
$tablename = substr($tablename, strlen($this->prefix));
|
||||
$this->tables[$tablename] = $tablename;
|
||||
}
|
||||
pg_free_result($result);
|
||||
|
||||
Reference in New Issue
Block a user