summaryrefslogtreecommitdiff
path: root/win
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-11-19 19:58:27 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-11-19 20:22:33 +0200
commitdde2ca4aa108b611b5fdfc970146b28461ef08bf (patch)
tree08f90bb9d54413af23230ccf99f18391596afa34 /win
parentb5ac863f1494920b5e7035c9dfa0ebfdaa50a15d (diff)
parentfd58bb71e22196c3c5e8d20b92bce6f343f1dea1 (diff)
downloadmariadb-git-dde2ca4aa108b611b5fdfc970146b28461ef08bf.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'win')
-rw-r--r--win/upgrade_wizard/upgradeDlg.cpp27
1 files changed, 14 insertions, 13 deletions
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
{