* change upgrade for change engine.

This commit is contained in:
wangyidong
2022-08-10 09:43:40 +08:00
parent c3376a2116
commit 9959006f46
2 changed files with 17 additions and 4 deletions
+1 -1
View File
@@ -39,7 +39,7 @@
<button type='button' class='btn btn-link' data-toggle='modal' data-target='#copyProjectModal'><?php echo html::icon($lang->icons['copy'], 'muted') . ' ' . $lang->project->copy;?></button>
<?php else: ?>
<button type='button' class='btn btn-link' data-toggle='modal' data-target='#maxCopyProjectModal'><?php echo html::icon($lang->icons['copy'], 'muted') . ' ' . $lang->project->copy;?></button>
<?php endif; ?>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
+16 -3
View File
@@ -919,8 +919,7 @@ class upgrade extends control
$response['message'] = '';
$response['nextMessage'] = '';
$stmt = $this->dao->query("SHOW TABLE STATUS WHERE `Engine` is not null AND `Engine` = 'MyISAM'");
$stmt = $this->dao->query("SHOW TABLE STATUS WHERE `Engine` is not null AND `Engine` = 'MyISAM'");
$table = $stmt->fetch();
if(empty($table))
{
@@ -939,14 +938,28 @@ class upgrade extends control
$tableName = $table->Name;
$response['table'] = $tableName;
/* Check process this table or not. */
$dbProcesses = $this->dao->query("SHOW PROCESSLIST")->fetchAll();
foreach($dbProcesses as $dbProcess)
{
if($dbProcess->db != $this->config->db->name) continue;
if(strpos($dbProcess->Info, " `{$tableName}` "))
{
$response['message'] = sprintf($this->lang->upgrade->changingTable, $response['table']);
return print(json_encode($response));
}
}
if($nextTable)
{
$response['next'] = $nextTable->Name;
$response['next'] = $nextTable->Name;
if($response['next']) $response['nextMessage'] = sprintf($this->lang->upgrade->changingTable, $response['next']);
}
if(stripos($tableName, 'searchindex') !== false)
{
/* Change fulltext index. */
$stmt = $this->dao->query("show index from `$tableName`");
$indexes = array();
while($index = $stmt->fetch())