From a93ac8d95fd504412bd819325bfaa816e317786c Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 13 Nov 2018 13:10:32 +0100 Subject: MDEV-16448 mysql_upgrade_service remove my.ini variables that are no more valid MDEV-16447 incorporate Innodb slow shutdown into mysql_upgrade_service.exe --- win/upgrade_wizard/upgradeDlg.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'win') diff --git a/win/upgrade_wizard/upgradeDlg.cpp b/win/upgrade_wizard/upgradeDlg.cpp index d996c0ebe5d..793e89886d6 100644 --- a/win/upgrade_wizard/upgradeDlg.cpp +++ b/win/upgrade_wizard/upgradeDlg.cpp @@ -422,21 +422,22 @@ void CUpgradeDlg::UpgradeOneService(const string& servicename) { allMessages[lines%MAX_MESSAGES] = output_line; m_DataDir.SetWindowText(allMessages[lines%MAX_MESSAGES].c_str()); - output_line.clear(); lines++; - /* - Updating progress dialog.There are currently 9 messages from - mysql_upgrade_service (actually it also writes Phase N/M but - we do not parse the output right now). - */ -#define EXPRECTED_MYSQL_UPGRADE_MESSAGES 9 - - int stepsTotal= m_ProgressTotal*EXPRECTED_MYSQL_UPGRADE_MESSAGES; - int stepsCurrent= m_ProgressCurrent*EXPRECTED_MYSQL_UPGRADE_MESSAGES - + lines; - int percentDone= stepsCurrent*100/stepsTotal; - m_Progress.SetPos(percentDone); + int curPhase, numPhases; + + // Parse output line to update progress indicator + if (strncmp(output_line.c_str(),"Phase ",6) == 0 && + sscanf(output_line.c_str() +6 ,"%d/%d",&curPhase,&numPhases) == 2 + && numPhases > 0 ) + { + int stepsTotal= m_ProgressTotal*numPhases; + int stepsCurrent= m_ProgressCurrent*numPhases+ curPhase; + int percentDone= stepsCurrent*100/stepsTotal; + m_Progress.SetPos(percentDone); + m_Progress.SetPos(stepsCurrent * 100 / stepsTotal); + } + output_line.clear(); } else { -- cgit v1.2.1