mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-34010 improve mysqli engine diagnostics performace
This commit is contained in:
parent
445be5c6cd
commit
3c2fbdbb87
@ -235,15 +235,19 @@ class mysqli_native_moodle_database extends moodle_database {
|
||||
public function diagnose() {
|
||||
$sloppymyisamfound = false;
|
||||
$prefix = str_replace('_', '\\_', $this->prefix);
|
||||
$sql = "SELECT Engine FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = DATABASE() AND table_name LIKE BINARY '$prefix%'";
|
||||
$sql = "SELECT COUNT('x')
|
||||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE table_schema = DATABASE()
|
||||
AND table_name LIKE BINARY '$prefix%'
|
||||
AND Engine = 'MyISAM'";
|
||||
$this->query_start($sql, null, SQL_QUERY_AUX);
|
||||
$result = $this->mysqli->query($sql);
|
||||
$this->query_end($result);
|
||||
if ($result) {
|
||||
while ($arr = $result->fetch_assoc()) {
|
||||
if ($arr['Engine'] === 'MyISAM') {
|
||||
if ($arr = $result->fetch_assoc()) {
|
||||
$count = reset($arr);
|
||||
if ($count) {
|
||||
$sloppymyisamfound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$result->close();
|
||||
|
Loading…
x
Reference in New Issue
Block a user