Merge branch 'w13_MDL-32029_m23_extdb' of git://github.com/skodak/moodle

This commit is contained in:
Sam Hemelryk
2012-03-26 10:31:36 +13:00
5 changed files with 25 additions and 14 deletions
+5 -3
View File
@@ -351,10 +351,12 @@ class mssql_native_moodle_database extends moodle_database {
if ($result) {
while ($row = mssql_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;
}
$this->free_result($result);
+5 -3
View File
@@ -419,10 +419,12 @@ class oci_native_moodle_database extends moodle_database {
oci_free_statement($stmt);
$records = array_map('strtolower', $records['TABLE_NAME']);
foreach ($records as $tablename) {
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;
}
+5 -3
View File
@@ -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);
+5 -2
View File
@@ -152,10 +152,13 @@ class sqlite3_pdo_moodle_database extends pdo_moodle_database {
foreach ($rstables as $table) {
$table = $table['name'];
$table = strtolower($table);
if (empty($this->prefix) || strpos($table, $this->prefix) === 0) {
if ($this->prefix !== '') {
if (strpos($table, $this->prefix) !== 0) {
continue;
}
$table = substr($table, strlen($this->prefix));
$tables[$table] = $table;
}
$tables[$table] = $table;
}
return $tables;
}
+5 -3
View File
@@ -401,10 +401,12 @@ class sqlsrv_native_moodle_database extends moodle_database {
if ($result) {
while ($row = sqlsrv_fetch_array($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;
}
$this->free_result($result);