diff --git a/go/cmd/dolt/cli/stdio.go b/go/cmd/dolt/cli/stdio.go index 601ffd4c9a..eb12870b33 100644 --- a/go/cmd/dolt/cli/stdio.go +++ b/go/cmd/dolt/cli/stdio.go @@ -176,7 +176,7 @@ func DeleteAndPrint(prevMsgLen int, msg string) int { } } - Print(string(backspacesAndMsg)) + PrintErr(string(backspacesAndMsg)) return msgLen } diff --git a/go/cmd/dolt/commands/sql.go b/go/cmd/dolt/commands/sql.go index 914141da16..4e8d251d37 100644 --- a/go/cmd/dolt/commands/sql.go +++ b/go/cmd/dolt/commands/sql.go @@ -1240,7 +1240,7 @@ func (f *fileReadProgress) printNewLineIfNeeded() { func updateFileReadProgressOutput() { if fileReadProg == nil { // this should not happen, but sanity check - cli.Println("No file is being processed.") + cli.PrintErrln("No file is being processed.") } // batch can be writing to the line, so print new line. batchEditStats.printNewLineIfNeeded() diff --git a/integration-tests/bats/sql.bats b/integration-tests/bats/sql.bats index 65815f7774..395a4cedf3 100755 --- a/integration-tests/bats/sql.bats +++ b/integration-tests/bats/sql.bats @@ -1054,6 +1054,30 @@ SQL [ "${#lines[@]}" -eq 0 ] } +@test "sql: parquet file output separates output and status messages" { + dolt sql < in.sql + + dolt sql -r parquet -f in.sql > out.parquet 2> out.txt + + run cat out.parquet + [ $status -eq 0 ] + [[ ! "$output" =~ "Processed" ]] || false + + run cat out.txt + [ "$status" -eq 0 ] + [[ "$output" =~ "Processed" ]] || false +} + @test "sql: output for escaped longtext exports properly" { dolt sql <