Skip to content

Commit

Permalink
cli/zip: emit SQL table data using TSV by default
Browse files Browse the repository at this point in the history
This is a partial revert of 35738d4.

It changes the default value of the `--format` flag back from JSON to
TSV.

Release note (backward-incompatible change):
THIS RELEASE NOTE CANCELS THE CORRESPONDING PREVIOUS BACKWARD-INCOMPATIBLE CHANGE.
New behavior, compatible with previous versions of CockroachDB: the
command `cockroach debug zip` stores data retrieved from SQL tables in
the remote cluster using the TSV format by default.

Release note (cli change): The default value of the `--format`
parameter to `cockroach debug zip` is `tsv`, like other CLI commands
that can extract SQL data.
  • Loading branch information
knz committed Jul 25, 2023
1 parent 164c8cb commit 6a805f6
Show file tree
Hide file tree
Showing 12 changed files with 1,122 additions and 1,107 deletions.
304 changes: 152 additions & 152 deletions pkg/cli/testdata/zip/partial1

Large diffs are not rendered by default.

216 changes: 108 additions & 108 deletions pkg/cli/testdata/zip/partial1_excluded

Large diffs are not rendered by default.

216 changes: 108 additions & 108 deletions pkg/cli/testdata/zip/partial2

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pkg/cli/testdata/zip/specialnames
@@ -1,6 +1,6 @@
zip
----
[cluster] retrieving SQL data for crdb_internal.cluster_database_privileges... writing output: debug/crdb_internal.cluster_database_privileges.json... done
[cluster] retrieving SQL data for crdb_internal.table_indexes... writing output: debug/crdb_internal.table_indexes.json... done
[cluster] retrieving SQL data for system.database_role_settings... writing output: debug/system.database_role_settings.json... done
[cluster] retrieving SQL data for system.table_statistics... writing output: debug/system.table_statistics.json... done
[cluster] retrieving SQL data for crdb_internal.cluster_database_privileges... writing output: debug/crdb_internal.cluster_database_privileges.txt... done
[cluster] retrieving SQL data for crdb_internal.table_indexes... writing output: debug/crdb_internal.table_indexes.txt... done
[cluster] retrieving SQL data for system.database_role_settings... writing output: debug/system.database_role_settings.txt... done
[cluster] retrieving SQL data for system.table_statistics... writing output: debug/system.table_statistics.txt... done
172 changes: 86 additions & 86 deletions pkg/cli/testdata/zip/testzip

Large diffs are not rendered by default.

260 changes: 130 additions & 130 deletions pkg/cli/testdata/zip/testzip_concurrent

Large diffs are not rendered by default.

202 changes: 103 additions & 99 deletions pkg/cli/testdata/zip/testzip_external_process_virtualization

Large diffs are not rendered by default.

172 changes: 86 additions & 86 deletions pkg/cli/testdata/zip/testzip_include_range_info

Large diffs are not rendered by default.

378 changes: 193 additions & 185 deletions pkg/cli/testdata/zip/testzip_shared_process_virtualization

Large diffs are not rendered by default.

296 changes: 148 additions & 148 deletions pkg/cli/testdata/zip/unavailable

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/cli/zip.go
Expand Up @@ -245,7 +245,7 @@ func runDebugZip(cmd *cobra.Command, args []string) (retErr error) {

if !cmd.Flags().Changed(cliflags.TableDisplayFormat.Name) {
// Use a streaming format to avoid accumulating all rows in RAM.
sqlExecCtx.TableDisplayFormat = clisqlexec.TableDisplayJSON
sqlExecCtx.TableDisplayFormat = clisqlexec.TableDisplayTSV
}

zr.sqlOutputFilenameExtension = computeSQLOutputFilenameExtension(sqlExecCtx.TableDisplayFormat)
Expand Down
3 changes: 3 additions & 0 deletions pkg/cli/zip_tenant_test.go
Expand Up @@ -21,12 +21,15 @@ import (
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/cockroachdb/datadriven"
)

// TestTenantZip tests the operation of zip for a tenant server.
func TestTenantZip(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)

skip.UnderRace(t, "test too slow under race")

tenants := []struct {
Expand Down

0 comments on commit 6a805f6

Please sign in to comment.