Merge pull request #34275 from ClickHouse/fix-progress-bar

Fix progress bar width
This commit is contained in:
Maksim Kita 2022-02-03 11:21:08 +01:00 committed by GitHub
commit f4423937bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 1 deletions

View File

@ -243,7 +243,7 @@ void ProgressIndication::writeProgress()
if (width_of_progress_bar > 0)
{
size_t bar_width = UnicodeBar::getWidth(current_count, 0, max_count, width_of_progress_bar);
double bar_width = UnicodeBar::getWidth(current_count, 0, max_count, width_of_progress_bar);
std::string bar = UnicodeBar::render(bar_width);
/// Render profiling_msg at left on top of the progress bar.

View File

@ -0,0 +1,20 @@
#!/usr/bin/expect -f
# Tags: no-fasttest
log_user 0
set timeout 60
match_max 100000
spawn clickhouse-local --progress --query "SELECT sum(number % 100000000 = 12345678 ? sleep(0.1) : 1) FROM numbers(1000000000)"
expect {
"▏" { exit 0 }
"▎" { exit 0 }
"▍" { exit 0 }
"▌" { exit 0 }
"▋" { exit 0 }
"▋" { exit 0 }
"▊" { exit 0 }
"▉" { exit 0 }
timeout { exit 1 }
}