Skip to content

Commit 61fe305

Browse files
authored
fix: disable progress mark during streaming output (#432)
Progress marks (spinner) were interfering with streaming output, causing control characters to appear in CSV/XML/HTML output. This fix disables progress marks when streaming mode is active. Fixes #431
1 parent 74e5bb5 commit 61fe305

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cli.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,16 @@ func (c *Cli) executeStatement(ctx context.Context, stmt Statement, interactive
617617
// Statements that have their own progress displays (like DDL operations or SHOW OPERATION SYNC)
618618
// are excluded to avoid conflicting progress indicators.
619619
func (c *Cli) setupProgressMark(stmt Statement, w io.Writer) func() {
620+
// Check if this is a SELECT statement that might use streaming
621+
if _, ok := stmt.(*SelectStatement); ok {
622+
// Check if streaming will be used
623+
if shouldUseStreaming(c.SystemVariables) {
624+
// Disable progress mark for streaming output to prevent
625+
// control character interference (Issue #431)
626+
return func() {}
627+
}
628+
}
629+
620630
switch stmt.(type) {
621631
case *DdlStatement, *SyncProtoStatement, *BulkDdlStatement, *RunBatchStatement, *ExitStatement, *ShowOperationStatement:
622632
return func() {}

0 commit comments

Comments
 (0)