Skip to content

Commit

Permalink
Merge pull request ClickHouse#34275 from ClickHouse/fix-progress-bar
Browse files Browse the repository at this point in the history
Fix progress bar width
  • Loading branch information
kitaisreal authored Feb 3, 2022
2 parents 9face9b + 6d47031 commit f442393
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Common/ProgressIndication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Empty file.
20 changes: 20 additions & 0 deletions tests/queries/0_stateless/02204_fractional_progress_bar.sh
Original file line number Diff line number Diff line change
@@ -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 }
}

0 comments on commit f442393

Please sign in to comment.