mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-17377 DML: prefixless database regression in new native drivers
This commit is contained in:
parent
e494fbf171
commit
7fdcb77942
@ -156,10 +156,12 @@ class mysqli_native_moodle_database extends moodle_database {
|
||||
if ($result) {
|
||||
while ($arr = $result->fetch_assoc()) {
|
||||
$tablename = reset($arr);
|
||||
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));
|
||||
$tables[$tablename] = $tablename;
|
||||
}
|
||||
$result->close();
|
||||
@ -172,7 +174,6 @@ class mysqli_native_moodle_database extends moodle_database {
|
||||
* @return array of arrays
|
||||
*/
|
||||
public function get_indexes($table) {
|
||||
$preflen = strlen($this->prefix);
|
||||
$indexes = array();
|
||||
$sql = "SHOW INDEXES FROM {$this->prefix}$table";
|
||||
$this->query_start($sql, null, SQL_QUERY_AUX);
|
||||
|
Loading…
x
Reference in New Issue
Block a user