From 52150d35a75986ebe6897e5480f5d7385e9a8b92 Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Fri, 20 Jan 2023 11:04:56 -0500 Subject: [PATCH 1/5] roachprod: add tenant param to InternalPGURL and ExternalPGURL methods This patch will make it easier for roachtest writers to establish a sql connection with an in-process tenant. Epic: none Release note: None --- pkg/cmd/roachtest/cluster.go | 31 ++++++++----------- .../roachtest/cluster/cluster_interface.go | 4 +-- pkg/cmd/roachtest/tests/cluster_to_cluster.go | 2 +- pkg/cmd/roachtest/tests/copyfrom.go | 2 +- pkg/cmd/roachtest/tests/gossip.go | 2 +- pkg/cmd/roachtest/tests/multitenant_utils.go | 2 +- pkg/cmd/roachtest/tests/tpcdsvec.go | 2 +- 7 files changed, 20 insertions(+), 25 deletions(-) diff --git a/pkg/cmd/roachtest/cluster.go b/pkg/cmd/roachtest/cluster.go index 4654882c4fd4..0b69d0194438 100644 --- a/pkg/cmd/roachtest/cluster.go +++ b/pkg/cmd/roachtest/cluster.go @@ -2104,12 +2104,11 @@ func (c *clusterImpl) loggerForCmd( // external IP address. In general, inter-cluster communication and should use // internal IPs and communication from a test driver to nodes in a cluster // should use external IPs. -func (c *clusterImpl) pgURLErr( - ctx context.Context, l *logger.Logger, node option.NodeListOption, external bool, -) ([]string, error) { +func (c *clusterImpl) pgURLErr(ctx context.Context, l *logger.Logger, node option.NodeListOption, external bool, tenant string) ([]string, error) { urls, err := roachprod.PgURL(ctx, l, c.MakeNodes(node), c.localCertsDir, roachprod.PGURLOptions{ - External: external, - Secure: c.localCertsDir != ""}) + External: external, + Secure: c.localCertsDir != "", + TenantName: tenant}) if err != nil { return nil, err } @@ -2120,20 +2119,16 @@ func (c *clusterImpl) pgURLErr( } // InternalPGUrl returns the internal Postgres endpoint for the specified nodes. -func (c *clusterImpl) InternalPGUrl( - ctx context.Context, l *logger.Logger, node option.NodeListOption, -) ([]string, error) { - return c.pgURLErr(ctx, l, node, false /* external */) +func (c *clusterImpl) InternalPGUrl(ctx context.Context, l *logger.Logger, node option.NodeListOption, tenant string) ([]string, error) { + return c.pgURLErr(ctx, l, node, false, tenant) } // Silence unused warning. var _ = (&clusterImpl{}).InternalPGUrl // ExternalPGUrl returns the external Postgres endpoint for the specified nodes. -func (c *clusterImpl) ExternalPGUrl( - ctx context.Context, l *logger.Logger, node option.NodeListOption, -) ([]string, error) { - return c.pgURLErr(ctx, l, node, true /* external */) +func (c *clusterImpl) ExternalPGUrl(ctx context.Context, l *logger.Logger, node option.NodeListOption, tenant string) ([]string, error) { + return c.pgURLErr(ctx, l, node, true, tenant) } func addrToAdminUIAddr(c *clusterImpl, addr string) (string, error) { @@ -2223,7 +2218,7 @@ func (c *clusterImpl) InternalAddr( ctx context.Context, l *logger.Logger, node option.NodeListOption, ) ([]string, error) { var addrs []string - urls, err := c.pgURLErr(ctx, l, node, false /* external */) + urls, err := c.pgURLErr(ctx, l, node, false, "") if err != nil { return nil, err } @@ -2262,7 +2257,7 @@ func (c *clusterImpl) ExternalAddr( ctx context.Context, l *logger.Logger, node option.NodeListOption, ) ([]string, error) { var addrs []string - urls, err := c.pgURLErr(ctx, l, node, true /* external */) + urls, err := c.pgURLErr(ctx, l, node, true, "") if err != nil { return nil, err } @@ -2300,7 +2295,7 @@ var _ = (&clusterImpl{}).ExternalIP // Conn returns a SQL connection to the specified node. func (c *clusterImpl) Conn(ctx context.Context, l *logger.Logger, node int) *gosql.DB { - urls, err := c.ExternalPGUrl(ctx, l, c.Node(node)) + urls, err := c.ExternalPGUrl(ctx, l, c.Node(node), "") if err != nil { c.t.Fatal(err) } @@ -2313,7 +2308,7 @@ func (c *clusterImpl) Conn(ctx context.Context, l *logger.Logger, node int) *gos // ConnE returns a SQL connection to the specified node. func (c *clusterImpl) ConnE(ctx context.Context, l *logger.Logger, node int) (*gosql.DB, error) { - urls, err := c.ExternalPGUrl(ctx, l, c.Node(node)) + urls, err := c.ExternalPGUrl(ctx, l, c.Node(node), "") if err != nil { return nil, err } @@ -2328,7 +2323,7 @@ func (c *clusterImpl) ConnE(ctx context.Context, l *logger.Logger, node int) (*g func (c *clusterImpl) ConnEAsUser( ctx context.Context, l *logger.Logger, node int, user string, ) (*gosql.DB, error) { - urls, err := c.ExternalPGUrl(ctx, l, c.Node(node)) + urls, err := c.ExternalPGUrl(ctx, l, c.Node(node), "") if err != nil { return nil, err } diff --git a/pkg/cmd/roachtest/cluster/cluster_interface.go b/pkg/cmd/roachtest/cluster/cluster_interface.go index eb3ecfe4af5c..6b3037999454 100644 --- a/pkg/cmd/roachtest/cluster/cluster_interface.go +++ b/pkg/cmd/roachtest/cluster/cluster_interface.go @@ -66,8 +66,8 @@ type Cluster interface { // SQL connection strings. - InternalPGUrl(ctx context.Context, l *logger.Logger, node option.NodeListOption) ([]string, error) - ExternalPGUrl(ctx context.Context, l *logger.Logger, node option.NodeListOption) ([]string, error) + InternalPGUrl(ctx context.Context, l *logger.Logger, node option.NodeListOption, tenant string) ([]string, error) + ExternalPGUrl(ctx context.Context, l *logger.Logger, node option.NodeListOption, tenant string) ([]string, error) // SQL clients to nodes. diff --git a/pkg/cmd/roachtest/tests/cluster_to_cluster.go b/pkg/cmd/roachtest/tests/cluster_to_cluster.go index d3ff40e469dd..cd3a035a2bd3 100644 --- a/pkg/cmd/roachtest/tests/cluster_to_cluster.go +++ b/pkg/cmd/roachtest/tests/cluster_to_cluster.go @@ -208,7 +208,7 @@ func setupC2C( srcNode := srcCluster.RandNode() destNode := dstCluster.RandNode() - addr, err := c.ExternalPGUrl(ctx, t.L(), srcNode) + addr, err := c.ExternalPGUrl(ctx, t.L(), srcNode, "") require.NoError(t, err) srcDB := c.Conn(ctx, t.L(), srcNode[0]) diff --git a/pkg/cmd/roachtest/tests/copyfrom.go b/pkg/cmd/roachtest/tests/copyfrom.go index 64e1ad0608fe..11c28df1349e 100644 --- a/pkg/cmd/roachtest/tests/copyfrom.go +++ b/pkg/cmd/roachtest/tests/copyfrom.go @@ -130,7 +130,7 @@ func runCopyFromCRDB(ctx context.Context, t test.Test, c cluster.Cluster, sf int stmt := fmt.Sprintf("ALTER ROLE ALL SET copy_from_atomic_enabled = %t", atomic) _, err = db.ExecContext(ctx, stmt) require.NoError(t, err) - urls, err := c.InternalPGUrl(ctx, t.L(), c.Node(1)) + urls, err := c.InternalPGUrl(ctx, t.L(), c.Node(1), "") require.NoError(t, err) m := c.NewMonitor(ctx, c.All()) m.Go(func(ctx context.Context) error { diff --git a/pkg/cmd/roachtest/tests/gossip.go b/pkg/cmd/roachtest/tests/gossip.go index cf8bc936a1f6..c479855e5736 100644 --- a/pkg/cmd/roachtest/tests/gossip.go +++ b/pkg/cmd/roachtest/tests/gossip.go @@ -455,7 +455,7 @@ SELECT count(replicas) if i != 1 { return c.Conn(ctx, l, i) } - urls, err := c.ExternalPGUrl(ctx, l, c.Node(1)) + urls, err := c.ExternalPGUrl(ctx, l, c.Node(1), "") if err != nil { t.Fatal(err) } diff --git a/pkg/cmd/roachtest/tests/multitenant_utils.go b/pkg/cmd/roachtest/tests/multitenant_utils.go index e3325dd6a5e6..c57b102b92bc 100644 --- a/pkg/cmd/roachtest/tests/multitenant_utils.go +++ b/pkg/cmd/roachtest/tests/multitenant_utils.go @@ -204,7 +204,7 @@ func (tn *tenantNode) start(ctx context.Context, t test.Test, c cluster.Cluster, extraArgs..., ) - externalUrls, err := c.ExternalPGUrl(ctx, t.L(), c.Node(tn.node)) + externalUrls, err := c.ExternalPGUrl(ctx, t.L(), c.Node(tn.node), "") require.NoError(t, err) u, err := url.Parse(externalUrls[0]) require.NoError(t, err) diff --git a/pkg/cmd/roachtest/tests/tpcdsvec.go b/pkg/cmd/roachtest/tests/tpcdsvec.go index 789b539324c1..e6c1f26bc983 100644 --- a/pkg/cmd/roachtest/tests/tpcdsvec.go +++ b/pkg/cmd/roachtest/tests/tpcdsvec.go @@ -91,7 +91,7 @@ func registerTPCDSVec(r registry.Registry) { // We additionally open fresh connections for each query. setStmtTimeout := fmt.Sprintf("SET statement_timeout='%s';", timeout) firstNode := c.Node(1) - urls, err := c.ExternalPGUrl(ctx, t.L(), firstNode) + urls, err := c.ExternalPGUrl(ctx, t.L(), firstNode, "") if err != nil { t.Fatal(err) } From e58a791da1c25c696bcda0f6a70ef1d87468d3c8 Mon Sep 17 00:00:00 2001 From: Yahor Yuzefovich Date: Tue, 24 Jan 2023 10:53:46 -0800 Subject: [PATCH 2/5] builtins: add non-null check to a recently merged builtin overload Release note: None --- pkg/sql/logictest/testdata/logic_test/crdb_internal | 7 ++++++- pkg/sql/sem/builtins/builtins.go | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/sql/logictest/testdata/logic_test/crdb_internal b/pkg/sql/logictest/testdata/logic_test/crdb_internal index 6454c1860ba3..665948282b39 100644 --- a/pkg/sql/logictest/testdata/logic_test/crdb_internal +++ b/pkg/sql/logictest/testdata/logic_test/crdb_internal @@ -1156,12 +1156,17 @@ statement ok SELECT crdb_internal.probe_ranges(INTERVAL '1000ms', 'write') # Regression test for not handling NULL values correctly by an internal builtin -# (#82056). +# (#82056 and #95671). query I SELECT crdb_internal.num_inverted_index_entries(NULL::STRING, 0) ---- 0 +query I +SELECT crdb_internal.num_inverted_index_entries(NULL::TSVECTOR, NULL::INT8) +---- +0 + # Exercise unsafe gossip builtin functions. query B SELECT crdb_internal.unsafe_clear_gossip_info('unknown key') diff --git a/pkg/sql/sem/builtins/builtins.go b/pkg/sql/sem/builtins/builtins.go index acb682d1e16c..456ceb5ef0c4 100644 --- a/pkg/sql/sem/builtins/builtins.go +++ b/pkg/sql/sem/builtins/builtins.go @@ -5952,6 +5952,9 @@ value if you rely on the HLC for accuracy.`, }, ReturnType: tree.FixedReturnType(types.Int), Fn: func(ctx context.Context, evalCtx *eval.Context, args tree.Datums) (tree.Datum, error) { + if args[0] == tree.DNull { + return tree.DZero, nil + } val := args[0].(*tree.DTSVector) return tree.NewDInt(tree.DInt(len(val.TSVector))), nil }, From f2bbad960cd3c9e0a46633374050fb32bb648137 Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Tue, 24 Jan 2023 15:57:59 -0500 Subject: [PATCH 3/5] roachprod: add functional connectionOptions to cluster.Conn methods This patch makes it easier to add various options to the cluster.Conn methods, such as easily allowing a roachtest writer to open a sql connection to an in process tenant or as a specific user. Epic: None Release note: None --- pkg/cmd/roachtest/cluster.go | 59 +++++++++---------- .../roachtest/cluster/cluster_interface.go | 6 +- pkg/cmd/roachtest/option/BUILD.bazel | 1 + .../roachtest/option/connection_options.go | 28 +++++++++ pkg/cmd/roachtest/tests/gossip.go | 4 +- 5 files changed, 62 insertions(+), 36 deletions(-) create mode 100644 pkg/cmd/roachtest/option/connection_options.go diff --git a/pkg/cmd/roachtest/cluster.go b/pkg/cmd/roachtest/cluster.go index 0b69d0194438..b6629203a625 100644 --- a/pkg/cmd/roachtest/cluster.go +++ b/pkg/cmd/roachtest/cluster.go @@ -2104,7 +2104,9 @@ func (c *clusterImpl) loggerForCmd( // external IP address. In general, inter-cluster communication and should use // internal IPs and communication from a test driver to nodes in a cluster // should use external IPs. -func (c *clusterImpl) pgURLErr(ctx context.Context, l *logger.Logger, node option.NodeListOption, external bool, tenant string) ([]string, error) { +func (c *clusterImpl) pgURLErr( + ctx context.Context, l *logger.Logger, node option.NodeListOption, external bool, tenant string, +) ([]string, error) { urls, err := roachprod.PgURL(ctx, l, c.MakeNodes(node), c.localCertsDir, roachprod.PGURLOptions{ External: external, Secure: c.localCertsDir != "", @@ -2119,7 +2121,9 @@ func (c *clusterImpl) pgURLErr(ctx context.Context, l *logger.Logger, node optio } // InternalPGUrl returns the internal Postgres endpoint for the specified nodes. -func (c *clusterImpl) InternalPGUrl(ctx context.Context, l *logger.Logger, node option.NodeListOption, tenant string) ([]string, error) { +func (c *clusterImpl) InternalPGUrl( + ctx context.Context, l *logger.Logger, node option.NodeListOption, tenant string, +) ([]string, error) { return c.pgURLErr(ctx, l, node, false, tenant) } @@ -2127,7 +2131,9 @@ func (c *clusterImpl) InternalPGUrl(ctx context.Context, l *logger.Logger, node var _ = (&clusterImpl{}).InternalPGUrl // ExternalPGUrl returns the external Postgres endpoint for the specified nodes. -func (c *clusterImpl) ExternalPGUrl(ctx context.Context, l *logger.Logger, node option.NodeListOption, tenant string) ([]string, error) { +func (c *clusterImpl) ExternalPGUrl( + ctx context.Context, l *logger.Logger, node option.NodeListOption, tenant string, +) ([]string, error) { return c.pgURLErr(ctx, l, node, true, tenant) } @@ -2294,12 +2300,10 @@ func (c *clusterImpl) ExternalIP( var _ = (&clusterImpl{}).ExternalIP // Conn returns a SQL connection to the specified node. -func (c *clusterImpl) Conn(ctx context.Context, l *logger.Logger, node int) *gosql.DB { - urls, err := c.ExternalPGUrl(ctx, l, c.Node(node), "") - if err != nil { - c.t.Fatal(err) - } - db, err := gosql.Open("postgres", urls[0]) +func (c *clusterImpl) Conn( + ctx context.Context, l *logger.Logger, node int, opts ...func(*option.ConnOption), +) *gosql.DB { + db, err := c.ConnE(ctx, l, node, opts...) if err != nil { c.t.Fatal(err) } @@ -2307,33 +2311,28 @@ func (c *clusterImpl) Conn(ctx context.Context, l *logger.Logger, node int) *gos } // ConnE returns a SQL connection to the specified node. -func (c *clusterImpl) ConnE(ctx context.Context, l *logger.Logger, node int) (*gosql.DB, error) { - urls, err := c.ExternalPGUrl(ctx, l, c.Node(node), "") - if err != nil { - return nil, err - } - db, err := gosql.Open("postgres", urls[0]) - if err != nil { - return nil, err - } - return db, nil -} - -// ConnEAsUser returns a SQL connection to the specified node as a specific user -func (c *clusterImpl) ConnEAsUser( - ctx context.Context, l *logger.Logger, node int, user string, +func (c *clusterImpl) ConnE( + ctx context.Context, l *logger.Logger, node int, opts ...func(*option.ConnOption), ) (*gosql.DB, error) { - urls, err := c.ExternalPGUrl(ctx, l, c.Node(node), "") + + connOptions := &option.ConnOption{} + for _, opt := range opts { + opt(connOptions) + } + urls, err := c.ExternalPGUrl(ctx, l, c.Node(node), connOptions.TenantName) if err != nil { return nil, err } - u, err := url.Parse(urls[0]) - if err != nil { - return nil, err + dataSourceName := urls[0] + if connOptions.User != "" { + u, err := url.Parse(urls[0]) + if err != nil { + return nil, err + } + u.User = url.User(connOptions.User) + dataSourceName = u.String() } - u.User = url.User(user) - dataSourceName := u.String() db, err := gosql.Open("postgres", dataSourceName) if err != nil { return nil, err diff --git a/pkg/cmd/roachtest/cluster/cluster_interface.go b/pkg/cmd/roachtest/cluster/cluster_interface.go index 6b3037999454..1f62f28fa75c 100644 --- a/pkg/cmd/roachtest/cluster/cluster_interface.go +++ b/pkg/cmd/roachtest/cluster/cluster_interface.go @@ -70,10 +70,8 @@ type Cluster interface { ExternalPGUrl(ctx context.Context, l *logger.Logger, node option.NodeListOption, tenant string) ([]string, error) // SQL clients to nodes. - - Conn(ctx context.Context, l *logger.Logger, node int) *gosql.DB - ConnE(ctx context.Context, l *logger.Logger, node int) (*gosql.DB, error) - ConnEAsUser(ctx context.Context, l *logger.Logger, node int, user string) (*gosql.DB, error) + Conn(ctx context.Context, l *logger.Logger, node int, opts ...func(*option.ConnOption)) *gosql.DB + ConnE(ctx context.Context, l *logger.Logger, node int, opts ...func(*option.ConnOption)) (*gosql.DB, error) // URLs for the Admin UI. diff --git a/pkg/cmd/roachtest/option/BUILD.bazel b/pkg/cmd/roachtest/option/BUILD.bazel index f3aed4d779dd..97be2b00fa75 100644 --- a/pkg/cmd/roachtest/option/BUILD.bazel +++ b/pkg/cmd/roachtest/option/BUILD.bazel @@ -4,6 +4,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "option", srcs = [ + "connection_options.go", "node_list_option.go", "node_lister.go", "option_interface.go", diff --git a/pkg/cmd/roachtest/option/connection_options.go b/pkg/cmd/roachtest/option/connection_options.go new file mode 100644 index 000000000000..1633e8083823 --- /dev/null +++ b/pkg/cmd/roachtest/option/connection_options.go @@ -0,0 +1,28 @@ +// Copyright 2023 The Cockroach Authors. +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package option + +type ConnOption struct { + User string + TenantName string +} + +func User(user string) func(*ConnOption) { + return func(option *ConnOption) { + option.User = user + } +} + +func TenantName(tenantName string) func(*ConnOption) { + return func(option *ConnOption) { + option.TenantName = tenantName + } +} diff --git a/pkg/cmd/roachtest/tests/gossip.go b/pkg/cmd/roachtest/tests/gossip.go index c479855e5736..a2053318cb85 100644 --- a/pkg/cmd/roachtest/tests/gossip.go +++ b/pkg/cmd/roachtest/tests/gossip.go @@ -153,7 +153,7 @@ SELECT node_id type gossipUtil struct { waitTime time.Duration urlMap map[int]string - conn func(ctx context.Context, l *logger.Logger, i int) *gosql.DB + conn func(ctx context.Context, l *logger.Logger, i int, opts ...func(*option.ConnOption)) *gosql.DB } func newGossipUtil(ctx context.Context, t test.Test, c cluster.Cluster) *gossipUtil { @@ -451,7 +451,7 @@ SELECT count(replicas) // current infrastructure which doesn't know about cockroach nodes started on // non-standard ports. g := newGossipUtil(ctx, t, c) - g.conn = func(ctx context.Context, l *logger.Logger, i int) *gosql.DB { + g.conn = func(ctx context.Context, l *logger.Logger, i int, opts ...func(*option.ConnOption)) *gosql.DB { if i != 1 { return c.Conn(ctx, l, i) } From 93fbfc33eb6b523f6107d6672b5ec98b12ae4d9e Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Tue, 24 Jan 2023 16:07:59 -0500 Subject: [PATCH 4/5] c2c: create role within tenant in roachtest Release note: None Epic: None --- pkg/cmd/roachtest/tests/cluster_to_cluster.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/roachtest/tests/cluster_to_cluster.go b/pkg/cmd/roachtest/tests/cluster_to_cluster.go index cd3a035a2bd3..7dc2ca6216d6 100644 --- a/pkg/cmd/roachtest/tests/cluster_to_cluster.go +++ b/pkg/cmd/roachtest/tests/cluster_to_cluster.go @@ -248,8 +248,11 @@ func setupC2C( 10000000000, now(), 0);`, srcTenantInfo.ID) createSystemRole(t, srcTenantInfo.name+" system tenant", srcTenantInfo.sql) - createSystemRole(t, destTenantInfo.name+" system tenant", destTenantInfo.sql) + createSystemRole(t, srcTenantInfo.name+" system tenant", destTenantInfo.sql) + srcTenantDB := c.Conn(ctx, t.L(), srcNode[0], option.TenantName(srcTenantName)) + srcTenantSQL := sqlutils.MakeSQLRunner(srcTenantDB) + createSystemRole(t, destTenantInfo.name+" app tenant", srcTenantSQL) return &c2cSetup{ src: srcTenantInfo, dst: destTenantInfo, From e333a39c7e106f11c7f87968d6b37e9b5dee0c95 Mon Sep 17 00:00:00 2001 From: Marius Posta Date: Mon, 23 Jan 2023 13:49:13 -0500 Subject: [PATCH 5/5] schemachanger: move event logging to scbuild and scrun Previously, the declarative schema changer would write events to the event log by means of operations planned in a mutation stage. This commit makes it so that the following schema change events are written by the schema change job: - reverse_schema_change, - finish_schema_change, - finish_schema_change_rollback. The remaining schema change events are written at build-time, which is in line with the legacy schema changer which does this in the planNodes' startExec method. This makes for simpler declarative schema changer operation generation logic and much simpler plans. This comes at the expense of some transactionality, but it appears that this behaviour was not expected in any case. Fixes #95779. Release note: None --- .../testdata/end_to_end/create_index | 17 +- .../drop_database_multiregion_primary_region | 17 +- .../end_to_end/drop_table_multiregion | 13 +- .../drop_table_multiregion_primary_region | 14 +- .../testdata/explain/create_index | 5 +- .../explain/create_index.rollback_5_of_7 | 3 +- .../explain/create_index.rollback_6_of_7 | 3 +- .../explain/create_index.rollback_7_of_7 | 3 +- .../drop_database_multiregion_primary_region | 7 +- .../testdata/explain/drop_table_multiregion | 3 +- .../drop_table_multiregion_primary_region | 3 +- .../testdata/explain_verbose/create_index | 26 +- .../create_index.rollback_5_of_7 | 20 +- .../create_index.rollback_6_of_7 | 20 +- .../create_index.rollback_7_of_7 | 20 +- .../drop_database_multiregion_primary_region | 114 +--- .../explain_verbose/drop_table_multiregion | 50 +- .../drop_table_multiregion_primary_region | 46 +- pkg/sql/event_log.go | 30 +- .../testdata/logic_test/crdb_internal_catalog | 4 +- .../logictest/testdata/logic_test/event_log | 32 +- .../testdata/logic_test/new_schema_changer | 7 +- pkg/sql/pgwire/testdata/pgtest/notice | 2 +- pkg/sql/schema_change_plan_node.go | 46 +- pkg/sql/schemachanger/scbuild/BUILD.bazel | 4 +- pkg/sql/schemachanger/scbuild/build.go | 26 +- .../schemachanger/scbuild/builder_state.go | 20 + pkg/sql/schemachanger/scbuild/builder_test.go | 4 +- pkg/sql/schemachanger/scbuild/dependencies.go | 17 + pkg/sql/schemachanger/scbuild/event_log.go | 355 ++++++++++++ .../schemachanger/scbuild/event_log_state.go | 44 -- .../scbuildstmt/alter_table_add_column.go | 1 + .../scbuildstmt/alter_table_add_constraint.go | 13 +- .../alter_table_alter_primary_key.go | 1 + .../scbuildstmt/alter_table_drop_column.go | 1 + .../internal/scbuildstmt/comment_on.go | 12 + .../internal/scbuildstmt/create_index.go | 1 + .../internal/scbuildstmt/dependencies.go | 5 + .../internal/scbuildstmt/drop_database.go | 2 + .../internal/scbuildstmt/drop_index.go | 15 +- .../internal/scbuildstmt/drop_schema.go | 1 + .../internal/scbuildstmt/drop_sequence.go | 1 + .../internal/scbuildstmt/drop_table.go | 1 + .../scbuild/internal/scbuildstmt/drop_type.go | 1 + .../scbuild/internal/scbuildstmt/drop_view.go | 1 + pkg/sql/schemachanger/scdeps/build_deps.go | 8 + pkg/sql/schemachanger/scdeps/exec_deps.go | 11 - pkg/sql/schemachanger/scdeps/run_deps.go | 7 +- .../scdeps/sctestdeps/test_deps.go | 56 +- .../scdeps/sctestutils/sctestutils.go | 11 +- pkg/sql/schemachanger/scexec/BUILD.bazel | 2 - pkg/sql/schemachanger/scexec/dependencies.go | 18 - pkg/sql/schemachanger/scexec/exec_mutation.go | 118 ---- .../scexec/executor_external_test.go | 25 +- .../scexec/mocks_generated_test.go | 14 - .../scexec/scmutationexec/BUILD.bazel | 3 - .../scexec/scmutationexec/column.go | 26 +- .../scexec/scmutationexec/eventlog.go | 222 -------- .../scexec/scmutationexec/helpers.go | 33 +- .../scexec/scmutationexec/index.go | 35 +- pkg/sql/schemachanger/scexec/testing_knobs.go | 7 +- pkg/sql/schemachanger/schemachanger_test.go | 13 + pkg/sql/schemachanger/scjob/job.go | 15 +- .../schemachanger/scop/generate_visitor.go | 6 - pkg/sql/schemachanger/scop/mutation.go | 21 - .../scop/mutation_visitor_generated.go | 6 - .../scplan/internal/opgen/op_funcs.go | 32 -- .../scplan/internal/opgen/opgen_alias_type.go | 3 - .../scplan/internal/opgen/opgen_column.go | 16 +- .../internal/opgen/opgen_column_comment.go | 6 - .../internal/opgen/opgen_composite_type.go | 3 - .../opgen/opgen_constraint_comment.go | 6 - .../scplan/internal/opgen/opgen_database.go | 3 - .../internal/opgen/opgen_database_comment.go | 6 - .../scplan/internal/opgen/opgen_enum_type.go | 3 - .../internal/opgen/opgen_index_comment.go | 6 - .../internal/opgen/opgen_primary_index.go | 10 +- .../scplan/internal/opgen/opgen_schema.go | 3 - .../internal/opgen/opgen_schema_comment.go | 3 - .../internal/opgen/opgen_secondary_index.go | 16 +- .../scplan/internal/opgen/opgen_sequence.go | 3 - .../scplan/internal/opgen/opgen_table.go | 3 - .../internal/opgen/opgen_table_comment.go | 6 - .../scplan/internal/opgen/opgen_view.go | 3 - .../scplan/testdata/alter_table_add_column | 341 +----------- .../testdata/alter_table_alter_primary_key | 58 +- .../scplan/testdata/alter_table_drop_column | 248 +-------- .../schemachanger/scplan/testdata/comment_on | 185 +------ .../scplan/testdata/create_index | 48 +- .../scplan/testdata/drop_database | 510 +----------------- .../schemachanger/scplan/testdata/drop_index | 252 +-------- .../scplan/testdata/drop_owned_by | 285 +--------- .../schemachanger/scplan/testdata/drop_schema | 403 +------------- .../scplan/testdata/drop_sequence | 34 +- .../schemachanger/scplan/testdata/drop_table | 257 +-------- .../schemachanger/scplan/testdata/drop_type | 96 +--- .../schemachanger/scplan/testdata/drop_view | 317 +---------- pkg/sql/schemachanger/scrun/BUILD.bazel | 5 +- pkg/sql/schemachanger/scrun/dependencies.go | 15 +- .../schemachanger/scrun/make_state_test.go | 34 +- pkg/sql/schemachanger/scrun/scrun.go | 189 ++++--- pkg/sql/schemachanger/sctest/cumulative.go | 3 +- pkg/sql/schemachanger/sctest/end_to_end.go | 3 +- .../testdata/end_to_end/add_column | 16 +- .../end_to_end/add_column_default_seq | 16 +- .../end_to_end/add_column_default_unique | 19 +- .../testdata/end_to_end/add_column_no_default | 15 +- .../end_to_end/alter_table_add_check_vanilla | 11 + .../alter_table_add_check_with_seq_and_udt | 12 + .../end_to_end/alter_table_add_foreign_key | 12 + .../alter_table_add_primary_key_drop_rowid | 15 +- .../alter_table_add_unique_without_index | 12 + .../alter_table_alter_primary_key_drop_rowid | 16 +- .../alter_table_alter_primary_key_vanilla | 16 +- .../testdata/end_to_end/create_index | 16 +- .../testdata/end_to_end/drop_column_basic | 51 +- .../end_to_end/drop_column_computed_index | 18 +- ...op_column_create_index_separate_statements | 28 +- .../end_to_end/drop_column_unique_index | 15 +- .../end_to_end/drop_column_with_index | 17 +- .../end_to_end/drop_index_hash_sharded_index | 18 +- .../drop_index_partial_expression_index | 18 +- .../end_to_end/drop_index_vanilla_index | 16 +- .../drop_index_with_materialized_view_dep | 18 +- .../drop_multiple_columns_separate_statements | 28 +- .../testdata/end_to_end/drop_schema | 13 +- .../testdata/end_to_end/drop_table | 16 +- .../schemachanger/testdata/explain/add_column | 3 +- .../testdata/explain/add_column_default_seq | 3 +- .../explain/add_column_default_unique | 8 +- ...dd_column_default_unique.rollback_13_of_15 | 3 +- ...dd_column_default_unique.rollback_14_of_15 | 3 +- ...dd_column_default_unique.rollback_15_of_15 | 3 +- .../testdata/explain/add_column_no_default | 3 +- .../alter_table_add_primary_key_drop_rowid | 3 +- .../alter_table_alter_primary_key_drop_rowid | 3 +- .../alter_table_alter_primary_key_vanilla | 5 +- ..._alter_primary_key_vanilla.rollback_5_of_7 | 3 +- ..._alter_primary_key_vanilla.rollback_6_of_7 | 3 +- ..._alter_primary_key_vanilla.rollback_7_of_7 | 3 +- .../testdata/explain/create_index | 5 +- .../explain/create_index.rollback_5_of_7 | 3 +- .../explain/create_index.rollback_6_of_7 | 3 +- .../explain/create_index.rollback_7_of_7 | 3 +- .../testdata/explain/drop_column_basic | 4 +- .../explain/drop_column_basic.rollback_1_of_7 | 3 +- .../explain/drop_column_basic.rollback_2_of_7 | 3 +- .../explain/drop_column_basic.rollback_3_of_7 | 3 +- .../explain/drop_column_basic.rollback_4_of_7 | 3 +- .../explain/drop_column_basic.rollback_5_of_7 | 3 +- .../explain/drop_column_basic.rollback_6_of_7 | 3 +- .../explain/drop_column_basic.rollback_7_of_7 | 3 +- .../explain/drop_column_computed_index | 7 +- ...drop_column_computed_index.rollback_1_of_7 | 5 +- ...drop_column_computed_index.rollback_2_of_7 | 5 +- ...drop_column_computed_index.rollback_3_of_7 | 5 +- ...drop_column_computed_index.rollback_4_of_7 | 5 +- ...drop_column_computed_index.rollback_5_of_7 | 5 +- ...drop_column_computed_index.rollback_6_of_7 | 5 +- ...drop_column_computed_index.rollback_7_of_7 | 5 +- ...ndex_separate_statements.rollback_10_of_15 | 5 +- ...ndex_separate_statements.rollback_11_of_15 | 5 +- ...ndex_separate_statements.rollback_12_of_15 | 5 +- ...ndex_separate_statements.rollback_13_of_15 | 6 +- ...ndex_separate_statements.rollback_14_of_15 | 6 +- ...ndex_separate_statements.rollback_15_of_15 | 6 +- ...index_separate_statements.rollback_1_of_15 | 5 +- ...index_separate_statements.rollback_2_of_15 | 5 +- ...index_separate_statements.rollback_3_of_15 | 5 +- ...index_separate_statements.rollback_4_of_15 | 5 +- ...index_separate_statements.rollback_5_of_15 | 5 +- ...index_separate_statements.rollback_6_of_15 | 5 +- ...index_separate_statements.rollback_7_of_15 | 5 +- ...index_separate_statements.rollback_8_of_15 | 5 +- ...index_separate_statements.rollback_9_of_15 | 5 +- ...index_separate_statements.statement_1_of_2 | 7 +- ...index_separate_statements.statement_2_of_2 | 6 +- .../testdata/explain/drop_column_unique_index | 3 +- .../testdata/explain/drop_column_with_index | 6 +- .../drop_column_with_index.rollback_1_of_7 | 5 +- .../drop_column_with_index.rollback_2_of_7 | 5 +- .../drop_column_with_index.rollback_3_of_7 | 5 +- .../drop_column_with_index.rollback_4_of_7 | 5 +- .../drop_column_with_index.rollback_5_of_7 | 5 +- .../drop_column_with_index.rollback_6_of_7 | 5 +- .../drop_column_with_index.rollback_7_of_7 | 5 +- .../explain/drop_index_hash_sharded_index | 6 +- .../drop_index_partial_expression_index | 6 +- .../testdata/explain/drop_index_vanilla_index | 3 +- .../drop_index_with_materialized_view_dep | 4 +- ...olumns_separate_statements.rollback_1_of_7 | 5 +- ...olumns_separate_statements.rollback_2_of_7 | 5 +- ...olumns_separate_statements.rollback_3_of_7 | 5 +- ...olumns_separate_statements.rollback_4_of_7 | 5 +- ...olumns_separate_statements.rollback_5_of_7 | 5 +- ...olumns_separate_statements.rollback_6_of_7 | 5 +- ...olumns_separate_statements.rollback_7_of_7 | 5 +- ...lumns_separate_statements.statement_1_of_2 | 7 +- ...lumns_separate_statements.statement_2_of_2 | 6 +- .../testdata/explain/drop_schema | 3 +- .../schemachanger/testdata/explain/drop_table | 6 +- .../testdata/explain_verbose/add_column | 46 +- .../add_column.rollback_1_of_7 | 16 - .../add_column.rollback_2_of_7 | 16 - .../add_column.rollback_3_of_7 | 16 - .../add_column.rollback_4_of_7 | 16 - .../add_column.rollback_5_of_7 | 16 - .../add_column.rollback_6_of_7 | 16 - .../add_column.rollback_7_of_7 | 16 - .../explain_verbose/add_column_default_seq | 46 +- .../add_column_default_seq.rollback_1_of_7 | 16 - .../add_column_default_seq.rollback_2_of_7 | 16 - .../add_column_default_seq.rollback_3_of_7 | 16 - .../add_column_default_seq.rollback_4_of_7 | 16 - .../add_column_default_seq.rollback_5_of_7 | 16 - .../add_column_default_seq.rollback_6_of_7 | 16 - .../add_column_default_seq.rollback_7_of_7 | 16 - .../explain_verbose/add_column_default_unique | 74 +-- ...dd_column_default_unique.rollback_10_of_15 | 27 - ...dd_column_default_unique.rollback_11_of_15 | 27 - ...dd_column_default_unique.rollback_12_of_15 | 27 - ...dd_column_default_unique.rollback_13_of_15 | 49 +- ...dd_column_default_unique.rollback_14_of_15 | 49 +- ...dd_column_default_unique.rollback_15_of_15 | 49 +- ...add_column_default_unique.rollback_1_of_15 | 18 - ...add_column_default_unique.rollback_2_of_15 | 18 - ...add_column_default_unique.rollback_3_of_15 | 18 - ...add_column_default_unique.rollback_4_of_15 | 18 - ...add_column_default_unique.rollback_5_of_15 | 18 - ...add_column_default_unique.rollback_6_of_15 | 18 - ...add_column_default_unique.rollback_7_of_15 | 18 - ...add_column_default_unique.rollback_8_of_15 | 18 - ...add_column_default_unique.rollback_9_of_15 | 27 - .../explain_verbose/add_column_no_default | 26 +- .../add_column_no_default.rollback_1_of_1 | 8 - .../alter_table_add_primary_key_drop_rowid | 59 +- ...d_primary_key_drop_rowid.rollback_10_of_15 | 32 -- ...d_primary_key_drop_rowid.rollback_11_of_15 | 32 -- ...d_primary_key_drop_rowid.rollback_12_of_15 | 32 -- ...d_primary_key_drop_rowid.rollback_13_of_15 | 32 -- ...d_primary_key_drop_rowid.rollback_14_of_15 | 32 -- ...d_primary_key_drop_rowid.rollback_15_of_15 | 32 -- ...dd_primary_key_drop_rowid.rollback_1_of_15 | 24 - ...dd_primary_key_drop_rowid.rollback_2_of_15 | 24 - ...dd_primary_key_drop_rowid.rollback_3_of_15 | 24 - ...dd_primary_key_drop_rowid.rollback_4_of_15 | 24 - ...dd_primary_key_drop_rowid.rollback_5_of_15 | 24 - ...dd_primary_key_drop_rowid.rollback_6_of_15 | 24 - ...dd_primary_key_drop_rowid.rollback_7_of_15 | 24 - ...dd_primary_key_drop_rowid.rollback_8_of_15 | 24 - ...dd_primary_key_drop_rowid.rollback_9_of_15 | 32 -- .../alter_table_alter_primary_key_drop_rowid | 65 +-- ...r_primary_key_drop_rowid.rollback_10_of_15 | 32 -- ...r_primary_key_drop_rowid.rollback_11_of_15 | 32 -- ...r_primary_key_drop_rowid.rollback_12_of_15 | 32 -- ...r_primary_key_drop_rowid.rollback_13_of_15 | 32 -- ...r_primary_key_drop_rowid.rollback_14_of_15 | 32 -- ...r_primary_key_drop_rowid.rollback_15_of_15 | 32 -- ...er_primary_key_drop_rowid.rollback_1_of_15 | 24 - ...er_primary_key_drop_rowid.rollback_2_of_15 | 24 - ...er_primary_key_drop_rowid.rollback_3_of_15 | 24 - ...er_primary_key_drop_rowid.rollback_4_of_15 | 24 - ...er_primary_key_drop_rowid.rollback_5_of_15 | 24 - ...er_primary_key_drop_rowid.rollback_6_of_15 | 24 - ...er_primary_key_drop_rowid.rollback_7_of_15 | 24 - ...er_primary_key_drop_rowid.rollback_8_of_15 | 24 - ...er_primary_key_drop_rowid.rollback_9_of_15 | 32 -- .../alter_table_alter_primary_key_vanilla | 46 +- ..._alter_primary_key_vanilla.rollback_1_of_7 | 8 - ..._alter_primary_key_vanilla.rollback_2_of_7 | 8 - ..._alter_primary_key_vanilla.rollback_3_of_7 | 8 - ..._alter_primary_key_vanilla.rollback_4_of_7 | 8 - ..._alter_primary_key_vanilla.rollback_5_of_7 | 29 +- ..._alter_primary_key_vanilla.rollback_6_of_7 | 29 +- ..._alter_primary_key_vanilla.rollback_7_of_7 | 29 +- .../testdata/explain_verbose/create_index | 25 +- .../create_index.rollback_5_of_7 | 19 +- .../create_index.rollback_6_of_7 | 19 +- .../create_index.rollback_7_of_7 | 19 +- .../explain_verbose/drop_column_basic | 59 +- .../drop_column_basic.rollback_1_of_7 | 35 +- .../drop_column_basic.rollback_2_of_7 | 35 +- .../drop_column_basic.rollback_3_of_7 | 35 +- .../drop_column_basic.rollback_4_of_7 | 35 +- .../drop_column_basic.rollback_5_of_7 | 35 +- .../drop_column_basic.rollback_6_of_7 | 35 +- .../drop_column_basic.rollback_7_of_7 | 35 +- .../drop_column_computed_index | 84 +-- ...drop_column_computed_index.rollback_1_of_7 | 47 +- ...drop_column_computed_index.rollback_2_of_7 | 47 +- ...drop_column_computed_index.rollback_3_of_7 | 47 +- ...drop_column_computed_index.rollback_4_of_7 | 47 +- ...drop_column_computed_index.rollback_5_of_7 | 47 +- ...drop_column_computed_index.rollback_6_of_7 | 47 +- ...drop_column_computed_index.rollback_7_of_7 | 47 +- ...ndex_separate_statements.rollback_10_of_15 | 55 +- ...ndex_separate_statements.rollback_11_of_15 | 55 +- ...ndex_separate_statements.rollback_12_of_15 | 55 +- ...ndex_separate_statements.rollback_13_of_15 | 75 +-- ...ndex_separate_statements.rollback_14_of_15 | 75 +-- ...ndex_separate_statements.rollback_15_of_15 | 75 +-- ...index_separate_statements.rollback_1_of_15 | 47 +- ...index_separate_statements.rollback_2_of_15 | 47 +- ...index_separate_statements.rollback_3_of_15 | 47 +- ...index_separate_statements.rollback_4_of_15 | 47 +- ...index_separate_statements.rollback_5_of_15 | 47 +- ...index_separate_statements.rollback_6_of_15 | 47 +- ...index_separate_statements.rollback_7_of_15 | 47 +- ...index_separate_statements.rollback_8_of_15 | 47 +- ...index_separate_statements.rollback_9_of_15 | 55 +- ...index_separate_statements.statement_1_of_2 | 84 +-- ...index_separate_statements.statement_2_of_2 | 75 +-- .../explain_verbose/drop_column_unique_index | 42 +- .../drop_column_unique_index.rollback_1_of_7 | 16 - .../drop_column_unique_index.rollback_2_of_7 | 16 - .../drop_column_unique_index.rollback_3_of_7 | 16 - .../drop_column_unique_index.rollback_4_of_7 | 16 - .../drop_column_unique_index.rollback_5_of_7 | 16 - .../drop_column_unique_index.rollback_6_of_7 | 16 - .../drop_column_unique_index.rollback_7_of_7 | 16 - .../explain_verbose/drop_column_with_index | 59 +- .../drop_column_with_index.rollback_1_of_7 | 39 +- .../drop_column_with_index.rollback_2_of_7 | 39 +- .../drop_column_with_index.rollback_3_of_7 | 39 +- .../drop_column_with_index.rollback_4_of_7 | 39 +- .../drop_column_with_index.rollback_5_of_7 | 39 +- .../drop_column_with_index.rollback_6_of_7 | 39 +- .../drop_column_with_index.rollback_7_of_7 | 39 +- .../drop_index_hash_sharded_index | 53 +- .../drop_index_partial_expression_index | 47 +- .../explain_verbose/drop_index_vanilla_index | 20 +- .../drop_index_with_materialized_view_dep | 74 +-- ...olumns_separate_statements.rollback_1_of_7 | 56 +- ...olumns_separate_statements.rollback_2_of_7 | 56 +- ...olumns_separate_statements.rollback_3_of_7 | 56 +- ...olumns_separate_statements.rollback_4_of_7 | 56 +- ...olumns_separate_statements.rollback_5_of_7 | 56 +- ...olumns_separate_statements.rollback_6_of_7 | 56 +- ...olumns_separate_statements.rollback_7_of_7 | 56 +- ...lumns_separate_statements.statement_1_of_2 | 84 +-- ...lumns_separate_statements.statement_2_of_2 | 77 +-- .../testdata/explain_verbose/drop_schema | 18 +- .../testdata/explain_verbose/drop_table | 75 +-- 343 files changed, 1598 insertions(+), 9323 deletions(-) create mode 100644 pkg/sql/schemachanger/scbuild/event_log.go delete mode 100644 pkg/sql/schemachanger/scbuild/event_log_state.go delete mode 100644 pkg/sql/schemachanger/scexec/scmutationexec/eventlog.go diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index b/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index index 3cae6fa3a996..c78befb2635c 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/create_index @@ -13,6 +13,16 @@ CREATE INDEX id1 begin transaction #1 # begin StatementPhase checking for feature: CREATE INDEX +write *eventpb.CreateIndex to event log: + indexName: id1 + mutationId: 1 + sql: + descriptorId: 104 + statement: CREATE INDEX ‹id1› ON ‹defaultdb›.‹public›.‹t1› (‹id›, ‹name›) STORING + (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›)) + tag: CREATE INDEX + user: root + tableName: defaultdb.public.t1 ## StatementPhase stage 1 of 1 with 11 MutationType ops upsert descriptor #104 ... @@ -218,7 +228,7 @@ begin transaction #9 validate forward indexes [2] in table #104 commit transaction #9 begin transaction #10 -## PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 2 with 5 MutationType ops upsert descriptor #104 ... BY LIST (id) (PARTITION p1 VALUES IN (1)) @@ -311,7 +321,6 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "6" + version: "7" -write *eventpb.CreateIndex to event log: CREATE INDEX ‹id1› ON ‹defaultdb›.‹public›.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›)) adding table for stats refresh: 104 update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 2 with 2 MutationType ops pending" set schema change job #1 to non-cancellable @@ -385,12 +394,14 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "7" + version: "8" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for CREATE INDEX id1 ON defaultdb.public.t1 (id, name) STORING (money) PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1))" descriptor IDs: [104] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #11 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_database_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_database_multiregion_primary_region index 5f7623aeffa8..97554887ce1a 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_database_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_database_multiregion_primary_region @@ -18,6 +18,17 @@ begin transaction #1 # begin StatementPhase checking for feature: DROP DATABASE increment telemetry for sql.schema.drop_database +write *eventpb.DropDatabase to event log: + databaseName: multi_region_test_db + droppedSchemaObjects: + - multi_region_test_db.public.crdb_internal_region + - multi_region_test_db.public._crdb_internal_region + - multi_region_test_db.public.table_regional_by_table + sql: + descriptorId: 104 + statement: DROP DATABASE ‹multi_region_test_db› CASCADE + tag: DROP DATABASE + user: root ## StatementPhase stage 1 of 1 with 5 MutationType ops add synthetic descriptor #104: database: @@ -226,7 +237,7 @@ notified job registry to adopt jobs: [1] begin transaction #2 commit transaction #2 begin transaction #3 -## PostCommitNonRevertiblePhase stage 1 of 1 with 18 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 1 with 13 MutationType ops upsert descriptor #108 ... createAsOfTime: @@ -254,12 +265,14 @@ delete descriptor #104 delete descriptor #105 delete descriptor #106 delete descriptor #107 -write *eventpb.DropDatabase to event log: DROP DATABASE ‹multi_region_test_db› CASCADE create job #2 (non-cancelable: true): "GC for DROP DATABASE multi_region_test_db CASCADE" descriptor IDs: [108 104] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #3 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion index c777282ea15f..91ce202397eb 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion @@ -18,6 +18,13 @@ begin transaction #1 # begin StatementPhase checking for feature: DROP TABLE increment telemetry for sql.schema.drop_table +write *eventpb.DropTable to event log: + sql: + descriptorId: 108 + statement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_row› + tag: DROP TABLE + user: root + tableName: multi_region_test_db.public.table_regional_by_row ## StatementPhase stage 1 of 1 with 1 MutationType op add synthetic descriptor #108: ... @@ -109,7 +116,7 @@ notified job registry to adopt jobs: [1] begin transaction #2 commit transaction #2 begin transaction #3 -## PostCommitNonRevertiblePhase stage 1 of 1 with 7 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 1 with 6 MutationType ops upsert descriptor #106 type: arrayTypeId: 107 @@ -162,12 +169,14 @@ upsert descriptor #108 unexposedParentSchemaId: 105 - version: "2" + version: "3" -write *eventpb.DropTable to event log: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_row› create job #2 (non-cancelable: true): "GC for DROP TABLE multi_region_test_db.public.table_regional_by_row" descriptor IDs: [108] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 108 commit transaction #3 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region index e5600ca540c3..3b40f89aab72 100644 --- a/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/end_to_end/drop_table_multiregion_primary_region @@ -18,6 +18,14 @@ begin transaction #1 # begin StatementPhase checking for feature: DROP TABLE increment telemetry for sql.schema.drop_table +write *eventpb.DropTable to event log: + sql: + descriptorId: 108 + statement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› + CASCADE + tag: DROP TABLE + user: root + tableName: multi_region_test_db.public.table_regional_by_table ## StatementPhase stage 1 of 1 with 1 MutationType op add synthetic descriptor #108: ... @@ -94,7 +102,7 @@ notified job registry to adopt jobs: [1] begin transaction #2 commit transaction #2 begin transaction #3 -## PostCommitNonRevertiblePhase stage 1 of 1 with 6 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 1 with 5 MutationType ops upsert descriptor #106 type: arrayTypeId: 107 @@ -134,12 +142,14 @@ upsert descriptor #108 unexposedParentSchemaId: 105 - version: "2" + version: "3" -write *eventpb.DropTable to event log: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› CASCADE create job #2 (non-cancelable: true): "GC for DROP TABLE multi_region_test_db.public.table_regional_by_table CASCADE" descriptor IDs: [108] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 108 commit transaction #3 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/ccl/schemachangerccl/testdata/explain/create_index b/pkg/ccl/schemachangerccl/testdata/explain/create_index index d7f5d2432025..4bdcabfbcccb 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/create_index +++ b/pkg/ccl/schemachangerccl/testdata/explain/create_index @@ -95,10 +95,9 @@ Schema change plan for CREATE INDEX ‹id1› ON ‹defaultdb›.‹public›. │ │ ├── PUBLIC → TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── PUBLIC → TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ └── PUBLIC → TRANSIENT_ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} - │ └── 6 Mutation operations - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} + │ └── 5 Mutation operations │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} │ └── UpdateSchemaChangerJob {"IsNonCancelable":true,"RunningStatus":"PostCommitNonRev..."} diff --git a/pkg/ccl/schemachangerccl/testdata/explain/create_index.rollback_5_of_7 b/pkg/ccl/schemachangerccl/testdata/explain/create_index.rollback_5_of_7 index a851fbdf8eb9..108aa87d12fa 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/create_index.rollback_5_of_7 +++ b/pkg/ccl/schemachangerccl/testdata/explain/create_index.rollback_5_of_7 @@ -23,9 +23,8 @@ Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.pu │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} - │ └── 6 Mutation operations + │ └── 5 Mutation operations │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} diff --git a/pkg/ccl/schemachangerccl/testdata/explain/create_index.rollback_6_of_7 b/pkg/ccl/schemachangerccl/testdata/explain/create_index.rollback_6_of_7 index 920a6076a284..7016299cbd1e 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/create_index.rollback_6_of_7 +++ b/pkg/ccl/schemachangerccl/testdata/explain/create_index.rollback_6_of_7 @@ -23,9 +23,8 @@ Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.pu │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} - │ └── 6 Mutation operations + │ └── 5 Mutation operations │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} diff --git a/pkg/ccl/schemachangerccl/testdata/explain/create_index.rollback_7_of_7 b/pkg/ccl/schemachangerccl/testdata/explain/create_index.rollback_7_of_7 index 33ef6af9de91..9f908ef004ac 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/create_index.rollback_7_of_7 +++ b/pkg/ccl/schemachangerccl/testdata/explain/create_index.rollback_7_of_7 @@ -23,8 +23,7 @@ Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.pu │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} - │ └── 6 Mutation operations - │ ├── LogEvent {"TargetStatus":1} + │ └── 5 Mutation operations │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} diff --git a/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region index 525e694e4629..0faccd36ed6b 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain/drop_database_multiregion_primary_region @@ -115,17 +115,12 @@ Schema change plan for DROP DATABASE ‹multi_region_test_db› CASCADE; │ ├── DROPPED → ABSENT Table:{DescID: 108} │ ├── PUBLIC → ABSENT IndexData:{DescID: 108, IndexID: 1} │ └── PUBLIC → ABSENT TableData:{DescID: 108, ReferencedDescID: 104} - └── 18 Mutation operations - ├── LogEvent {"TargetStatus":1} + └── 13 Mutation operations ├── DeleteDescriptor {"DescriptorID":104} ├── CreateGCJobForDatabase {"DatabaseID":104} - ├── LogEvent {"TargetStatus":1} ├── DeleteDescriptor {"DescriptorID":105} - ├── LogEvent {"TargetStatus":1} ├── DeleteDescriptor {"DescriptorID":106} - ├── LogEvent {"TargetStatus":1} ├── DeleteDescriptor {"DescriptorID":107} - ├── LogEvent {"TargetStatus":1} ├── CreateGCJobForTable {"DatabaseID":104,"TableID":108} ├── CreateGCJobForIndex {"IndexID":1,"TableID":108} ├── RemoveJobStateFromDescriptor {"DescriptorID":104} diff --git a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion index 6235736faf75..e0a79300efdf 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion +++ b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion @@ -70,8 +70,7 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab │ ├── DROPPED → ABSENT Table:{DescID: 108} │ ├── PUBLIC → ABSENT IndexData:{DescID: 108, IndexID: 1} │ └── PUBLIC → ABSENT TableData:{DescID: 108, ReferencedDescID: 104} - └── 7 Mutation operations - ├── LogEvent {"TargetStatus":1} + └── 6 Mutation operations ├── CreateGCJobForTable {"DatabaseID":104,"TableID":108} ├── CreateGCJobForIndex {"IndexID":1,"TableID":108} ├── RemoveJobStateFromDescriptor {"DescriptorID":106} diff --git a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region index ee4952b4f311..3e546e97881d 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain/drop_table_multiregion_primary_region @@ -57,8 +57,7 @@ Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹tab │ ├── DROPPED → ABSENT Table:{DescID: 108} │ ├── PUBLIC → ABSENT IndexData:{DescID: 108, IndexID: 1} │ └── PUBLIC → ABSENT TableData:{DescID: 108, ReferencedDescID: 104} - └── 6 Mutation operations - ├── LogEvent {"TargetStatus":1} + └── 5 Mutation operations ├── CreateGCJobForTable {"DatabaseID":104,"TableID":108} ├── CreateGCJobForIndex {"IndexID":1,"TableID":108} ├── RemoveJobStateFromDescriptor {"DescriptorID":106} diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index index f3d60649cf56..ca3a70b10caf 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index @@ -431,33 +431,15 @@ EXPLAIN (ddl, verbose) CREATE INDEX id1 │ │ └── • skip PUBLIC → TRANSIENT_ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 6 Mutation operations - │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ sourceIndexId: 1 - │ │ tableId: 104 - │ │ temporaryIndexId: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: CREATE INDEX ‹id1› ON ‹defaultdb›.‹public›.‹t1› (‹id›, ‹name›) STORING - │ │ (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›)) - │ │ StatementTag: CREATE INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 + │ └── • 5 Mutation operations │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 3 │ │ TableID: 104 diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_5_of_7 b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_5_of_7 index f83ce77d27fc..af602b44f090 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_5_of_7 +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_5_of_7 @@ -76,30 +76,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 6 Mutation operations + │ └── • 5 Mutation operations │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 3 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ sourceIndexId: 1 - │ │ tableId: 104 - │ │ temporaryIndexId: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING - │ │ (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›)) - │ │ StatementTag: CREATE INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 │ │ TableID: 104 diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_6_of_7 b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_6_of_7 index a71b8b563241..5f3f653d4696 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_6_of_7 +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_6_of_7 @@ -76,30 +76,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 6 Mutation operations + │ └── • 5 Mutation operations │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 3 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ sourceIndexId: 1 - │ │ tableId: 104 - │ │ temporaryIndexId: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING - │ │ (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›)) - │ │ StatementTag: CREATE INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 │ │ TableID: 104 diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_7_of_7 b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_7_of_7 index f1c46228a6a2..d3b84d4f8183 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_7_of_7 +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/create_index.rollback_7_of_7 @@ -76,25 +76,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 6 Mutation operations - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ sourceIndexId: 1 - │ │ tableId: 104 - │ │ temporaryIndexId: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING - │ │ (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›)) - │ │ StatementTag: CREATE INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 + │ └── • 5 Mutation operations │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region index ba177331700b..e58167f8c630 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_database_multiregion_primary_region @@ -628,38 +628,14 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 1 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP DATABASE ‹multi_region_test_db› CASCADE -│ │ StatementTag: DROP DATABASE -│ │ TargetMetadata: -│ │ SourceElementID: 3 -│ │ SubWorkID: 1 │ │ TableID: 108 │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 4294967295 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP DATABASE ‹multi_region_test_db› CASCADE -│ │ StatementTag: DROP DATABASE -│ │ TargetMetadata: -│ │ SourceElementID: 3 -│ │ SubWorkID: 1 │ │ TableID: 108 │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 4294967294 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP DATABASE ‹multi_region_test_db› CASCADE -│ │ StatementTag: DROP DATABASE -│ │ TargetMetadata: -│ │ SourceElementID: 3 -│ │ SubWorkID: 1 │ │ TableID: 108 │ │ │ ├── • SetJobStateOnDescriptor @@ -693,8 +669,7 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ - 108 │ JobID: 1 │ NonCancelable: true -│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 12 MutationType ops -│ pending +│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 7 MutationType ops pending │ Statements: │ - statement: DROP DATABASE multi_region_test_db CASCADE │ redactedstatement: DROP DATABASE ‹multi_region_test_db› CASCADE @@ -757,21 +732,7 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ └── • SameStagePrecedence dependency from ABSENT Table:{DescID: 108} │ rule: "table removed right before garbage collection" │ - └── • 18 Mutation operations - │ - ├── • LogEvent - │ Element: - │ Database: - │ databaseId: 104 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: DROP DATABASE ‹multi_region_test_db› CASCADE - │ StatementTag: DROP DATABASE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 - │ TargetStatus: 1 + └── • 13 Mutation operations │ ├── • DeleteDescriptor │ DescriptorID: 104 @@ -781,86 +742,15 @@ EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE; │ StatementForDropJob: │ Statement: DROP DATABASE multi_region_test_db CASCADE │ - ├── • LogEvent - │ Element: - │ Schema: - │ isPublic: true - │ schemaId: 105 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: DROP DATABASE ‹multi_region_test_db› CASCADE - │ StatementTag: DROP DATABASE - │ TargetMetadata: - │ SourceElementID: 2 - │ SubWorkID: 1 - │ TargetStatus: 1 - │ ├── • DeleteDescriptor │ DescriptorID: 105 │ - ├── • LogEvent - │ Element: - │ EnumType: - │ arrayTypeId: 107 - │ isMultiRegion: true - │ typeId: 106 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: DROP DATABASE ‹multi_region_test_db› CASCADE - │ StatementTag: DROP DATABASE - │ TargetMetadata: - │ SourceElementID: 3 - │ SubWorkID: 1 - │ TargetStatus: 1 - │ ├── • DeleteDescriptor │ DescriptorID: 106 │ - ├── • LogEvent - │ Element: - │ AliasType: - │ closedTypeIds: - │ - 106 - │ - 107 - │ type: - │ arrayContents: - │ family: EnumFamily - │ oid: 100106 - │ udtMetadata: - │ arrayTypeOid: 100107 - │ arrayElemType: EnumFamily - │ family: ArrayFamily - │ oid: 100107 - │ typeId: 107 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: DROP DATABASE ‹multi_region_test_db› CASCADE - │ StatementTag: DROP DATABASE - │ TargetMetadata: - │ SourceElementID: 4 - │ SubWorkID: 1 - │ TargetStatus: 1 - │ ├── • DeleteDescriptor │ DescriptorID: 107 │ - ├── • LogEvent - │ Element: - │ Table: - │ tableId: 108 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: DROP DATABASE ‹multi_region_test_db› CASCADE - │ StatementTag: DROP DATABASE - │ TargetMetadata: - │ SourceElementID: 3 - │ SubWorkID: 1 - │ TargetStatus: 1 - │ ├── • CreateGCJobForTable │ DatabaseID: 104 │ StatementForDropJob: diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion index 9cd57bb218a2..b5d63cdd49c6 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion @@ -385,14 +385,6 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 1 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_row› -│ │ StatementTag: DROP TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 │ │ TableID: 108 │ │ │ ├── • RemoveDroppedColumnType @@ -407,38 +399,14 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 4294967295 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_row› -│ │ StatementTag: DROP TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 │ │ TableID: 108 │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 4294967294 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_row› -│ │ StatementTag: DROP TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 │ │ TableID: 108 │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 2 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_row› -│ │ StatementTag: DROP TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 │ │ TableID: 108 │ │ │ ├── • SetJobStateOnDescriptor @@ -462,7 +430,7 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ - 108 │ JobID: 1 │ NonCancelable: true -│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 3 MutationType ops pending +│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 2 MutationType ops pending │ Statements: │ - statement: DROP TABLE multi_region_test_db.public.table_regional_by_row │ redactedstatement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_row› @@ -495,21 +463,7 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ └── • SameStagePrecedence dependency from ABSENT Table:{DescID: 108} │ rule: "table removed right before garbage collection" │ - └── • 7 Mutation operations - │ - ├── • LogEvent - │ Element: - │ Table: - │ tableId: 108 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_row› - │ StatementTag: DROP TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 - │ TargetStatus: 1 + └── • 6 Mutation operations │ ├── • CreateGCJobForTable │ DatabaseID: 104 diff --git a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region index 14ebdd64aa77..c6c288e89f03 100644 --- a/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region +++ b/pkg/ccl/schemachangerccl/testdata/explain_verbose/drop_table_multiregion_primary_region @@ -280,41 +280,14 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 1 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› -│ │ CASCADE -│ │ StatementTag: DROP TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 │ │ TableID: 108 │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 4294967295 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› -│ │ CASCADE -│ │ StatementTag: DROP TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 │ │ TableID: 108 │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 4294967294 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› -│ │ CASCADE -│ │ StatementTag: DROP TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 │ │ TableID: 108 │ │ │ ├── • SetJobStateOnDescriptor @@ -333,7 +306,7 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ - 108 │ JobID: 1 │ NonCancelable: true -│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 3 MutationType ops pending +│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 2 MutationType ops pending │ Statements: │ - statement: DROP TABLE multi_region_test_db.public.table_regional_by_table CASCADE │ redactedstatement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› @@ -367,22 +340,7 @@ EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_ │ └── • SameStagePrecedence dependency from ABSENT Table:{DescID: 108} │ rule: "table removed right before garbage collection" │ - └── • 6 Mutation operations - │ - ├── • LogEvent - │ Element: - │ Table: - │ tableId: 108 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› - │ CASCADE - │ StatementTag: DROP TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 - │ TargetStatus: 1 + └── • 5 Mutation operations │ ├── • CreateGCJobForTable │ DatabaseID: 104 diff --git a/pkg/sql/event_log.go b/pkg/sql/event_log.go index 403f3a0540c4..25421c7c78f2 100644 --- a/pkg/sql/event_log.go +++ b/pkg/sql/event_log.go @@ -27,7 +27,8 @@ import ( "github.com/cockroachdb/cockroach/pkg/settings" "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb" "github.com/cockroachdb/cockroach/pkg/sql/isql" - "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scrun" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sessiondata" "github.com/cockroachdb/cockroach/pkg/util/contextutil" @@ -341,21 +342,29 @@ type schemaChangerEventLogger struct { depth int } -var _ scexec.EventLogger = (*schemaChangerEventLogger)(nil) +var _ scrun.EventLogger = (*schemaChangerEventLogger)(nil) +var _ scbuild.EventLogger = (*schemaChangerEventLogger)(nil) -// NewSchemaChangerEventLogger returns a scexec.EventLogger implementation. -func NewSchemaChangerEventLogger( - txn isql.Txn, execCfg *ExecutorConfig, depth int, -) scexec.EventLogger { +// NewSchemaChangerBuildEventLogger returns a scbuild.EventLogger implementation. +func NewSchemaChangerBuildEventLogger(txn isql.Txn, execCfg *ExecutorConfig) scbuild.EventLogger { return &schemaChangerEventLogger{ txn: txn, execCfg: execCfg, - depth: depth, + depth: 1, } } -// LogEvent implements the scexec.EventLogger interface. -func (l schemaChangerEventLogger) LogEvent( +// NewSchemaChangerRunEventLogger returns a scrun.EventLogger implementation. +func NewSchemaChangerRunEventLogger(txn isql.Txn, execCfg *ExecutorConfig) scrun.EventLogger { + return &schemaChangerEventLogger{ + txn: txn, + execCfg: execCfg, + depth: 0, + } +} + +// LogEvent implements the scbuild.EventLogger interface. +func (l *schemaChangerEventLogger) LogEvent( ctx context.Context, details eventpb.CommonSQLEventDetails, event logpb.EventPayload, ) error { return logEventInternalForSQLStatements(ctx, @@ -367,7 +376,8 @@ func (l schemaChangerEventLogger) LogEvent( event) } -func (l schemaChangerEventLogger) LogEventForSchemaChange( +// LogEventForSchemaChange implements the scrun.EventLogger interface. +func (l *schemaChangerEventLogger) LogEventForSchemaChange( ctx context.Context, event logpb.EventPayload, ) error { event.CommonDetails().Timestamp = l.txn.KV().ReadTimestamp().WallTime diff --git a/pkg/sql/logictest/testdata/logic_test/crdb_internal_catalog b/pkg/sql/logictest/testdata/logic_test/crdb_internal_catalog index 1c48df380a62..d36507800709 100644 --- a/pkg/sql/logictest/testdata/logic_test/crdb_internal_catalog +++ b/pkg/sql/logictest/testdata/logic_test/crdb_internal_catalog @@ -158,8 +158,8 @@ SELECT id, strip_volatile(descriptor) FROM crdb_internal.kv_catalog_descriptor 108 {"schema": {"id": 108, "name": "sc", "parentId": 106, "privileges": {"ownerProto": "root", "users": [{"privileges": "2", "userProto": "admin", "withGrantOption": "2"}, {"privileges": "2", "userProto": "root", "withGrantOption": "2"}], "version": 2}, "version": "1"}} 109 {"type": {"arrayTypeId": 110, "enumMembers": [{"logicalRepresentation": "hi", "physicalRepresentation": "QA=="}, {"logicalRepresentation": "hello", "physicalRepresentation": "gA=="}], "id": 109, "name": "greeting", "parentId": 106, "parentSchemaId": 108, "privileges": {"ownerProto": "root", "users": [{"privileges": "2", "userProto": "admin", "withGrantOption": "2"}, {"privileges": "512", "userProto": "public"}, {"privileges": "2", "userProto": "root", "withGrantOption": "2"}], "version": 2}, "version": "1"}} 110 {"type": {"alias": {"arrayContents": {"family": "EnumFamily", "oid": 100109, "udtMetadata": {"arrayTypeOid": 100110}}, "arrayElemType": "EnumFamily", "family": "ArrayFamily", "oid": 100110}, "id": 110, "kind": "ALIAS", "name": "_greeting", "parentId": 106, "parentSchemaId": 108, "privileges": {"ownerProto": "root", "users": [{"privileges": "2", "userProto": "admin", "withGrantOption": "2"}, {"privileges": "512", "userProto": "public"}, {"privileges": "2", "userProto": "root", "withGrantOption": "2"}], "version": 2}, "version": "1"}} -111 {"table": {"checks": [{"columnIds": [1], "constraintId": 2, "expr": "k > 0:::INT8", "name": "ck"}], "columns": [{"id": 1, "name": "k", "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 2, "name": "v", "nullable": true, "type": {"family": "StringFamily", "oid": 25}}], "dependedOnBy": [{"columnIds": [1, 2], "id": 112}], "formatVersion": 3, "id": 111, "name": "kv", "nextColumnId": 3, "nextConstraintId": 3, "nextIndexId": 2, "nextMutationId": 1, "parentId": 106, "primaryIndex": {"constraintId": 1, "encodingType": 1, "foreignKey": {}, "geoConfig": {}, "id": 1, "interleave": {}, "keyColumnDirections": ["ASC"], "keyColumnIds": [1], "keyColumnNames": ["k"], "name": "kv_pkey", "partitioning": {}, "sharded": {}, "storeColumnIds": [2], "storeColumnNames": ["v"], "unique": true, "version": 4}, "privileges": {"ownerProto": "root", "users": [{"privileges": "2", "userProto": "admin", "withGrantOption": "2"}, {"privileges": "2", "userProto": "root", "withGrantOption": "2"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 107, "version": "6"}} -112 {"table": {"columns": [{"id": 1, "name": "k", "nullable": true, "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 2, "name": "v", "nullable": true, "type": {"family": "StringFamily", "oid": 25}}, {"defaultExpr": "unique_rowid()", "hidden": true, "id": 3, "name": "rowid", "type": {"family": "IntFamily", "oid": 20, "width": 64}}], "dependsOn": [111], "formatVersion": 3, "id": 112, "indexes": [{"createdExplicitly": true, "foreignKey": {}, "geoConfig": {}, "id": 2, "interleave": {}, "keyColumnDirections": ["ASC"], "keyColumnIds": [2], "keyColumnNames": ["v"], "keySuffixColumnIds": [3], "name": "idx", "partitioning": {}, "sharded": {}, "version": 4}], "isMaterializedView": true, "name": "mv", "nextColumnId": 4, "nextConstraintId": 2, "nextIndexId": 4, "nextMutationId": 1, "parentId": 106, "primaryIndex": {"constraintId": 1, "encodingType": 1, "foreignKey": {}, "geoConfig": {}, "id": 1, "interleave": {}, "keyColumnDirections": ["ASC"], "keyColumnIds": [3], "keyColumnNames": ["rowid"], "name": "mv_pkey", "partitioning": {}, "sharded": {}, "storeColumnIds": [1, 2], "storeColumnNames": ["k", "v"], "unique": true, "version": 4}, "privileges": {"ownerProto": "root", "users": [{"privileges": "2", "userProto": "admin", "withGrantOption": "2"}, {"privileges": "2", "userProto": "root", "withGrantOption": "2"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 107, "version": "10", "viewQuery": "SELECT k, v FROM db.public.kv"}} +111 {"table": {"checks": [{"columnIds": [1], "constraintId": 2, "expr": "k > 0:::INT8", "name": "ck"}], "columns": [{"id": 1, "name": "k", "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 2, "name": "v", "nullable": true, "type": {"family": "StringFamily", "oid": 25}}], "dependedOnBy": [{"columnIds": [1, 2], "id": 112}], "formatVersion": 3, "id": 111, "name": "kv", "nextColumnId": 3, "nextConstraintId": 3, "nextIndexId": 2, "nextMutationId": 1, "parentId": 106, "primaryIndex": {"constraintId": 1, "encodingType": 1, "foreignKey": {}, "geoConfig": {}, "id": 1, "interleave": {}, "keyColumnDirections": ["ASC"], "keyColumnIds": [1], "keyColumnNames": ["k"], "name": "kv_pkey", "partitioning": {}, "sharded": {}, "storeColumnIds": [2], "storeColumnNames": ["v"], "unique": true, "version": 4}, "privileges": {"ownerProto": "root", "users": [{"privileges": "2", "userProto": "admin", "withGrantOption": "2"}, {"privileges": "2", "userProto": "root", "withGrantOption": "2"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 107, "version": "4"}} +112 {"table": {"columns": [{"id": 1, "name": "k", "nullable": true, "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 2, "name": "v", "nullable": true, "type": {"family": "StringFamily", "oid": 25}}, {"defaultExpr": "unique_rowid()", "hidden": true, "id": 3, "name": "rowid", "type": {"family": "IntFamily", "oid": 20, "width": 64}}], "dependsOn": [111], "formatVersion": 3, "id": 112, "indexes": [{"createdExplicitly": true, "foreignKey": {}, "geoConfig": {}, "id": 2, "interleave": {}, "keyColumnDirections": ["ASC"], "keyColumnIds": [2], "keyColumnNames": ["v"], "keySuffixColumnIds": [3], "name": "idx", "partitioning": {}, "sharded": {}, "version": 4}], "isMaterializedView": true, "name": "mv", "nextColumnId": 4, "nextConstraintId": 2, "nextIndexId": 4, "nextMutationId": 1, "parentId": 106, "primaryIndex": {"constraintId": 1, "encodingType": 1, "foreignKey": {}, "geoConfig": {}, "id": 1, "interleave": {}, "keyColumnDirections": ["ASC"], "keyColumnIds": [3], "keyColumnNames": ["rowid"], "name": "mv_pkey", "partitioning": {}, "sharded": {}, "storeColumnIds": [1, 2], "storeColumnNames": ["k", "v"], "unique": true, "version": 4}, "privileges": {"ownerProto": "root", "users": [{"privileges": "2", "userProto": "admin", "withGrantOption": "2"}, {"privileges": "2", "userProto": "root", "withGrantOption": "2"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 107, "version": "9", "viewQuery": "SELECT k, v FROM db.public.kv"}} 113 {"function": {"functionBody": "SELECT json_remove_path(json_remove_path(json_remove_path(json_remove_path(json_remove_path(json_remove_path(json_remove_path(json_remove_path(json_remove_path(json_remove_path(json_remove_path(json_remove_path(d, ARRAY['table', 'families']), ARRAY['table', 'nextFamilyId']), ARRAY['table', 'indexes', '0', 'createdAtNanos']), ARRAY['table', 'indexes', '1', 'createdAtNanos']), ARRAY['table', 'indexes', '2', 'createdAtNanos']), ARRAY['table', 'primaryIndex', 'createdAtNanos']), ARRAY['table', 'createAsOfTime']), ARRAY['table', 'modificationTime']), ARRAY['function', 'modificationTime']), ARRAY['type', 'modificationTime']), ARRAY['schema', 'modificationTime']), ARRAY['database', 'modificationTime']);", "id": 113, "lang": "SQL", "name": "strip_volatile", "nullInputBehavior": "CALLED_ON_NULL_INPUT", "params": [{"class": "IN", "name": "d", "type": {"family": "JsonFamily", "oid": 3802}}], "parentId": 104, "parentSchemaId": 105, "privileges": {"ownerProto": "root", "users": [{"privileges": "2", "userProto": "admin", "withGrantOption": "2"}, {"privileges": "2", "userProto": "root", "withGrantOption": "2"}], "version": 2}, "returnType": {"type": {"family": "JsonFamily", "oid": 3802}}, "version": "1", "volatility": "STABLE"}} 4294966994 {"table": {"columns": [{"id": 1, "name": "srid", "nullable": true, "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 2, "name": "auth_name", "nullable": true, "type": {"family": "StringFamily", "oid": 1043, "visibleType": 7, "width": 256}}, {"id": 3, "name": "auth_srid", "nullable": true, "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 4, "name": "srtext", "nullable": true, "type": {"family": "StringFamily", "oid": 1043, "visibleType": 7, "width": 2048}}, {"id": 5, "name": "proj4text", "nullable": true, "type": {"family": "StringFamily", "oid": 1043, "visibleType": 7, "width": 2048}}], "formatVersion": 3, "id": 4294966994, "name": "spatial_ref_sys", "nextColumnId": 6, "nextConstraintId": 2, "nextIndexId": 2, "nextMutationId": 1, "primaryIndex": {"constraintId": 1, "foreignKey": {}, "geoConfig": {}, "id": 1, "interleave": {}, "partitioning": {}, "sharded": {}}, "privileges": {"ownerProto": "node", "users": [{"privileges": "32", "userProto": "public"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 4294966997, "version": "1"}} 4294966995 {"table": {"columns": [{"id": 1, "name": "f_table_catalog", "nullable": true, "type": {"family": 11, "oid": 19}}, {"id": 2, "name": "f_table_schema", "nullable": true, "type": {"family": 11, "oid": 19}}, {"id": 3, "name": "f_table_name", "nullable": true, "type": {"family": 11, "oid": 19}}, {"id": 4, "name": "f_geometry_column", "nullable": true, "type": {"family": 11, "oid": 19}}, {"id": 5, "name": "coord_dimension", "nullable": true, "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 6, "name": "srid", "nullable": true, "type": {"family": "IntFamily", "oid": 20, "width": 64}}, {"id": 7, "name": "type", "nullable": true, "type": {"family": "StringFamily", "oid": 25}}], "formatVersion": 3, "id": 4294966995, "name": "geometry_columns", "nextColumnId": 8, "nextConstraintId": 2, "nextIndexId": 2, "nextMutationId": 1, "primaryIndex": {"constraintId": 1, "foreignKey": {}, "geoConfig": {}, "id": 1, "interleave": {}, "partitioning": {}, "sharded": {}}, "privileges": {"ownerProto": "node", "users": [{"privileges": "32", "userProto": "public"}], "version": 2}, "replacementOf": {"time": {}}, "unexposedParentSchemaId": 4294966997, "version": "1"}} diff --git a/pkg/sql/logictest/testdata/logic_test/event_log b/pkg/sql/logictest/testdata/logic_test/event_log index e6bb6abb90a4..731d0f605474 100644 --- a/pkg/sql/logictest/testdata/logic_test/event_log +++ b/pkg/sql/logictest/testdata/logic_test/event_log @@ -120,7 +120,7 @@ query IT SELECT "reportingID", info::JSONB - 'Timestamp' - 'DescriptorID' FROM system.eventlog WHERE "eventType" = 'finish_schema_change' ---- -1 {"EventType": "finish_schema_change", "InstanceID": 1, "MutationID": 1} +1 {"EventType": "finish_schema_change", "InstanceID": 1} query I SELECT "reportingID" FROM system.eventlog @@ -159,7 +159,7 @@ query IT SELECT "reportingID", info::JSONB - 'Timestamp' - 'DescriptorID' FROM system.eventlog WHERE "eventType" = 'finish_schema_change' ---- -1 {"EventType": "finish_schema_change", "InstanceID": 1, "MutationID": 1} +1 {"EventType": "finish_schema_change", "InstanceID": 1} query IT SELECT "reportingID", info::JSONB - 'Timestamp' - 'DescriptorID' - 'Error' @@ -186,15 +186,15 @@ SELECT "reportingID", info::JSONB - 'Timestamp' - 'DescriptorID' FROM system.eve WHERE "eventType" = 'create_index' AND info::JSONB->>'Statement' LIKE 'CREATE INDEX %a_foo%' ---- -1 {"EventType": "create_index", "IndexName": "a_foo", "MutationID": 2, "Statement": "CREATE INDEX a_foo ON test.public.a (val)", "TableName": "test.public.a", "Tag": "CREATE INDEX", "User": "root"} +1 {"EventType": "create_index", "IndexName": "a_foo", "MutationID": 1, "Statement": "CREATE INDEX a_foo ON test.public.a (val)", "TableName": "test.public.a", "Tag": "CREATE INDEX", "User": "root"} query IT SELECT "reportingID", info::JSONB - 'Timestamp' - 'DescriptorID' FROM system.eventlog WHERE "eventType" = 'finish_schema_change' ORDER BY "timestamp", info ---- -1 {"EventType": "finish_schema_change", "InstanceID": 1, "MutationID": 1} -1 {"EventType": "finish_schema_change", "InstanceID": 1, "MutationID": 2} +1 {"EventType": "finish_schema_change", "InstanceID": 1} +1 {"EventType": "finish_schema_change", "InstanceID": 1} statement ok CREATE INDEX ON a (val) @@ -204,16 +204,16 @@ SELECT "reportingID", info::JSONB - 'Timestamp' - 'DescriptorID' FROM system.eve WHERE "eventType" = 'create_index' AND info::JSONB->>'Statement' LIKE 'CREATE INDEX ON%' ---- -1 {"EventType": "create_index", "IndexName": "a_val_idx", "MutationID": 2, "Statement": "CREATE INDEX ON test.public.a (val)", "TableName": "test.public.a", "Tag": "CREATE INDEX", "User": "root"} +1 {"EventType": "create_index", "IndexName": "a_val_idx", "MutationID": 1, "Statement": "CREATE INDEX ON test.public.a (val)", "TableName": "test.public.a", "Tag": "CREATE INDEX", "User": "root"} query IT SELECT "reportingID", info::JSONB - 'Timestamp' - 'DescriptorID' FROM system.eventlog WHERE "eventType" = 'finish_schema_change' ORDER BY "timestamp", info ---- -1 {"EventType": "finish_schema_change", "InstanceID": 1, "MutationID": 1} -1 {"EventType": "finish_schema_change", "InstanceID": 1, "MutationID": 2} -1 {"EventType": "finish_schema_change", "InstanceID": 1, "MutationID": 2} +1 {"EventType": "finish_schema_change", "InstanceID": 1} +1 {"EventType": "finish_schema_change", "InstanceID": 1} +1 {"EventType": "finish_schema_change", "InstanceID": 1} # Drop the index @@ -226,17 +226,17 @@ SELECT "reportingID", info::JSONB - 'Timestamp' - 'DescriptorID' FROM system.eve WHERE "eventType" = 'drop_index' AND info::JSONB->>'Statement' LIKE 'DROP INDEX%a_foo' ---- -1 {"EventType": "drop_index", "IndexName": "a_foo", "MutationID": 2, "Statement": "DROP INDEX test.public.a@a_foo", "TableName": "test.public.a", "Tag": "DROP INDEX", "User": "root"} +1 {"EventType": "drop_index", "IndexName": "a_foo", "MutationID": 1, "Statement": "DROP INDEX test.public.a@a_foo", "TableName": "test.public.a", "Tag": "DROP INDEX", "User": "root"} query IT SELECT "reportingID", info::JSONB - 'Timestamp' - 'DescriptorID' FROM system.eventlog WHERE "eventType" = 'finish_schema_change' ORDER BY "timestamp", info ---- -1 {"EventType": "finish_schema_change", "InstanceID": 1, "MutationID": 1} -1 {"EventType": "finish_schema_change", "InstanceID": 1, "MutationID": 2} -1 {"EventType": "finish_schema_change", "InstanceID": 1, "MutationID": 2} -1 {"EventType": "finish_schema_change", "InstanceID": 1, "MutationID": 2} +1 {"EventType": "finish_schema_change", "InstanceID": 1} +1 {"EventType": "finish_schema_change", "InstanceID": 1} +1 {"EventType": "finish_schema_change", "InstanceID": 1} +1 {"EventType": "finish_schema_change", "InstanceID": 1} # Truncate a table ################## @@ -959,8 +959,6 @@ SELECT "reportingID", "eventType", info::JSONB - 'Timestamp' - 'DescriptorID' ORDER BY "timestamp", info ---- 1 drop_type {"EventType": "drop_type", "Statement": "DROP TYPE defaultdb.public.eventlog_renamed", "Tag": "DROP TYPE", "TypeName": "defaultdb.public.eventlog_renamed", "User": "root"} -1 drop_type {"EventType": "drop_type", "Statement": "DROP TYPE defaultdb.public.eventlog_renamed", "Tag": "DROP TYPE", "TypeName": "defaultdb.public._eventlog_renamed", "User": "root"} - # Test the event logs generated by COMMENT ON ... commands. subtest eventlog_comments @@ -1116,4 +1114,4 @@ WHERE "eventType" = 'alter_table' ORDER BY "timestamp" DESC, info LIMIT 1 ---- -1 {"EventType": "alter_table", "MutationID": 1, "Statement": "ALTER TABLE defaultdb.public.x DROP COLUMN b CASCADE", "TableName": "defaultdb.public.x", "Tag": "ALTER TABLE", "User": "root"} +1 {"CascadeDroppedViews": ["defaultdb.public.v", "defaultdb.public.vv"], "EventType": "alter_table", "MutationID": 1, "Statement": "ALTER TABLE defaultdb.public.x DROP COLUMN b CASCADE", "TableName": "defaultdb.public.x", "Tag": "ALTER TABLE", "User": "root"} diff --git a/pkg/sql/logictest/testdata/logic_test/new_schema_changer b/pkg/sql/logictest/testdata/logic_test/new_schema_changer index 54341343cd9b..3a8b31b8454a 100644 --- a/pkg/sql/logictest/testdata/logic_test/new_schema_changer +++ b/pkg/sql/logictest/testdata/logic_test/new_schema_changer @@ -1094,6 +1094,7 @@ SELECT "reportingID", info::JSONB - 'Timestamp' - 'DescriptorID' FROM system.eventlog; ---- 1 {"CascadeDroppedViews": ["test.public.v4ev"], "EventType": "drop_view", "Statement": "DROP VIEW test.public.v1ev CASCADE", "Tag": "DROP VIEW", "User": "root", "ViewName": "test.public.v1ev"} +1 {"EventType": "finish_schema_change", "InstanceID": 1} statement ok CREATE VIEW v1ev AS (SELECT name FROM T1EV); @@ -1114,6 +1115,8 @@ ORDER BY timestamp, info DESC; ---- 1 {"CascadeDroppedViews": ["test.public.v2ev", "test.public.v3ev"], "EventType": "drop_table", "Statement": "DROP TABLE test.public.t1ev, test.public.t2ev CASCADE", "TableName": "test.public.t2ev", "Tag": "DROP TABLE", "User": "root"} 1 {"CascadeDroppedViews": ["test.public.v1ev", "test.public.v4ev"], "EventType": "drop_table", "Statement": "DROP TABLE test.public.t1ev, test.public.t2ev CASCADE", "TableName": "test.public.t1ev", "Tag": "DROP TABLE", "User": "root"} +1 {"EventType": "finish_schema_change", "InstanceID": 1} +1 {"EventType": "finish_schema_change", "InstanceID": 1} statement ok CREATE TABLE fooev (i INT PRIMARY KEY); @@ -1130,7 +1133,7 @@ FROM system.eventlog ORDER BY timestamp, info DESC; ---- 1 {"EventType": "alter_table", "MutationID": 1, "Statement": "ALTER TABLE test.public.fooev ADD COLUMN j INT8", "TableName": "test.public.fooev", "Tag": "ALTER TABLE", "User": "root"} -1 {"EventType": "finish_schema_change", "InstanceID": 1, "MutationID": 1} +1 {"EventType": "finish_schema_change", "InstanceID": 1} subtest names-with-escaped-chars @@ -1178,7 +1181,9 @@ FROM system.eventlog ORDER BY timestamp, info DESC; ---- 1 {"DatabaseName": "'db1-a'", "DroppedSchemaObjects": ["\"'db1-a'\".public.\"'t1-esc'\""], "EventType": "drop_database", "Statement": "DROP DATABASE \"'db1-a'\" CASCADE", "Tag": "DROP DATABASE", "User": "root"} +1 {"EventType": "finish_schema_change", "InstanceID": 1} 1 {"DatabaseName": "db2", "EventType": "drop_database", "Statement": "DROP DATABASE db2 CASCADE", "Tag": "DROP DATABASE", "User": "root"} +1 {"EventType": "finish_schema_change", "InstanceID": 1} # Sanity: Dropping multiple objects in the builder or resolving any dependencies # should function fine. diff --git a/pkg/sql/pgwire/testdata/pgtest/notice b/pkg/sql/pgwire/testdata/pgtest/notice index dec1b5f49217..e60704db2a91 100644 --- a/pkg/sql/pgwire/testdata/pgtest/notice +++ b/pkg/sql/pgwire/testdata/pgtest/notice @@ -55,7 +55,7 @@ Query {"String": "DROP INDEX t_x_idx"} until crdb_only CommandComplete ---- -{"Severity":"NOTICE","SeverityUnlocalized":"NOTICE","Code":"00000","Message":"the data for dropped indexes is reclaimed asynchronously","Detail":"","Hint":"The reclamation delay can be customized in the zone configuration for the table.","Position":0,"InternalPosition":0,"InternalQuery":"","Where":"","SchemaName":"","TableName":"","ColumnName":"","DataTypeName":"","ConstraintName":"","File":"drop_index.go","Line":63,"Routine":"DropIndex","UnknownFields":null} +{"Severity":"NOTICE","SeverityUnlocalized":"NOTICE","Code":"00000","Message":"the data for dropped indexes is reclaimed asynchronously","Detail":"","Hint":"The reclamation delay can be customized in the zone configuration for the table.","Position":0,"InternalPosition":0,"InternalQuery":"","Where":"","SchemaName":"","TableName":"","ColumnName":"","DataTypeName":"","ConstraintName":"","File":"drop_index.go","Line":66,"Routine":"DropIndex","UnknownFields":null} {"Type":"CommandComplete","CommandTag":"DROP INDEX"} until noncrdb_only diff --git a/pkg/sql/schema_change_plan_node.go b/pkg/sql/schema_change_plan_node.go index 8c43850e391f..5551c877ac36 100644 --- a/pkg/sql/schema_change_plan_node.go +++ b/pkg/sql/schema_change_plan_node.go @@ -64,19 +64,7 @@ func (p *planner) SchemaChange(ctx context.Context, stmt tree.Statement) (planNo } scs := p.extendedEvalCtx.SchemaChangerState scs.stmts = append(scs.stmts, p.stmt.SQL) - deps := scdeps.NewBuilderDependencies( - p.ExecCfg().NodeInfo.LogicalClusterID(), - p.ExecCfg().Codec, - p.InternalSQLTxn(), - NewSkippingCacheSchemaResolver, /* schemaResolverFactory */ - p, /* authAccessor */ - p, /* astFormatter */ - p, /* featureChecker */ - p.SessionData(), - p.ExecCfg().Settings, - scs.stmts, - p, - ) + deps := p.newSchemaChangeBuilderDependencies(scs.stmts) state, err := scbuild.Build(ctx, deps, scs.state, stmt) if scerrors.HasNotImplemented(err) && mode != sessiondatapb.UseNewSchemaChangerUnsafeAlways { @@ -98,6 +86,23 @@ func (p *planner) SchemaChange(ctx context.Context, stmt tree.Statement) (planNo }, nil } +func (p *planner) newSchemaChangeBuilderDependencies(statements []string) scbuild.Dependencies { + return scdeps.NewBuilderDependencies( + p.ExecCfg().NodeInfo.LogicalClusterID(), + p.ExecCfg().Codec, + p.InternalSQLTxn(), + NewSkippingCacheSchemaResolver, /* schemaResolverFactory */ + p, /* authAccessor */ + p, /* astFormatter */ + p, /* featureChecker */ + p.SessionData(), + p.ExecCfg().Settings, + statements, + p, + NewSchemaChangerBuildEventLogger(p.InternalSQLTxn(), p.ExecCfg()), + ) +} + // waitForDescriptorIDGeneratorMigration polls the system.descriptor table (in // separate transactions) until the descriptor_id_seq record is present, which // indicates that the system tenant's descriptor ID generator has successfully @@ -242,19 +247,7 @@ func (s *schemaChangePlanNode) startExec(params runParams) error { // to re-plan the state to include the current statement since the statement // phase was not executed. if !reflect.DeepEqual(s.lastState.Current, scs.state.Current) { - deps := scdeps.NewBuilderDependencies( - p.ExecCfg().NodeInfo.LogicalClusterID(), - p.ExecCfg().Codec, - p.InternalSQLTxn(), - NewSkippingCacheSchemaResolver, - p, - p, - p, - p.SessionData(), - p.ExecCfg().Settings, - scs.stmts, - p, - ) + deps := p.newSchemaChangeBuilderDependencies(scs.stmts) state, err := scbuild.Build(params.ctx, deps, scs.state, s.stmt) if err != nil { return err @@ -323,7 +316,6 @@ func newSchemaChangerTxnRunDependencies( execCfg.Validator, scdeps.NewConstantClock(evalContext.GetTxnTimestamp(time.Microsecond).Time), metaDataUpdater, - NewSchemaChangerEventLogger(txn, execCfg, 1), execCfg.StatsRefresher, execCfg.DeclarativeSchemaChangerTestingKnobs, kvTrace, diff --git a/pkg/sql/schemachanger/scbuild/BUILD.bazel b/pkg/sql/schemachanger/scbuild/BUILD.bazel index 3c87717f397c..eb3cc0075797 100644 --- a/pkg/sql/schemachanger/scbuild/BUILD.bazel +++ b/pkg/sql/schemachanger/scbuild/BUILD.bazel @@ -8,7 +8,7 @@ go_library( "build.go", "builder_state.go", "dependencies.go", - "event_log_state.go", + "event_log.go", "tree_context_builder.go", ], importpath = "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild", @@ -47,6 +47,8 @@ go_library( "//pkg/sql/sessiondatapb", "//pkg/sql/sqlerrors", "//pkg/sql/types", + "//pkg/util/log/eventpb", + "//pkg/util/log/logpb", "//pkg/util/uuid", "@com_github_cockroachdb_errors//:errors", "@com_github_cockroachdb_redact//:redact", diff --git a/pkg/sql/schemachanger/scbuild/build.go b/pkg/sql/schemachanger/scbuild/build.go index 495454b7ffc5..3d95f13d3693 100644 --- a/pkg/sql/schemachanger/scbuild/build.go +++ b/pkg/sql/schemachanger/scbuild/build.go @@ -61,8 +61,8 @@ func Build( } scbuildstmt.Process(b, an.GetStatement()) an.ValidateAnnotations() - els.statements[len(els.statements)-1].RedactedStatement = - string(els.astFormatter.FormatAstAsRedactableString(an.GetStatement(), &an.annotation)) + els.statements[len(els.statements)-1].RedactedStatement = string( + dependencies.AstFormatter().FormatAstAsRedactableString(an.GetStatement(), &an.annotation)) ts := scpb.TargetState{ Targets: make([]scpb.Target, 0, len(bs.output)), Statements: els.statements, @@ -70,6 +70,7 @@ func Build( } current := make([]scpb.Status, 0, len(bs.output)) version := dependencies.ClusterSettings().Version.ActiveVersion(ctx) + withLogEvent := make([]scpb.Target, 0, len(bs.output)) for _, e := range bs.output { if e.metadata.Size() == 0 { // Exclude targets which weren't explicitly set. @@ -81,8 +82,12 @@ func Build( if !version.IsActive(screl.MinVersion(e.element)) { continue } - ts.Targets = append(ts.Targets, scpb.MakeTarget(e.target, e.element, &e.metadata)) + t := scpb.MakeTarget(e.target, e.element, &e.metadata) + ts.Targets = append(ts.Targets, t) current = append(current, e.current) + if e.withLogEvent { + withLogEvent = append(withLogEvent, t) + } } // Ensure that no concurrent schema change are on going on any targets. descSet := screl.AllTargetDescIDs(ts) @@ -93,6 +98,8 @@ func Build( panic(scerrors.ConcurrentSchemaChangeError(desc)) } }) + // Write to event log and return. + logEvents(b, ts, withLogEvent) return scpb.CurrentState{TargetState: ts, Current: current}, nil } @@ -112,10 +119,11 @@ type ( ) type elementState struct { - element scpb.Element - current scpb.Status - target scpb.TargetStatus - metadata scpb.TargetMetadata + element scpb.Element + current scpb.Status + target scpb.TargetStatus + metadata scpb.TargetMetadata + withLogEvent bool } // builderState is the backing struct for scbuildstmt.BuilderState interface. @@ -207,9 +215,6 @@ type eventLogState struct { // for any new elements added. This is used for detailed // tracking during cascade operations. sourceElementID *scpb.SourceElementID - - // astFormatter used to format AST elements as redactable strings. - astFormatter AstFormatter } // newEventLogState constructs an eventLogState. @@ -230,7 +235,6 @@ func newEventLogState(d Dependencies, initial scpb.CurrentState, n tree.Statemen SubWorkID: 1, SourceElementID: 1, }, - astFormatter: d.AstFormatter(), } *els.sourceElementID = 1 return &els diff --git a/pkg/sql/schemachanger/scbuild/builder_state.go b/pkg/sql/schemachanger/scbuild/builder_state.go index 8bd17ce1cad7..716033ff7113 100644 --- a/pkg/sql/schemachanger/scbuild/builder_state.go +++ b/pkg/sql/schemachanger/scbuild/builder_state.go @@ -91,7 +91,27 @@ func (b *builderState) Ensure( metadata: meta, }) } +} +// LogEventForExistingTarget implements the scbuildstmt.BuilderState interface. +func (b *builderState) LogEventForExistingTarget(e scpb.Element) { + id := screl.GetDescID(e) + key := screl.ElementString(e) + + c, ok := b.descCache[id] + if !ok { + panic(errors.AssertionFailedf( + "elements for descriptor ID %d not found in builder state, %s expected", id, key)) + } + i, ok := c.elementIndexMap[key] + if !ok { + panic(errors.AssertionFailedf("element %s expected in builder state but not found", key)) + } + es := &b.output[i] + if es.target == scpb.InvalidTarget { + panic(errors.AssertionFailedf("no target set for element %s in builder state", key)) + } + es.withLogEvent = true } // ForEachElementStatus implements the scpb.ElementStatusIterator interface. diff --git a/pkg/sql/schemachanger/scbuild/builder_test.go b/pkg/sql/schemachanger/scbuild/builder_test.go index 1e6b55631012..7167694900a7 100644 --- a/pkg/sql/schemachanger/scbuild/builder_test.go +++ b/pkg/sql/schemachanger/scbuild/builder_test.go @@ -235,9 +235,7 @@ func (n nodeEntries) Swap(i, j int) { n[i], n[j] = n[j], n[i] } var _ sort.Interface = nodeEntries{} func formatElementForDisplay(t *testing.T, e scpb.Element) []byte { - marshaled, err := sctestutils.ProtoToYAML( - e, false /* emitDefaults */, nil, /* rewrites */ - ) + marshaled, err := sctestutils.ProtoToYAML(e, false /* emitDefaults */) require.NoError(t, err) dec := yaml.NewDecoder(strings.NewReader(marshaled)) dec.KnownFields(true) diff --git a/pkg/sql/schemachanger/scbuild/dependencies.go b/pkg/sql/schemachanger/scbuild/dependencies.go index 92652c670467..3f4f33e837ed 100644 --- a/pkg/sql/schemachanger/scbuild/dependencies.go +++ b/pkg/sql/schemachanger/scbuild/dependencies.go @@ -29,6 +29,8 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/sem/eval" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sessiondata" + "github.com/cockroachdb/cockroach/pkg/util/log/eventpb" + "github.com/cockroachdb/cockroach/pkg/util/log/logpb" "github.com/cockroachdb/cockroach/pkg/util/uuid" "github.com/cockroachdb/redact" ) @@ -77,7 +79,11 @@ type Dependencies interface { // ZoneConfigGetter returns a zone config reader. ZoneConfigGetter() ZoneConfigGetter + // ClientNoticeSender returns a eval.ClientNoticeSender. ClientNoticeSender() eval.ClientNoticeSender + + // EventLogger returns an EventLogger. + EventLogger() EventLogger } // CreatePartitioningCCLCallback is the type of the CCL callback for creating @@ -203,3 +209,14 @@ type SchemaResolverFactory func( txn *kv.Txn, authAccessor AuthorizationAccessor, ) resolver.SchemaResolver + +// EventLogger contains the dependencies required for logging schema change +// events. +type EventLogger interface { + + // LogEvent writes an event into the event log which signals the start of a + // schema change. + LogEvent( + ctx context.Context, details eventpb.CommonSQLEventDetails, event logpb.EventPayload, + ) error +} diff --git a/pkg/sql/schemachanger/scbuild/event_log.go b/pkg/sql/schemachanger/scbuild/event_log.go new file mode 100644 index 000000000000..6ed6934e95c9 --- /dev/null +++ b/pkg/sql/schemachanger/scbuild/event_log.go @@ -0,0 +1,355 @@ +// Copyright 2021 The Cockroach Authors. +// +// Use of this software is governed by the Business Source License +// included in the file licenses/BSL.txt. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the Apache License, Version 2.0, included in the file +// licenses/APL.txt. + +package scbuild + +import ( + "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scerrors" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" + "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" + "github.com/cockroachdb/cockroach/pkg/util/log/eventpb" + "github.com/cockroachdb/cockroach/pkg/util/log/logpb" + "github.com/cockroachdb/errors" + "github.com/cockroachdb/redact" +) + +var _ scbuildstmt.EventLogState = (*eventLogState)(nil) + +// TargetMetadata implements the scbuildstmt.EventLogState interface. +func (e *eventLogState) TargetMetadata() scpb.TargetMetadata { + return e.statementMetaData +} + +// IncrementSubWorkID implements the scbuildstmt.EventLogState interface. +func (e *eventLogState) IncrementSubWorkID() { + e.statementMetaData.SubWorkID++ +} + +// EventLogStateWithNewSourceElementID implements the scbuildstmt.EventLogState +// interface. +func (e *eventLogState) EventLogStateWithNewSourceElementID() scbuildstmt.EventLogState { + *e.sourceElementID++ + return &eventLogState{ + statements: e.statements, + authorization: e.authorization, + sourceElementID: e.sourceElementID, + statementMetaData: scpb.TargetMetadata{ + StatementID: e.statementMetaData.StatementID, + SubWorkID: e.statementMetaData.SubWorkID, + SourceElementID: *e.sourceElementID, + }, + } +} + +func logEvents(b buildCtx, ts scpb.TargetState, loggedTargets []scpb.Target) { + if len(loggedTargets) == 0 { + return + } + var swallowedError error + defer scerrors.StartEventf( + b.Context, + "event logging for declarative schema change targets built for %s", + redact.Safe(ts.Statements[loggedTargets[0].Metadata.StatementID].StatementTag), + ).HandlePanicAndLogError(b.Context, &swallowedError) + for _, lt := range loggedTargets { + descID := screl.GetDescID(lt.Element()) + stmtID := lt.Metadata.StatementID + details := eventpb.CommonSQLEventDetails{ + Statement: redact.RedactableString(ts.Statements[stmtID].RedactedStatement), + Tag: ts.Statements[stmtID].StatementTag, + User: ts.Authorization.UserName, + DescriptorID: uint32(descID), + ApplicationName: ts.Authorization.AppName, + } + pb := payloadBuilder{ + Target: lt, + relatedTargets: make([]scpb.Target, 0, len(ts.Targets)), + } + for _, t := range ts.Targets { + if t.Metadata.StatementID != stmtID || t.Metadata.SubWorkID != lt.Metadata.SubWorkID { + continue + } + pb.relatedTargets = append(pb.relatedTargets, t) + } + pl := pb.build(b) + if pl == nil { + continue + } + if err := b.EventLogger().LogEvent(b, details, pl); err != nil { + panic(err) + } + } +} + +type payloadBuilder struct { + relatedTargets []scpb.Target + scpb.Target +} + +func namespace(b buildCtx, id descpb.ID) (ns *scpb.Namespace) { + scpb.ForEachNamespace( + b.QueryByID(id), + func(_ scpb.Status, target scpb.TargetStatus, e *scpb.Namespace) { + if ns == nil || target != scpb.ToAbsent { + ns = e + } + }, + ) + if ns == nil { + panic(errors.AssertionFailedf("missing Namespace element for descriptor #%d", id)) + } + return ns +} + +func fullyQualifiedName(b buildCtx, e scpb.Element) string { + ns := namespace(b, screl.GetDescID(e)) + if ns.DatabaseID == descpb.InvalidID { + return ns.Name + } + nsDatabase := namespace(b, ns.DatabaseID) + if ns.SchemaID == descpb.InvalidID { + p := tree.ObjectNamePrefix{ + CatalogName: tree.Name(nsDatabase.Name), + SchemaName: tree.Name(ns.Name), + ExplicitCatalog: true, + ExplicitSchema: true, + } + return p.String() + } + nsSchema := namespace(b, ns.SchemaID) + return tree.NewTableNameWithSchema( + tree.Name(nsDatabase.Name), tree.Name(nsSchema.Name), tree.Name(ns.Name), + ).FQString() +} + +func indexName(b buildCtx, e scpb.Element) string { + tableID := screl.GetDescID(e) + indexID, err := screl.Schema.GetAttribute(screl.IndexID, e) + if err != nil { + panic(err) + } + var name *scpb.IndexName + scpb.ForEachIndexName( + b.QueryByID(tableID), + func(_ scpb.Status, target scpb.TargetStatus, e *scpb.IndexName) { + if e.IndexID == indexID && (name == nil || target != scpb.ToAbsent) { + name = e + } + }, + ) + if name == nil { + panic(errors.AssertionFailedf("missing IndexName element for table #%d and index ID #%s", + tableID, indexID)) + } + return name.Name +} + +func columnName(b buildCtx, e scpb.Element) string { + tableID := screl.GetDescID(e) + columnID, err := screl.Schema.GetAttribute(screl.ColumnID, e) + if err != nil { + panic(err) + } + var name *scpb.ColumnName + scpb.ForEachColumnName( + b.QueryByID(tableID), + func(_ scpb.Status, target scpb.TargetStatus, e *scpb.ColumnName) { + if e.ColumnID == columnID && (name == nil || target != scpb.ToAbsent) { + name = e + } + }, + ) + if name == nil { + panic(errors.AssertionFailedf("missing ColumnName element for table #%d and column ID #%s", + tableID, columnID)) + } + return name.Name +} + +func constraintName(b buildCtx, e scpb.Element) string { + tableID := screl.GetDescID(e) + constraintID, err := screl.Schema.GetAttribute(screl.ConstraintID, e) + if err != nil { + panic(err) + } + var name *scpb.ConstraintWithoutIndexName + scpb.ForEachConstraintWithoutIndexName( + b.QueryByID(tableID), + func(_ scpb.Status, target scpb.TargetStatus, e *scpb.ConstraintWithoutIndexName) { + if e.ConstraintID == constraintID && (name == nil || target != scpb.ToAbsent) { + name = e + } + }, + ) + if name == nil { + return indexName(b, e) + } + return name.Name +} + +func (pb payloadBuilder) cascadeDroppedViews(b buildCtx) (ret []string) { + descID := screl.GetDescID(pb.Element()) + for _, t := range pb.relatedTargets { + if t.TargetStatus == scpb.Status_PUBLIC { + continue + } + v, ok := t.Element().(*scpb.View) + if !ok || v.ViewID == descID { + continue + } + ret = append(ret, fullyQualifiedName(b, v)) + } + return ret +} + +func (pb payloadBuilder) droppedSchemaObjects(b buildCtx) (ret []string) { + databaseID := screl.GetDescID(pb.Element()) + for _, t := range pb.relatedTargets { + if t.TargetStatus == scpb.Status_PUBLIC { + continue + } + ns, ok := t.Element().(*scpb.Namespace) + if !ok || ns.DatabaseID != databaseID || ns.SchemaID == descpb.InvalidID { + continue + } + ret = append(ret, fullyQualifiedName(b, ns)) + } + return ret +} + +func (pb payloadBuilder) build(b buildCtx) logpb.EventPayload { + const mutationID = 1 + switch e := pb.Element().(type) { + case *scpb.Database: + if pb.TargetStatus == scpb.Status_PUBLIC { + return nil + } else { + return &eventpb.DropDatabase{ + DatabaseName: fullyQualifiedName(b, e), + DroppedSchemaObjects: pb.droppedSchemaObjects(b), + } + } + case *scpb.Schema: + if pb.TargetStatus == scpb.Status_PUBLIC { + return nil + } else { + return &eventpb.DropSchema{ + SchemaName: fullyQualifiedName(b, e), + } + } + case *scpb.Table: + if pb.TargetStatus == scpb.Status_PUBLIC { + return nil + } else { + return &eventpb.DropTable{ + TableName: fullyQualifiedName(b, e), + CascadeDroppedViews: pb.cascadeDroppedViews(b), + } + } + case *scpb.View: + if pb.TargetStatus == scpb.Status_PUBLIC { + return nil + } else { + return &eventpb.DropView{ + ViewName: fullyQualifiedName(b, e), + CascadeDroppedViews: pb.cascadeDroppedViews(b), + } + } + case *scpb.Sequence: + if pb.TargetStatus == scpb.Status_PUBLIC { + return nil + } else { + return &eventpb.DropSequence{ + SequenceName: fullyQualifiedName(b, e), + } + } + case *scpb.EnumType: + if pb.TargetStatus == scpb.Status_PUBLIC { + return nil + } else { + return &eventpb.DropType{ + TypeName: fullyQualifiedName(b, e), + } + } + case *scpb.CompositeType: + if pb.TargetStatus == scpb.Status_PUBLIC { + return nil + } else { + return &eventpb.DropType{ + TypeName: fullyQualifiedName(b, e), + } + } + case *scpb.SecondaryIndex: + if pb.TargetStatus == scpb.Status_PUBLIC { + return &eventpb.CreateIndex{ + TableName: fullyQualifiedName(b, e), + IndexName: indexName(b, e), + MutationID: mutationID, + } + } else { + return &eventpb.DropIndex{ + TableName: fullyQualifiedName(b, e), + IndexName: indexName(b, e), + MutationID: mutationID, + CascadeDroppedViews: pb.cascadeDroppedViews(b), + } + } + case *scpb.DatabaseComment: + return &eventpb.CommentOnDatabase{ + DatabaseName: fullyQualifiedName(b, e), + Comment: e.Comment, + NullComment: pb.TargetStatus != scpb.Status_PUBLIC, + } + case *scpb.SchemaComment: + return &eventpb.CommentOnSchema{ + SchemaName: fullyQualifiedName(b, e), + Comment: e.Comment, + NullComment: pb.TargetStatus != scpb.Status_PUBLIC, + } + case *scpb.TableComment: + return &eventpb.CommentOnTable{ + TableName: fullyQualifiedName(b, e), + Comment: e.Comment, + NullComment: pb.TargetStatus != scpb.Status_PUBLIC, + } + case *scpb.ColumnComment: + return &eventpb.CommentOnColumn{ + TableName: fullyQualifiedName(b, e), + ColumnName: columnName(b, e), + Comment: e.Comment, + NullComment: pb.TargetStatus != scpb.Status_PUBLIC, + } + case *scpb.IndexComment: + return &eventpb.CommentOnIndex{ + TableName: fullyQualifiedName(b, e), + IndexName: indexName(b, e), + Comment: e.Comment, + NullComment: pb.TargetStatus != scpb.Status_PUBLIC, + } + case *scpb.ConstraintComment: + return &eventpb.CommentOnConstraint{ + TableName: fullyQualifiedName(b, e), + ConstraintName: constraintName(b, e), + Comment: e.Comment, + NullComment: pb.TargetStatus != scpb.Status_PUBLIC, + } + } + if _, _, tbl := scpb.FindTable(b.QueryByID(screl.GetDescID(pb.Element()))); tbl != nil { + return &eventpb.AlterTable{ + TableName: fullyQualifiedName(b, pb.Element()), + MutationID: mutationID, + CascadeDroppedViews: pb.cascadeDroppedViews(b), + } + } + return nil +} diff --git a/pkg/sql/schemachanger/scbuild/event_log_state.go b/pkg/sql/schemachanger/scbuild/event_log_state.go deleted file mode 100644 index f827d40f0420..000000000000 --- a/pkg/sql/schemachanger/scbuild/event_log_state.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2021 The Cockroach Authors. -// -// Use of this software is governed by the Business Source License -// included in the file licenses/BSL.txt. -// -// As of the Change Date specified in that file, in accordance with -// the Business Source License, use of this software will be governed -// by the Apache License, Version 2.0, included in the file -// licenses/APL.txt. - -package scbuild - -import ( - "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild/internal/scbuildstmt" - "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" -) - -var _ scbuildstmt.EventLogState = (*eventLogState)(nil) - -// TargetMetadata implements the scbuildstmt.EventLogState interface. -func (e *eventLogState) TargetMetadata() scpb.TargetMetadata { - return e.statementMetaData -} - -// IncrementSubWorkID implements the scbuildstmt.EventLogState interface. -func (e *eventLogState) IncrementSubWorkID() { - e.statementMetaData.SubWorkID++ -} - -// EventLogStateWithNewSourceElementID implements the scbuildstmt.EventLogState -// interface. -func (e *eventLogState) EventLogStateWithNewSourceElementID() scbuildstmt.EventLogState { - *e.sourceElementID++ - return &eventLogState{ - statements: e.statements, - authorization: e.authorization, - sourceElementID: e.sourceElementID, - statementMetaData: scpb.TargetMetadata{ - StatementID: e.statementMetaData.StatementID, - SubWorkID: e.statementMetaData.SubWorkID, - SourceElementID: *e.sourceElementID, - }, - } -} diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_column.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_column.go index 8faeee36cc79..4a88570cc4fe 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_column.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_column.go @@ -248,6 +248,7 @@ func alterTableAddColumn( } addSecondaryIndexTargetsForAddColumn(b, tbl, idx, primaryIdx) } + b.LogEventForExistingTarget(spec.col) switch spec.colType.Type.Family() { case types.EnumFamily: b.IncrementEnumCounter(sqltelemetry.EnumInTable) diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_constraint.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_constraint.go index 059ad0f33894..e936b3bc75ac 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_constraint.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_add_constraint.go @@ -115,14 +115,16 @@ func alterTableAddCheck( // 3. Add relevant check constraint element: CheckConstraint and ConstraintName. constraintID := b.NextTableConstraintID(tbl.TableID) - b.Add(&scpb.CheckConstraint{ + ck := &scpb.CheckConstraint{ TableID: tbl.TableID, ConstraintID: constraintID, ColumnIDs: colIDs.Ordered(), Expression: *b.WrapExpression(tbl.TableID, typedCkExpr), FromHashShardedColumn: ckDef.FromHashShardedColumn, IndexIDForValidation: getIndexIDForValidationForConstraint(b, tbl.TableID), - }) + } + b.Add(ck) + b.LogEventForExistingTarget(ck) constraintName := string(ckDef.Name) if constraintName == "" { @@ -357,7 +359,7 @@ func alterTableAddForeignKey( // 12. (Finally!) Add a ForeignKey_Constraint, ConstraintName element to // builder state. constraintID := b.NextTableConstraintID(tbl.TableID) - b.Add(&scpb.ForeignKeyConstraint{ + fk := &scpb.ForeignKeyConstraint{ TableID: tbl.TableID, ConstraintID: constraintID, ColumnIDs: originColIDs, @@ -367,7 +369,9 @@ func alterTableAddForeignKey( OnDeleteAction: tree.ForeignKeyReferenceActionValue[fkDef.Actions.Delete], CompositeKeyMatchMethod: tree.CompositeKeyMatchMethodValue[fkDef.Match], IndexIDForValidation: getIndexIDForValidationForConstraint(b, tbl.TableID), - }) + } + b.Add(fk) + b.LogEventForExistingTarget(fk) b.Add(&scpb.ConstraintWithoutIndexName{ TableID: tbl.TableID, ConstraintID: constraintID, @@ -469,6 +473,7 @@ func alterTableAddUniqueWithoutIndex( uwi.Predicate = b.WrapExpression(tbl.TableID, d.Predicate) } b.Add(uwi) + b.LogEventForExistingTarget(uwi) b.Add(&scpb.ConstraintWithoutIndexName{ TableID: tbl.TableID, ConstraintID: constraintID, diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_alter_primary_key.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_alter_primary_key.go index 7bbaa1b2a4c2..ae48396a7313 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_alter_primary_key.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_alter_primary_key.go @@ -172,6 +172,7 @@ func alterPrimaryKey(b BuildCtx, tn *tree.TableName, tbl *scpb.Table, t alterPri newPrimaryIndexElem = in.primary sourcePrimaryIndexElem = union.primary } + b.LogEventForExistingTarget(newPrimaryIndexElem) // Recreate all secondary indexes. recreateAllSecondaryIndexes(b, tbl, newPrimaryIndexElem, sourcePrimaryIndexElem) diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go index c5a2ae277380..8fdebc503322 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/alter_table_drop_column.go @@ -41,6 +41,7 @@ func alterTableDropColumn( checkRowLevelTTLColumn(b, tn, tbl, n, col) checkColumnNotInaccessible(col, n) dropColumn(b, tn, tbl, n, col, elts, n.DropBehavior) + b.LogEventForExistingTarget(col) } func checkSafeUpdatesForDropColumn(b BuildCtx) { diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/comment_on.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/comment_on.go index f337c3c28eab..f02a0c961b1f 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/comment_on.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/comment_on.go @@ -34,6 +34,7 @@ func CommentOnDatabase(b BuildCtx, n *tree.CommentOnDatabase) { switch e.(type) { case *scpb.DatabaseComment: b.Drop(e) + b.LogEventForExistingTarget(e) } }) } else { @@ -47,6 +48,7 @@ func CommentOnDatabase(b BuildCtx, n *tree.CommentOnDatabase) { } }) b.Add(dc) + b.LogEventForExistingTarget(dc) } } @@ -59,6 +61,7 @@ func CommentOnSchema(b BuildCtx, n *tree.CommentOnSchema) { switch e.(type) { case *scpb.SchemaComment: b.Drop(e) + b.LogEventForExistingTarget(e) } }) } else { @@ -72,6 +75,7 @@ func CommentOnSchema(b BuildCtx, n *tree.CommentOnSchema) { } }) b.Add(sc) + b.LogEventForExistingTarget(sc) } } @@ -91,6 +95,7 @@ func CommentOnTable(b BuildCtx, n *tree.CommentOnTable) { _, _, tableComment := scpb.FindTableComment(tableElements) if tableComment != nil { b.Drop(tableComment) + b.LogEventForExistingTarget(tableComment) } } else { _, _, table := scpb.FindTable(tableElements) @@ -99,6 +104,7 @@ func CommentOnTable(b BuildCtx, n *tree.CommentOnTable) { TableID: table.TableID, } b.Add(tc) + b.LogEventForExistingTarget(tc) } } @@ -116,6 +122,7 @@ func CommentOnColumn(b BuildCtx, n *tree.CommentOnColumn) { switch e.(type) { case *scpb.ColumnComment: b.Drop(e) + b.LogEventForExistingTarget(e) } }) } else { @@ -131,6 +138,7 @@ func CommentOnColumn(b BuildCtx, n *tree.CommentOnColumn) { } }) b.Add(cc) + b.LogEventForExistingTarget(cc) } } @@ -150,6 +158,7 @@ func CommentOnIndex(b BuildCtx, n *tree.CommentOnIndex) { switch e.(type) { case *scpb.IndexComment: b.Drop(e) + b.LogEventForExistingTarget(e) } }) } else { @@ -165,6 +174,7 @@ func CommentOnIndex(b BuildCtx, n *tree.CommentOnIndex) { } }) b.Add(ic) + b.LogEventForExistingTarget(ic) } } @@ -180,6 +190,7 @@ func CommentOnConstraint(b BuildCtx, n *tree.CommentOnConstraint) { switch e.(type) { case *scpb.ConstraintComment: b.Drop(e) + b.LogEventForExistingTarget(e) } }) } else { @@ -196,5 +207,6 @@ func CommentOnConstraint(b BuildCtx, n *tree.CommentOnConstraint) { } }) b.Add(cc) + b.LogEventForExistingTarget(cc) } } diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go index da856d7a039e..d5ba398c9841 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/create_index.go @@ -201,6 +201,7 @@ func CreateIndex(b BuildCtx, n *tree.CreateIndex) { } idxSpec.data = &scpb.IndexData{TableID: idxSpec.secondary.TableID, IndexID: idxSpec.secondary.IndexID} idxSpec.apply(b.Add) + b.LogEventForExistingTarget(idxSpec.secondary) // Apply the name once everything else has been created since we need // elements to be added, so that getImplicitSecondaryIndexName can make // an implicit name if one is required. diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/dependencies.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/dependencies.go index 2d180a31ee74..bead092c33d8 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/dependencies.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/dependencies.go @@ -81,6 +81,11 @@ type BuilderState interface { // Ensure ensures the presence of the given element in the BuilderState with // the given statuses and metadata. Ensure(current scpb.Status, target scpb.TargetStatus, elem scpb.Element, meta scpb.TargetMetadata) + + // LogEventForExistingTarget tells the builder to write an entry in the event + // log for the existing target corresponding to the provided element. + // An error is thrown if no such target exists. + LogEventForExistingTarget(element scpb.Element) } // EventLogState encapsulates the state of the metadata to decorate the eventlog diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_database.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_database.go index d0e514c1740f..5a38b0c845db 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_database.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_database.go @@ -36,10 +36,12 @@ func DropDatabase(b BuildCtx, n *tree.DropDatabase) { // Perform explicit or implicit DROP DATABASE CASCADE. if n.DropBehavior == tree.DropCascade || (n.DropBehavior == tree.DropDefault && !b.SessionData().SafeUpdates) { dropCascadeDescriptor(b, db.DatabaseID) + b.LogEventForExistingTarget(db) return } // Otherwise, perform DROP DATABASE RESTRICT. if !dropRestrictDescriptor(b, db.DatabaseID) { + b.LogEventForExistingTarget(db) return } // Implicitly DROP RESTRICT the public schema as well. diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_index.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_index.go index bdf7b235b9da..b3b2915d28c9 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_index.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_index.go @@ -48,7 +48,10 @@ func DropIndex(b BuildCtx, n *tree.DropIndex) { var anyIndexesDropped bool for _, index := range n.IndexList { - anyIndexesDropped = dropAnIndex(b, index, n.IfExists, n.DropBehavior) || anyIndexesDropped + if droppedIndex := maybeDropIndex(b, index, n.IfExists, n.DropBehavior); droppedIndex != nil { + b.LogEventForExistingTarget(droppedIndex) + anyIndexesDropped = true + } // Increment subwork ID so we know exactly which portion in // a `DROP INDEX index1, index2, ...` statement is responsible // for the creation of the targets. @@ -67,11 +70,11 @@ func DropIndex(b BuildCtx, n *tree.DropIndex) { } } -// dropAnIndex resolves `index` and mark its constituent elements as ToAbsent +// maybeDropIndex resolves `index` and mark its constituent elements as ToAbsent // in the builder state enclosed by `b`. -func dropAnIndex( +func maybeDropIndex( b BuildCtx, indexName *tree.TableIndexName, ifExists bool, dropBehavior tree.DropBehavior, -) (indexDropped bool) { +) (droppedIndex *scpb.SecondaryIndex) { toBeDroppedIndexElms := b.ResolveIndexByName(indexName, ResolveParams{ IsExistenceOptional: ifExists, RequiredPrivilege: privilege.CREATE, @@ -79,7 +82,7 @@ func dropAnIndex( if toBeDroppedIndexElms == nil { // Attempt to resolve this index failed but `IF EXISTS` is set. b.MarkNameAsNonExistent(&indexName.Table) - return false + return nil } // Panic if dropping primary index. _, _, pie := scpb.FindPrimaryIndex(toBeDroppedIndexElms) @@ -107,7 +110,7 @@ func dropAnIndex( )) } dropSecondaryIndex(b, indexName, dropBehavior, sie) - return true + return sie } // dropSecondaryIndex is a helper to drop a secondary index which may be used diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_schema.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_schema.go index 25d2309596e8..625b8e5f6d33 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_schema.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_schema.go @@ -49,6 +49,7 @@ func DropSchema(b BuildCtx, n *tree.DropSchema) { } else if dropRestrictDescriptor(b, sc.SchemaID) { toCheckBackrefs = append(toCheckBackrefs, sc.SchemaID) } + b.LogEventForExistingTarget(sc) b.IncrementSubWorkID() b.IncrementSchemaChangeDropCounter("schema") b.IncrementUserDefinedSchemaCounter(sqltelemetry.UserDefinedSchemaDrop) diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_sequence.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_sequence.go index 6940d4b12954..792be018c743 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_sequence.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_sequence.go @@ -53,6 +53,7 @@ func DropSequence(b BuildCtx, n *tree.DropSequence) { ) toCheckBackrefs = append(toCheckBackrefs, seq.SequenceID) } + b.LogEventForExistingTarget(seq) b.IncrementSubWorkID() b.IncrementSchemaChangeDropCounter("sequence") } diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_table.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_table.go index 2a493c27e40d..5236cd4f457e 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_table.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_table.go @@ -67,6 +67,7 @@ func DropTable(b BuildCtx, n *tree.DropTable) { droppedOwnedSequences[tbl.TableID] = ownedIDs } } + b.LogEventForExistingTarget(tbl) b.IncrementSubWorkID() b.IncrementSchemaChangeDropCounter("table") } diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_type.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_type.go index 8dc16b54c4b7..38a970965745 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_type.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_type.go @@ -63,6 +63,7 @@ func DropType(b BuildCtx, n *tree.DropType) { arrayTypesToAlsoCheck[typeID] = arrayTypeID } } + b.LogEventForExistingTarget(typ) b.IncrementSubWorkID() } // Check if there are any back-references which would prevent a DROP RESTRICT. diff --git a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_view.go b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_view.go index 8b4c54a100ac..c5b974c5b545 100644 --- a/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_view.go +++ b/pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_view.go @@ -55,6 +55,7 @@ func DropView(b BuildCtx, n *tree.DropView) { } else if dropRestrictDescriptor(b, view.ViewID) { toCheckBackrefs = append(toCheckBackrefs, view.ViewID) } + b.LogEventForExistingTarget(view) b.IncrementSubWorkID() if view.IsMaterialized { b.IncrementSchemaChangeDropCounter("materialized_view") diff --git a/pkg/sql/schemachanger/scdeps/build_deps.go b/pkg/sql/schemachanger/scdeps/build_deps.go index af2f56022eb2..8042972e493e 100644 --- a/pkg/sql/schemachanger/scdeps/build_deps.go +++ b/pkg/sql/schemachanger/scdeps/build_deps.go @@ -51,6 +51,7 @@ func NewBuilderDependencies( settings *cluster.Settings, statements []string, clientNoticeSender eval.ClientNoticeSender, + eventLogger scbuild.EventLogger, ) scbuild.Dependencies { return &buildDeps{ clusterID: clusterID, @@ -67,6 +68,7 @@ func NewBuilderDependencies( txn.Descriptors(), sessiondata.NewStack(sessionData), txn.KV(), authAccessor, ), clientNoticeSender: clientNoticeSender, + eventLogger: eventLogger, } } @@ -83,6 +85,7 @@ type buildDeps struct { astFormatter scbuild.AstFormatter featureChecker scbuild.FeatureChecker clientNoticeSender eval.ClientNoticeSender + eventLogger scbuild.EventLogger } var _ scbuild.CatalogReader = (*buildDeps)(nil) @@ -390,6 +393,11 @@ func (d *buildDeps) ClientNoticeSender() eval.ClientNoticeSender { return d.clientNoticeSender } +// EventLogger implements the scbuild.Dependencies interface. +func (d *buildDeps) EventLogger() scbuild.EventLogger { + return d.eventLogger +} + type zoneConfigGetter struct { txn *kv.Txn descriptors *descs.Collection diff --git a/pkg/sql/schemachanger/scdeps/exec_deps.go b/pkg/sql/schemachanger/scdeps/exec_deps.go index a1c6874ec510..bf68a1ab04f2 100644 --- a/pkg/sql/schemachanger/scdeps/exec_deps.go +++ b/pkg/sql/schemachanger/scdeps/exec_deps.go @@ -65,7 +65,6 @@ func NewExecutorDependencies( validator scexec.Validator, clock scmutationexec.Clock, metadataUpdater scexec.DescriptorMetadataUpdater, - eventLogger scexec.EventLogger, statsRefresher scexec.StatsRefresher, testingKnobs *scexec.TestingKnobs, kvTrace bool, @@ -79,7 +78,6 @@ func NewExecutorDependencies( descsCollection: descsCollection, jobRegistry: jobRegistry, validator: validator, - eventLogger: eventLogger, statsRefresher: statsRefresher, schemaChangerJobID: schemaChangerJobID, schemaChangerJob: nil, @@ -108,7 +106,6 @@ type txnDeps struct { validator scexec.Validator statsRefresher scexec.StatsRefresher tableStatsToRefresh []descpb.ID - eventLogger scexec.EventLogger schemaChangerJobID jobspb.JobID schemaChangerJob *jobs.Job kvTrace bool @@ -402,17 +399,9 @@ func (d *execDeps) DescriptorMetadataUpdater(ctx context.Context) scexec.Descrip return d.metadataUpdater } -// EventLoggerFactory constructs a new event logger with a txn. -type EventLoggerFactory = func(isql.Txn) scexec.EventLogger - // MetadataUpdaterFactory constructs a new metadata updater with a txn. type MetadataUpdaterFactory = func(ctx context.Context, descriptors *descs.Collection, txn isql.Txn) scexec.DescriptorMetadataUpdater -// EventLogger implements scexec.Dependencies -func (d *execDeps) EventLogger() scexec.EventLogger { - return d.eventLogger -} - // GetTestingKnobs implements scexec.Dependencies func (d *execDeps) GetTestingKnobs() *scexec.TestingKnobs { return d.testingKnobs diff --git a/pkg/sql/schemachanger/scdeps/run_deps.go b/pkg/sql/schemachanger/scdeps/run_deps.go index f2011295175d..14773d2f7627 100644 --- a/pkg/sql/schemachanger/scdeps/run_deps.go +++ b/pkg/sql/schemachanger/scdeps/run_deps.go @@ -36,7 +36,7 @@ func NewJobRunDependencies( backfiller scexec.Backfiller, merger scexec.Merger, rangeCounter backfiller.RangeCounter, - eventLoggerFactory EventLoggerFactory, + eventLoggerFactory func(isql.Txn) scrun.EventLogger, jobRegistry *jobs.Registry, job *jobs.Job, codec keys.SQLCodec, @@ -73,12 +73,12 @@ func NewJobRunDependencies( type jobExecutionDeps struct { collectionFactory *descs.CollectionFactory db descs.DB - eventLoggerFactory func(txn isql.Txn) scexec.EventLogger statsRefresher scexec.StatsRefresher backfiller scexec.Backfiller merger scexec.Merger commentUpdaterFactory MetadataUpdaterFactory rangeCounter backfiller.RangeCounter + eventLoggerFactory func(isql.Txn) scrun.EventLogger jobRegistry *jobs.Registry job *jobs.Job kvTrace bool @@ -114,7 +114,6 @@ func (d *jobExecutionDeps) WithTxnInJob(ctx context.Context, fn scrun.JobTxnFunc descsCollection: txn.Descriptors(), jobRegistry: d.jobRegistry, validator: d.indexValidator, - eventLogger: d.eventLoggerFactory(txn), statsRefresher: d.statsRefresher, schemaChangerJobID: d.job.ID(), schemaChangerJob: d.job, @@ -138,7 +137,7 @@ func (d *jobExecutionDeps) WithTxnInJob(ctx context.Context, fn scrun.JobTxnFunc sessionData: d.sessionData, testingKnobs: d.testingKnobs, } - if err := fn(ctx, ed); err != nil { + if err := fn(ctx, ed, d.eventLoggerFactory(txn)); err != nil { return err } createdJobs = ed.CreatedJobs() diff --git a/pkg/sql/schemachanger/scdeps/sctestdeps/test_deps.go b/pkg/sql/schemachanger/scdeps/sctestdeps/test_deps.go index 58f97ffb570f..5e214d290a3d 100644 --- a/pkg/sql/schemachanger/scdeps/sctestdeps/test_deps.go +++ b/pkg/sql/schemachanger/scdeps/sctestdeps/test_deps.go @@ -14,6 +14,7 @@ import ( "context" "fmt" "sort" + "strings" "time" "github.com/cockroachdb/cockroach/pkg/clusterversion" @@ -33,6 +34,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/privilege" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scdeps" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scdeps/sctestutils" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec/scmutationexec" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scop" @@ -46,6 +48,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/iterutil" "github.com/cockroachdb/cockroach/pkg/util/log/eventpb" "github.com/cockroachdb/cockroach/pkg/util/log/logpb" + "github.com/cockroachdb/cockroach/pkg/util/protoutil" "github.com/cockroachdb/cockroach/pkg/util/uuid" "github.com/cockroachdb/errors" "github.com/lib/pq/oid" @@ -1005,7 +1008,7 @@ var _ scrun.JobRunDependencies = (*TestState)(nil) // WithTxnInJob implements the scrun.JobRunDependencies interface. func (s *TestState) WithTxnInJob(ctx context.Context, fn scrun.JobTxnFunc) (err error) { - s.WithTxn(func(s *TestState) { err = fn(ctx, s) }) + s.WithTxn(func(s *TestState) { err = fn(ctx, s, s) }) return err } @@ -1071,23 +1074,52 @@ func (s *TestState) ValidateForeignKeyConstraint( return nil } -// LogEvent implements scexec.EventLogger. +// EventLogger implements scbuild.Dependencies. +func (s *TestState) EventLogger() scbuild.EventLogger { + return s +} + +var _ scbuild.EventLogger = (*TestState)(nil) + +// LogEvent implements scbuild.EventLogger. func (s *TestState) LogEvent( _ context.Context, details eventpb.CommonSQLEventDetails, event logpb.EventPayload, ) error { - s.LogSideEffectf("write %T to event log: %s", event, details.Statement) - return nil + sqlCommon, ok := event.(eventpb.EventWithCommonSQLPayload) + if !ok { + return errors.AssertionFailedf("invalid event type, missing SQL payload: %T", event) + } + *sqlCommon.CommonSQLDetails() = details + return s.logEvent(event) } -// LogEventForSchemaChange implements scexec.EventLogger -func (s *TestState) LogEventForSchemaChange(ctx context.Context, event logpb.EventPayload) error { - s.LogSideEffectf("write %T to event log", event) - return nil +// LogEventForSchemaChange implements scrun.EventLogger +func (s *TestState) LogEventForSchemaChange(_ context.Context, event logpb.EventPayload) error { + _, ok := event.(eventpb.EventWithCommonSchemaChangePayload) + if !ok { + return errors.AssertionFailedf("invalid event type, missing schema change payload: %T", event) + } + return s.logEvent(event) } -// EventLogger implements scexec.Dependencies. -func (s *TestState) EventLogger() scexec.EventLogger { - return s +func (s *TestState) logEvent(event logpb.EventPayload) error { + pb, ok := event.(protoutil.Message) + if !ok { + return errors.AssertionFailedf("invalid type, not a protobuf message: %T", event) + } + const emitDefaults = false + yaml, err := sctestutils.ProtoToYAML(pb, emitDefaults, func(in interface{}) { + // Remove common details from text output, they're never decorated. + if inM, ok := in.(map[string]interface{}); ok { + delete(inM, "common") + } + }) + if err != nil { + return err + } + indented := strings.TrimSpace(strings.ReplaceAll(yaml, "\n", "\n ")) + s.LogSideEffectf("write %T to event log:\n %s", event, indented) + return err } // DeleteDatabaseRoleSettings implements scexec.DescriptorMetadataUpdater. @@ -1098,7 +1130,7 @@ func (s *TestState) DeleteDatabaseRoleSettings(_ context.Context, dbID descpb.ID // DeleteSchedule implements scexec.DescriptorMetadataUpdater func (s *TestState) DeleteSchedule(ctx context.Context, id int64) error { - s.LogSideEffectf("delete scheduleId: %d", id) + s.LogSideEffectf("delete job schedule #%d", id) return nil } diff --git a/pkg/sql/schemachanger/scdeps/sctestutils/sctestutils.go b/pkg/sql/schemachanger/scdeps/sctestutils/sctestutils.go index 345ec7fc317b..f89563452efd 100644 --- a/pkg/sql/schemachanger/scdeps/sctestutils/sctestutils.go +++ b/pkg/sql/schemachanger/scdeps/sctestutils/sctestutils.go @@ -85,6 +85,7 @@ func WithBuilderDependenciesFromTestServer( execCfg.Settings, nil, /* statements */ &faketreeeval.DummyClientNoticeSender{}, + sql.NewSchemaChangerBuildEventLogger(planner.InternalSQLTxn(), &execCfg), )) } @@ -94,15 +95,15 @@ func WithBuilderDependenciesFromTestServer( // decoding that into a map[string]interface{}. The function will be called // for every object in the decoded map recursively. func ProtoToYAML( - m protoutil.Message, emitDefaults bool, rewrites func(interface{}), + m protoutil.Message, emitDefaults bool, rewrites ...func(interface{}), ) (string, error) { target, err := scviz.ToMap(m, emitDefaults) if err != nil { return "", err } scviz.WalkMap(target, scviz.RewriteEmbeddedIntoParent) - if rewrites != nil { - scviz.WalkMap(target, rewrites) + for _, rewrite := range rewrites { + scviz.WalkMap(target, rewrite) } out, err := yaml.Marshal(target) if err != nil { @@ -150,12 +151,12 @@ func Diff(a, b string, args DiffArgs) string { // ProtoDiff generates an indented summary of the diff between two protos' // YAML representations. See ProtoToYAML for documentation on rewrites. -func ProtoDiff(a, b protoutil.Message, args DiffArgs, rewrites func(interface{})) string { +func ProtoDiff(a, b protoutil.Message, args DiffArgs, rewrites ...func(interface{})) string { toYAML := func(m protoutil.Message) string { if m == nil { return "" } - str, err := ProtoToYAML(m, false /* emitDefaults */, rewrites) + str, err := ProtoToYAML(m, false /* emitDefaults */, rewrites...) if err != nil { panic(err) } diff --git a/pkg/sql/schemachanger/scexec/BUILD.bazel b/pkg/sql/schemachanger/scexec/BUILD.bazel index f9d8d9e598b9..850a4083b4b8 100644 --- a/pkg/sql/schemachanger/scexec/BUILD.bazel +++ b/pkg/sql/schemachanger/scexec/BUILD.bazel @@ -97,8 +97,6 @@ go_test( "//pkg/util/iterutil", "//pkg/util/leaktest", "//pkg/util/log", - "//pkg/util/log/eventpb", - "//pkg/util/log/logpb", "//pkg/util/randutil", "//pkg/util/timeutil", "@com_github_golang_mock//gomock", diff --git a/pkg/sql/schemachanger/scexec/dependencies.go b/pkg/sql/schemachanger/scexec/dependencies.go index 1b5e43836266..1a1c9f3ac3c5 100644 --- a/pkg/sql/schemachanger/scexec/dependencies.go +++ b/pkg/sql/schemachanger/scexec/dependencies.go @@ -26,8 +26,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec/scmutationexec" "github.com/cockroachdb/cockroach/pkg/sql/sessiondata" "github.com/cockroachdb/cockroach/pkg/util/hlc" - "github.com/cockroachdb/cockroach/pkg/util/log/eventpb" - "github.com/cockroachdb/cockroach/pkg/util/log/logpb" ) // Dependencies contains all the dependencies required by the executor. @@ -41,7 +39,6 @@ type Dependencies interface { PeriodicProgressFlusher() PeriodicProgressFlusher Validator() Validator IndexSpanSplitter() IndexSpanSplitter - EventLogger() EventLogger DescriptorMetadataUpdater(ctx context.Context) DescriptorMetadataUpdater StatsRefresher() StatsRefreshQueue GetTestingKnobs() *TestingKnobs @@ -72,21 +69,6 @@ type Catalog interface { NewCatalogChangeBatcher() CatalogChangeBatcher } -// EventLogger encapsulates the operations for emitting event log entries. -type EventLogger interface { - // LogEvent writes to the event log. - LogEvent( - ctx context.Context, - details eventpb.CommonSQLEventDetails, - event logpb.EventPayload, - ) error - - // LogEventForSchemaChange write a schema change event entry into the event log. - LogEventForSchemaChange( - ctx context.Context, event logpb.EventPayload, - ) error -} - // Telemetry encapsulates metrics gather for the declarative schema changer. type Telemetry interface { // IncrementSchemaChangeErrorType increments the number of errors of a given diff --git a/pkg/sql/schemachanger/scexec/exec_mutation.go b/pkg/sql/schemachanger/scexec/exec_mutation.go index 8645ea9146c4..268e77f11ed0 100644 --- a/pkg/sql/schemachanger/scexec/exec_mutation.go +++ b/pkg/sql/schemachanger/scexec/exec_mutation.go @@ -12,7 +12,6 @@ package scexec import ( "context" - "sort" "strings" "github.com/cockroachdb/cockroach/pkg/jobs" @@ -68,9 +67,6 @@ func executeDescriptorMutationOps(ctx context.Context, deps Dependencies, ops [] ); err != nil { return err } - if err := logEvents(ctx, mvs, deps.EventLogger()); err != nil { - return err - } if err := updateDescriptorMetadata( ctx, mvs, deps.DescriptorMetadataUpdater(ctx), ); err != nil { @@ -154,120 +150,6 @@ func performBatchedCatalogWrites( return b.ValidateAndRun(ctx) } -func logEvents(ctx context.Context, mvs *mutationVisitorState, el EventLogger) error { - statementIDs := make([]uint32, 0, len(mvs.eventsByStatement)) - for statementID := range mvs.eventsByStatement { - statementIDs = append(statementIDs, statementID) - } - sort.Slice(statementIDs, func(i, j int) bool { - return statementIDs[i] < statementIDs[j] - }) - for _, statementID := range statementIDs { - entries := eventLogEntriesForStatement(mvs.eventsByStatement[statementID]) - for _, e := range entries { - // TODO(postamar): batch these - switch e.event.(type) { - case eventpb.EventWithCommonSQLPayload: - details := e.details - details.DescriptorID = uint32(e.id) - if err := el.LogEvent(ctx, details, e.event); err != nil { - return err - } - case eventpb.EventWithCommonSchemaChangePayload: - if err := el.LogEventForSchemaChange(ctx, e.event); err != nil { - return err - } - } - - } - } - return nil -} - -func eventLogEntriesForStatement(statementEvents []eventPayload) (logEntries []eventPayload) { - // A dependent event is one which is generated because of a - // dependency getting modified from the source object. An example - // of this is a DROP TABLE will be the source event, which will track - // any dependent views dropped. - var dependentEvents = make(map[uint32][]eventPayload) - var sourceEvents = make(map[uint32]eventPayload) - // First separate out events, where the first event generated will always - // be the source and everything else before will be dependencies if they have - // the same subtask ID. - for _, event := range statementEvents { - dependentEvents[event.SubWorkID] = append(dependentEvents[event.SubWorkID], event) - } - // Split of the source events. - orderedSubWorkID := make([]uint32, 0, len(dependentEvents)) - for subWorkID := range dependentEvents { - elems := dependentEvents[subWorkID] - sort.SliceStable(elems, func(i, j int) bool { - return elems[i].SourceElementID < elems[j].SourceElementID - }) - sourceEvents[subWorkID] = elems[0] - dependentEvents[subWorkID] = elems[1:] - orderedSubWorkID = append(orderedSubWorkID, subWorkID) - } - // Store an ordered list of sub-work IDs for deterministic - // event order. - sort.SliceStable(orderedSubWorkID, func(i, j int) bool { - return orderedSubWorkID[i] < orderedSubWorkID[j] - }) - // Collect the dependent objects for each - // source event, and generate an event log entry. - for _, subWorkID := range orderedSubWorkID { - // Determine which objects we should collect. - collectDependentViewNames := false - collectDependentTables := false - collectDependentSequences := false - sourceEvent := sourceEvents[subWorkID] - switch sourceEvent.event.(type) { - case *eventpb.DropDatabase: - // Log each of the objects that are dropped. - collectDependentViewNames = true - collectDependentTables = true - collectDependentSequences = true - case *eventpb.DropView, *eventpb.DropTable, *eventpb.DropIndex: - // Drop view and drop tables only cares about - // dependent views - collectDependentViewNames = true - } - var dependentObjects []string - for _, dependentEvent := range dependentEvents[subWorkID] { - switch ev := dependentEvent.event.(type) { - case *eventpb.DropSequence: - if collectDependentSequences { - dependentObjects = append(dependentObjects, ev.SequenceName) - } - case *eventpb.DropTable: - if collectDependentTables { - dependentObjects = append(dependentObjects, ev.TableName) - } - case *eventpb.DropView: - if collectDependentViewNames { - dependentObjects = append(dependentObjects, ev.ViewName) - } - } - } - // Add anything that we determined based - // on the dependencies. - switch ev := sourceEvent.event.(type) { - case *eventpb.DropTable: - ev.CascadeDroppedViews = dependentObjects - case *eventpb.DropView: - ev.CascadeDroppedViews = dependentObjects - case *eventpb.DropDatabase: - ev.DroppedSchemaObjects = dependentObjects - case *eventpb.DropIndex: - ev.CascadeDroppedViews = dependentObjects - } - // Generate event log entries for the source event only. The dependent - // events will be ignored. - logEntries = append(logEntries, sourceEvent) - } - return logEntries -} - // updateDescriptorMetadata performs the portions of the side effects of the // operations delegated to the DescriptorMetadataUpdater. func updateDescriptorMetadata( diff --git a/pkg/sql/schemachanger/scexec/executor_external_test.go b/pkg/sql/schemachanger/scexec/executor_external_test.go index b60c64c41568..2871ad72b11d 100644 --- a/pkg/sql/schemachanger/scexec/executor_external_test.go +++ b/pkg/sql/schemachanger/scexec/executor_external_test.go @@ -40,8 +40,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/testutils/sqlutils" "github.com/cockroachdb/cockroach/pkg/testutils/testcluster" "github.com/cockroachdb/cockroach/pkg/util/leaktest" - "github.com/cockroachdb/cockroach/pkg/util/log/eventpb" - "github.com/cockroachdb/cockroach/pkg/util/log/logpb" "github.com/cockroachdb/cockroach/pkg/util/timeutil" "github.com/stretchr/testify/require" ) @@ -73,7 +71,6 @@ func (ti testInfra) newExecDeps(txn descs.Txn) scexec.Dependencies { noopValidator{}, scdeps.NewConstantClock(timeutil.Now()), noopMetadataUpdater{}, - noopEventLogger{}, noopStatsReferesher{}, &scexec.TestingKnobs{}, kvTrace, @@ -462,22 +459,10 @@ func (noopValidator) ValidateConstraint( return nil } -type noopEventLogger struct{} - -var _ scexec.EventLogger = noopEventLogger{} - -func (noopEventLogger) LogEvent( - _ context.Context, _ eventpb.CommonSQLEventDetails, _ logpb.EventPayload, -) error { - return nil -} - -func (noopEventLogger) LogEventForSchemaChange(_ context.Context, _ logpb.EventPayload) error { - return nil -} - type noopStatsReferesher struct{} +var _ scexec.StatsRefresher = noopStatsReferesher{} + func (noopStatsReferesher) NotifyMutation(table catalog.TableDescriptor, rowsAffected int) { } @@ -494,9 +479,3 @@ func (noopMetadataUpdater) DeleteDatabaseRoleSettings(ctx context.Context, dbID func (noopMetadataUpdater) DeleteSchedule(ctx context.Context, scheduleID int64) error { return nil } - -var _ scexec.Backfiller = noopBackfiller{} -var _ scexec.Validator = noopValidator{} -var _ scexec.EventLogger = noopEventLogger{} -var _ scexec.StatsRefresher = noopStatsReferesher{} -var _ scexec.DescriptorMetadataUpdater = noopMetadataUpdater{} diff --git a/pkg/sql/schemachanger/scexec/mocks_generated_test.go b/pkg/sql/schemachanger/scexec/mocks_generated_test.go index 95e99079e088..73005570134e 100644 --- a/pkg/sql/schemachanger/scexec/mocks_generated_test.go +++ b/pkg/sql/schemachanger/scexec/mocks_generated_test.go @@ -209,20 +209,6 @@ func (mr *MockDependenciesMockRecorder) DescriptorMetadataUpdater(arg0 interface return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescriptorMetadataUpdater", reflect.TypeOf((*MockDependencies)(nil).DescriptorMetadataUpdater), arg0) } -// EventLogger mocks base method. -func (m *MockDependencies) EventLogger() scexec.EventLogger { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "EventLogger") - ret0, _ := ret[0].(scexec.EventLogger) - return ret0 -} - -// EventLogger indicates an expected call of EventLogger. -func (mr *MockDependenciesMockRecorder) EventLogger() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EventLogger", reflect.TypeOf((*MockDependencies)(nil).EventLogger)) -} - // GetTestingKnobs mocks base method. func (m *MockDependencies) GetTestingKnobs() *scexec.TestingKnobs { m.ctrl.T.Helper() diff --git a/pkg/sql/schemachanger/scexec/scmutationexec/BUILD.bazel b/pkg/sql/schemachanger/scexec/scmutationexec/BUILD.bazel index 08b68db59921..ec024da5c5ef 100644 --- a/pkg/sql/schemachanger/scexec/scmutationexec/BUILD.bazel +++ b/pkg/sql/schemachanger/scexec/scmutationexec/BUILD.bazel @@ -9,7 +9,6 @@ go_library( "constraint.go", "dependencies.go", "drop.go", - "eventlog.go", "helpers.go", "index.go", "references.go", @@ -35,7 +34,6 @@ go_library( "//pkg/sql/parser", "//pkg/sql/schemachanger/scop", "//pkg/sql/schemachanger/scpb", - "//pkg/sql/schemachanger/screl", "//pkg/sql/sem/catid", "//pkg/sql/sem/tree", "//pkg/sql/types", @@ -45,7 +43,6 @@ go_library( "//pkg/util/protoutil", "//pkg/util/timeutil", "@com_github_cockroachdb_errors//:errors", - "@com_github_cockroachdb_redact//:redact", ], ) diff --git a/pkg/sql/schemachanger/scexec/scmutationexec/column.go b/pkg/sql/schemachanger/scexec/scmutationexec/column.go index 9457f91a1c95..5a8bc107afe0 100644 --- a/pkg/sql/schemachanger/scexec/scmutationexec/column.go +++ b/pkg/sql/schemachanger/scexec/scmutationexec/column.go @@ -20,10 +20,8 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scop" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" - "github.com/cockroachdb/cockroach/pkg/util/log/eventpb" "github.com/cockroachdb/cockroach/pkg/util/protoutil" "github.com/cockroachdb/errors" - "github.com/cockroachdb/redact" ) func (m *visitor) MakeAbsentColumnDeleteOnly( @@ -106,13 +104,11 @@ func (m *visitor) MakeWriteOnlyColumnPublic( if err != nil { return err } - mut, err := m.removeMutation(tbl, MakeColumnIDMutationSelector(op.ColumnID), op.TargetMetadata, eventpb.CommonSQLEventDetails{ - DescriptorID: uint32(tbl.GetID()), - Statement: redact.RedactableString(op.Statement), - Tag: op.StatementTag, - ApplicationName: op.Authorization.AppName, - User: op.Authorization.UserName, - }, descpb.DescriptorMutation_WRITE_ONLY) + mut, err := RemoveMutation( + tbl, + MakeColumnIDMutationSelector(op.ColumnID), + descpb.DescriptorMutation_WRITE_ONLY, + ) if err != nil { return err } @@ -202,13 +198,11 @@ func (m *visitor) MakeDeleteOnlyColumnAbsent( if err != nil || tbl.Dropped() { return err } - mut, err := m.removeMutation(tbl, MakeColumnIDMutationSelector(op.ColumnID), op.TargetMetadata, eventpb.CommonSQLEventDetails{ - DescriptorID: uint32(tbl.GetID()), - Statement: redact.RedactableString(op.Statement), - Tag: op.StatementTag, - ApplicationName: op.Authorization.AppName, - User: op.Authorization.UserName, - }, descpb.DescriptorMutation_DELETE_ONLY) + mut, err := RemoveMutation( + tbl, + MakeColumnIDMutationSelector(op.ColumnID), + descpb.DescriptorMutation_DELETE_ONLY, + ) if err != nil { return err } diff --git a/pkg/sql/schemachanger/scexec/scmutationexec/eventlog.go b/pkg/sql/schemachanger/scexec/scmutationexec/eventlog.go deleted file mode 100644 index f7e282f5400c..000000000000 --- a/pkg/sql/schemachanger/scexec/scmutationexec/eventlog.go +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright 2022 The Cockroach Authors. -// -// Use of this software is governed by the Business Source License -// included in the file licenses/BSL.txt. -// -// As of the Change Date specified in that file, in accordance with -// the Business Source License, use of this software will be governed -// by the Apache License, Version 2.0, included in the file -// licenses/APL.txt. - -package scmutationexec - -import ( - "context" - - "github.com/cockroachdb/cockroach/pkg/sql/catalog" - "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scop" - "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" - "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" - "github.com/cockroachdb/cockroach/pkg/util/log/eventpb" - "github.com/cockroachdb/cockroach/pkg/util/log/logpb" - "github.com/cockroachdb/errors" - "github.com/cockroachdb/redact" -) - -func (m *visitor) LogEvent(ctx context.Context, op scop.LogEvent) error { - descID := screl.GetDescID(op.Element.Element()) - fullName, err := m.nr.GetFullyQualifiedName(ctx, descID) - if err != nil { - return err - } - event, err := asEventPayload(ctx, fullName, op.Element.Element(), op.TargetStatus, m) - // Certain events will at runtime won't require a payload, since we can - // coalesce entries (i.e. multiple add columns). - if isErrEventPayloadNotRequired(err) { - return nil - } - if err != nil { - return err - } - details := eventpb.CommonSQLEventDetails{ - ApplicationName: op.Authorization.AppName, - User: op.Authorization.UserName, - Statement: redact.RedactableString(op.Statement), - Tag: op.StatementTag, - } - return m.s.EnqueueEvent(descID, op.TargetMetadata, details, event) -} - -// Indicates that no payload is required for the current element, -// an event will be generated by a different element. -var errEventPayloadNotRequired = errors.Newf("no payload required") - -// isErrEventPayloadNotRequired indicates if the error is no event payload required. -func isErrEventPayloadNotRequired(err error) bool { - return errors.Is(err, errEventPayloadNotRequired) -} - -func asEventPayload( - ctx context.Context, fullName string, e scpb.Element, targetStatus scpb.Status, m *visitor, -) (logpb.EventPayload, error) { - if targetStatus == scpb.Status_ABSENT { - switch e.(type) { - case *scpb.Table: - return &eventpb.DropTable{TableName: fullName}, nil - case *scpb.View: - return &eventpb.DropView{ViewName: fullName}, nil - case *scpb.Sequence: - return &eventpb.DropSequence{SequenceName: fullName}, nil - case *scpb.Database: - return &eventpb.DropDatabase{DatabaseName: fullName}, nil - case *scpb.Schema: - return &eventpb.DropSchema{SchemaName: fullName}, nil - case *scpb.AliasType, *scpb.EnumType, *scpb.CompositeType: - return &eventpb.DropType{TypeName: fullName}, nil - case *scpb.TableComment, *scpb.ColumnComment, *scpb.IndexComment, *scpb.ConstraintComment, - *scpb.DatabaseComment, *scpb.SchemaComment: - return asCommentEventPayload(ctx, fullName, e, targetStatus, m, true /* isNullComment */) - } - } - switch e := e.(type) { - case *scpb.Column: - tbl, err := m.checkOutTable(ctx, e.TableID) - if err != nil { - return nil, err - } - mutation, err := FindMutation(tbl, MakeColumnIDMutationSelector(e.ColumnID)) - if err != nil { - return nil, err - } - firstMutation, err := FindMutation(tbl, MakeMutationIDMutationSelector(mutation.MutationID())) - if err != nil { - return nil, err - } - // Only the first mutation will generate an ALTER TABLE event log entry. - if firstMutation.MutationOrdinal() != mutation.MutationOrdinal() { - return nil, errEventPayloadNotRequired - } - return &eventpb.AlterTable{ - TableName: fullName, - MutationID: uint32(mutation.MutationID()), - }, nil - case *scpb.SecondaryIndex: - tbl, err := m.checkOutTable(ctx, e.TableID) - if err != nil { - return nil, err - } - mutation, err := FindMutation(tbl, MakeIndexIDMutationSelector(e.IndexID)) - if err != nil { - return nil, err - } - switch targetStatus { - case scpb.Status_PUBLIC: - return &eventpb.CreateIndex{ - TableName: fullName, - IndexName: mutation.AsIndex().GetName(), - MutationID: uint32(mutation.MutationID()), - }, nil - case scpb.Status_ABSENT: - return &eventpb.DropIndex{ - TableName: fullName, - IndexName: mutation.AsIndex().GetName(), - MutationID: uint32(mutation.MutationID()), - }, nil - default: - return nil, errors.AssertionFailedf("unknown target status %s", targetStatus) - } - case *scpb.TableComment, *scpb.ColumnComment, *scpb.IndexComment, *scpb.ConstraintComment, - *scpb.DatabaseComment, *scpb.SchemaComment: - return asCommentEventPayload(ctx, fullName, e, targetStatus, m, false /* isNullComment */) - } - return nil, errors.AssertionFailedf("unknown %s element type %T", targetStatus.String(), e) -} - -func asCommentEventPayload( - ctx context.Context, - fullName string, - e scpb.Element, - targetStatus scpb.Status, - m *visitor, - isNullComment bool, -) (logpb.EventPayload, error) { - switch e := e.(type) { - case *scpb.TableComment: - return &eventpb.CommentOnTable{ - TableName: fullName, - Comment: e.Comment, - NullComment: isNullComment, - }, nil - case *scpb.ColumnComment: - tbl, err := m.checkOutTable(ctx, e.TableID) - if err != nil { - return nil, err - } - col, err := catalog.MustFindColumnByID(tbl, e.ColumnID) - if err != nil { - return nil, err - } - return &eventpb.CommentOnColumn{ - TableName: fullName, - ColumnName: col.GetName(), - Comment: e.Comment, - NullComment: isNullComment, - }, nil - case *scpb.IndexComment: - tbl, err := m.checkOutTable(ctx, e.TableID) - if err != nil { - return nil, err - } - idx, err := catalog.MustFindIndexByID(tbl, e.IndexID) - if err != nil { - return nil, err - } - return &eventpb.CommentOnIndex{ - TableName: fullName, - IndexName: idx.GetName(), - Comment: e.Comment, - NullComment: isNullComment, - }, nil - case *scpb.ConstraintComment: - tbl, err := m.checkOutTable(ctx, e.TableID) - if err != nil { - return nil, err - } - var constraintName string - if constraint, err := catalog.MustFindConstraintByID(tbl, e.ConstraintID); err != nil { - // MustFindConstraintByID excludes dropping indexes for no good reason. - // TODO(postamar): improve catalog.TableDescriptor interface - for _, idx := range tbl.AllIndexes() { - if idx.Dropped() && idx.GetConstraintID() == e.ConstraintID { - constraintName = idx.GetName() - err = nil - break - } - } - if err != nil { - return nil, err - } - } else { - constraintName = constraint.GetName() - } - return &eventpb.CommentOnConstraint{ - TableName: fullName, - ConstraintName: constraintName, - Comment: e.Comment, - NullComment: isNullComment, - }, nil - case *scpb.DatabaseComment: - return &eventpb.CommentOnDatabase{ - DatabaseName: fullName, - Comment: e.Comment, - NullComment: isNullComment, - }, nil - case *scpb.SchemaComment: - return &eventpb.CommentOnSchema{ - SchemaName: fullName, - Comment: e.Comment, - NullComment: isNullComment, - }, nil - } - return nil, errors.AssertionFailedf("unknown %s element type %T", targetStatus.String(), e) -} diff --git a/pkg/sql/schemachanger/scexec/scmutationexec/helpers.go b/pkg/sql/schemachanger/scexec/scmutationexec/helpers.go index 6867b3323074..eb0df83625ca 100644 --- a/pkg/sql/schemachanger/scexec/scmutationexec/helpers.go +++ b/pkg/sql/schemachanger/scexec/scmutationexec/helpers.go @@ -21,8 +21,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc" "github.com/cockroachdb/cockroach/pkg/sql/catalog/typedesc" "github.com/cockroachdb/cockroach/pkg/sql/parser" - "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" - "github.com/cockroachdb/cockroach/pkg/util/log/eventpb" "github.com/cockroachdb/errors" ) @@ -97,12 +95,8 @@ func mutationStateChange( return nil } -func (m *visitor) removeMutation( - tbl *tabledesc.Mutable, - f MutationSelector, - metadata scpb.TargetMetadata, - details eventpb.CommonSQLEventDetails, - exp ...descpb.DescriptorMutation_State, +func RemoveMutation( + tbl *tabledesc.Mutable, f MutationSelector, exp ...descpb.DescriptorMutation_State, ) (descpb.DescriptorMutation, error) { mut, err := FindMutation(tbl, f) if err != nil { @@ -124,29 +118,6 @@ func (m *visitor) removeMutation( ) } tbl.Mutations = append(tbl.Mutations[:foundIdx], tbl.Mutations[foundIdx+1:]...) - // If this is the last remaining mutation, then we need to emit an event - // log entry. - hasMutationID := false - for _, mut := range tbl.Mutations { - if mut.MutationID == cpy.MutationID { - hasMutationID = true - break - } - } - if !hasMutationID { - err := m.s.EnqueueEvent(tbl.GetID(), - metadata, - details, - &eventpb.FinishSchemaChange{ - CommonSchemaChangeEventDetails: eventpb.CommonSchemaChangeEventDetails{ - DescriptorID: uint32(tbl.GetID()), - MutationID: uint32(cpy.MutationID), - }, - }) - if err != nil { - return cpy, err - } - } return cpy, nil } diff --git a/pkg/sql/schemachanger/scexec/scmutationexec/index.go b/pkg/sql/schemachanger/scexec/scmutationexec/index.go index 0412c086fe4e..d0830ce651d8 100644 --- a/pkg/sql/schemachanger/scexec/scmutationexec/index.go +++ b/pkg/sql/schemachanger/scexec/scmutationexec/index.go @@ -21,9 +21,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scop" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" - "github.com/cockroachdb/cockroach/pkg/util/log/eventpb" "github.com/cockroachdb/errors" - "github.com/cockroachdb/redact" ) func (m *visitor) MakeAbsentIndexBackfilling( @@ -194,18 +192,13 @@ func (m *visitor) MakeValidatedPrimaryIndexPublic( if err != nil { return err } - indexDesc := index.IndexDescDeepCopy() - if _, err := m.removeMutation(tbl, MakeIndexIDMutationSelector(op.IndexID), op.TargetMetadata, eventpb.CommonSQLEventDetails{ - DescriptorID: uint32(tbl.GetID()), - Statement: redact.RedactableString(op.Statement), - Tag: op.StatementTag, - ApplicationName: op.Authorization.AppName, - User: op.Authorization.UserName, - }, descpb.DescriptorMutation_WRITE_ONLY); err != nil { - return err - } - tbl.PrimaryIndex = indexDesc - return nil + tbl.PrimaryIndex = index.IndexDescDeepCopy() + _, err = RemoveMutation( + tbl, + MakeIndexIDMutationSelector(op.IndexID), + descpb.DescriptorMutation_WRITE_ONLY, + ) + return err } func (m *visitor) MakeValidatedSecondaryIndexPublic( @@ -313,14 +306,12 @@ func (m *visitor) MakeIndexAbsent(ctx context.Context, op scop.MakeIndexAbsent) if err != nil { return err } - _, err = m.removeMutation(tbl, MakeIndexIDMutationSelector(op.IndexID), op.TargetMetadata, eventpb.CommonSQLEventDetails{ - DescriptorID: uint32(tbl.GetID()), - Statement: redact.RedactableString(op.Statement), - Tag: op.StatementTag, - ApplicationName: op.Authorization.AppName, - User: op.Authorization.UserName, - }, descpb.DescriptorMutation_DELETE_ONLY, - descpb.DescriptorMutation_BACKFILLING) + _, err = RemoveMutation( + tbl, + MakeIndexIDMutationSelector(op.IndexID), + descpb.DescriptorMutation_DELETE_ONLY, + descpb.DescriptorMutation_BACKFILLING, + ) return err } diff --git a/pkg/sql/schemachanger/scexec/testing_knobs.go b/pkg/sql/schemachanger/scexec/testing_knobs.go index 714dbedd9d1c..8869dd4a281b 100644 --- a/pkg/sql/schemachanger/scexec/testing_knobs.go +++ b/pkg/sql/schemachanger/scexec/testing_knobs.go @@ -10,10 +10,7 @@ package scexec -import ( - "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" - "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan" -) +import "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan" // TestingKnobs are testing knobs which affect the running of declarative // schema changes. @@ -32,7 +29,7 @@ type TestingKnobs struct { // OnPostCommitPlanError is called whenever the schema changer job returns an // error on building the state or on planning the stages. - OnPostCommitPlanError func(state *scpb.CurrentState, err error) error + OnPostCommitPlanError func(err error) error // OnPostCommitError is called whenever the schema changer job returns an // error during stage execution. diff --git a/pkg/sql/schemachanger/schemachanger_test.go b/pkg/sql/schemachanger/schemachanger_test.go index 3dd808d8318c..58064023df6d 100644 --- a/pkg/sql/schemachanger/schemachanger_test.go +++ b/pkg/sql/schemachanger/schemachanger_test.go @@ -741,6 +741,7 @@ func TestSchemaChangerJobErrorDetails(t *testing.T) { return nil }, }, + EventLog: &sql.EventLogTestingKnobs{SyncWrites: true}, JobsTestingKnobs: jobs.NewTestingKnobsWithShortIntervals(), } @@ -782,6 +783,18 @@ func TestSchemaChangerJobErrorDetails(t *testing.T) { checkErrWithDetails(p.FinalResumeError) require.LessOrEqual(t, 1, len(p.RetriableExecutionFailureLog)) checkErrWithDetails(p.RetriableExecutionFailureLog[0].Error) + + // Check that the error is featured in the event log. + const eventLogCountQuery = `SELECT count(*) FROM system.eventlog WHERE "eventType" = $1` + results = tdb.QueryStr(t, eventLogCountQuery, "finish_schema_change") + require.EqualValues(t, [][]string{{"0"}}, results) + results = tdb.QueryStr(t, eventLogCountQuery, "finish_schema_change_rollback") + require.EqualValues(t, [][]string{{"1"}}, results) + results = tdb.QueryStr(t, eventLogCountQuery, "reverse_schema_change") + require.EqualValues(t, [][]string{{"1"}}, results) + const eventLogErrorQuery = `SELECT (info::JSONB)->>'Error' FROM system.eventlog WHERE "eventType" = 'reverse_schema_change'` + results = tdb.QueryStr(t, eventLogErrorQuery) + require.EqualValues(t, [][]string{{"boom"}}, results) } func TestInsertDuringAddColumnNotWritingToCurrentPrimaryIndex(t *testing.T) { diff --git a/pkg/sql/schemachanger/scjob/job.go b/pkg/sql/schemachanger/scjob/job.go index 25a279d0250d..192d7cc78983 100644 --- a/pkg/sql/schemachanger/scjob/job.go +++ b/pkg/sql/schemachanger/scjob/job.go @@ -37,8 +37,8 @@ func init() { } type newSchemaChangeResumer struct { - job *jobs.Job - rollback bool + job *jobs.Job + rollbackCause error } func (n *newSchemaChangeResumer) Resume(ctx context.Context, execCtxI interface{}) (err error) { @@ -46,11 +46,12 @@ func (n *newSchemaChangeResumer) Resume(ctx context.Context, execCtxI interface{ } func (n *newSchemaChangeResumer) OnFailOrCancel( - ctx context.Context, execCtxI interface{}, _ error, + ctx context.Context, execCtxI interface{}, err error, ) error { execCtx := execCtxI.(sql.JobExecContext) execCfg := execCtx.ExecCfg() - n.rollback = true + n.rollbackCause = err + // Clean up any protected timestamps as a last resort, in case the job // execution never did itself. if err := execCfg.ProtectedTimestampManager.Unprotect(ctx, n.job); err != nil { @@ -81,8 +82,8 @@ func (n *newSchemaChangeResumer) run(ctx context.Context, execCtxI interface{}) execCfg.IndexBackfiller, execCfg.IndexMerger, NewRangeCounter(execCfg.DB, execCfg.DistSQLPlanner), - func(txn isql.Txn) scexec.EventLogger { - return sql.NewSchemaChangerEventLogger(txn, execCfg, 0) + func(txn isql.Txn) scrun.EventLogger { + return sql.NewSchemaChangerRunEventLogger(txn, execCfg) }, execCfg.JobRegistry, n.job, @@ -115,7 +116,7 @@ func (n *newSchemaChangeResumer) run(ctx context.Context, execCtxI interface{}) deps, n.job.ID(), payload.DescriptorIDs, - n.rollback, + n.rollbackCause, ) // Return permanent errors back, otherwise we will try to retry if sql.IsPermanentSchemaChangeError(err) { diff --git a/pkg/sql/schemachanger/scop/generate_visitor.go b/pkg/sql/schemachanger/scop/generate_visitor.go index 5517b1c60b2b..d165e50f69c0 100644 --- a/pkg/sql/schemachanger/scop/generate_visitor.go +++ b/pkg/sql/schemachanger/scop/generate_visitor.go @@ -43,18 +43,12 @@ func run() error { if err != nil { return err } - ignoreList := map[string]struct{}{ - "EventBase": {}, - } opPattern := regexp.MustCompile(`type (\w+) struct {`) var ops []string for _, line := range strings.Split(string(source), "\n") { line = strings.TrimSpace(line) if matches := opPattern.FindStringSubmatch(line); len(matches) > 0 { - if _, found := ignoreList[matches[1]]; found { - continue - } ops = append(ops, matches[1]) } } diff --git a/pkg/sql/schemachanger/scop/mutation.go b/pkg/sql/schemachanger/scop/mutation.go index 3ffd20aef7fd..9942a42b71ef 100644 --- a/pkg/sql/schemachanger/scop/mutation.go +++ b/pkg/sql/schemachanger/scop/mutation.go @@ -23,15 +23,6 @@ import ( type mutationOp struct{ baseOp } -// EventBase basic fields needed for anything event log related -type EventBase struct { - TargetMetadata scpb.TargetMetadata - Authorization scpb.Authorization - Statement string - StatementTag string - Element scpb.ElementProto -} - // Make sure baseOp is used for linter. var _ = mutationOp{baseOp: baseOp{}} @@ -114,7 +105,6 @@ type MakeValidatedSecondaryIndexPublic struct { // public. type MakeValidatedPrimaryIndexPublic struct { mutationOp - EventBase TableID descpb.ID IndexID descpb.IndexID } @@ -214,7 +204,6 @@ type RemoveDroppedIndexPartialPredicate struct { // table. type MakeIndexAbsent struct { mutationOp - EventBase TableID descpb.ID IndexID descpb.IndexID } @@ -234,7 +223,6 @@ type SetAddedColumnType struct { // MakeWriteOnlyColumnPublic moves a new column from its mutation to public. type MakeWriteOnlyColumnPublic struct { mutationOp - EventBase TableID descpb.ID ColumnID descpb.ColumnID } @@ -266,7 +254,6 @@ type RemoveDroppedColumnType struct { // table. type MakeDeleteOnlyColumnAbsent struct { mutationOp - EventBase TableID descpb.ID ColumnID descpb.ColumnID } @@ -413,14 +400,6 @@ type AddIndexPartitionInfo struct { Partitioning scpb.IndexPartitioning } -// LogEvent logs an event for a given descriptor. -type LogEvent struct { - mutationOp - EventBase - Element scpb.ElementProto - TargetStatus scpb.Status -} - // AddColumnFamily adds a new column family to the table. type AddColumnFamily struct { mutationOp diff --git a/pkg/sql/schemachanger/scop/mutation_visitor_generated.go b/pkg/sql/schemachanger/scop/mutation_visitor_generated.go index 178ffccfadcd..e399c551ed6b 100644 --- a/pkg/sql/schemachanger/scop/mutation_visitor_generated.go +++ b/pkg/sql/schemachanger/scop/mutation_visitor_generated.go @@ -69,7 +69,6 @@ type MutationVisitor interface { RemoveUniqueWithoutIndexConstraint(context.Context, RemoveUniqueWithoutIndexConstraint) error RemoveSchemaParent(context.Context, RemoveSchemaParent) error AddIndexPartitionInfo(context.Context, AddIndexPartitionInfo) error - LogEvent(context.Context, LogEvent) error AddColumnFamily(context.Context, AddColumnFamily) error AddColumnDefaultExpression(context.Context, AddColumnDefaultExpression) error RemoveColumnDefaultExpression(context.Context, RemoveColumnDefaultExpression) error @@ -343,11 +342,6 @@ func (op AddIndexPartitionInfo) Visit(ctx context.Context, v MutationVisitor) er return v.AddIndexPartitionInfo(ctx, op) } -// Visit is part of the MutationOp interface. -func (op LogEvent) Visit(ctx context.Context, v MutationVisitor) error { - return v.LogEvent(ctx, op) -} - // Visit is part of the MutationOp interface. func (op AddColumnFamily) Visit(ctx context.Context, v MutationVisitor) error { return v.AddColumnFamily(ctx, op) diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/op_funcs.go b/pkg/sql/schemachanger/scplan/internal/opgen/op_funcs.go index 3e85a8d653a2..e6853befc89b 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/op_funcs.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/op_funcs.go @@ -17,42 +17,10 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scop" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" - "github.com/cockroachdb/cockroach/pkg/util/protoutil" "github.com/cockroachdb/errors" "github.com/cockroachdb/redact" ) -func newLogEventBase(e scpb.Element, md *opGenContext) scop.EventBase { - idx, ok := md.elementToTarget[e] - if !ok { - panic(errors.AssertionFailedf( - "could not find element %s in target state", screl.ElementString(e), - )) - } - t := md.Targets[idx] - return scop.EventBase{ - TargetMetadata: *protoutil.Clone(&t.Metadata).(*scpb.TargetMetadata), - Authorization: *protoutil.Clone(&md.Authorization).(*scpb.Authorization), - Statement: md.Statements[t.Metadata.StatementID].RedactedStatement, - StatementTag: md.Statements[t.Metadata.StatementID].StatementTag, - } -} - -func newLogEventOp(e scpb.Element, md *opGenContext) *scop.LogEvent { - idx, ok := md.elementToTarget[e] - if !ok { - panic(errors.AssertionFailedf( - "could not find element %s in target state", screl.ElementString(e), - )) - } - t := md.Targets[idx] - return &scop.LogEvent{ - EventBase: newLogEventBase(e, md), - Element: *protoutil.Clone(&t.ElementProto).(*scpb.ElementProto), - TargetStatus: t.TargetStatus, - } -} - func statementForDropJob(e scpb.Element, md *opGenContext) scop.StatementForDropJob { stmtID := md.Targets[md.elementToTarget[e]].Metadata.StatementID stmt := redact.RedactableString(md.Statements[stmtID].RedactedStatement).StripMarkers() diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_alias_type.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_alias_type.go index 7c27d01fa2bb..629c7bc30153 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_alias_type.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_alias_type.go @@ -51,9 +51,6 @@ func init() { }), ), to(scpb.Status_ABSENT, - emit(func(this *scpb.AliasType, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), emit(func(this *scpb.AliasType) *scop.DeleteDescriptor { return &scop.DeleteDescriptor{ DescriptorID: this.TypeID, diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_column.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_column.go index aa55fc50033f..30d43953320f 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_column.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_column.go @@ -26,9 +26,6 @@ func init() { Column: *protoutil.Clone(this).(*scpb.Column), } }), - emit(func(this *scpb.Column, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), ), to(scpb.Status_WRITE_ONLY, emit(func(this *scpb.Column) *scop.MakeDeleteOnlyColumnWriteOnly { @@ -42,9 +39,8 @@ func init() { revertible(false), emit(func(this *scpb.Column, md *opGenContext) *scop.MakeWriteOnlyColumnPublic { return &scop.MakeWriteOnlyColumnPublic{ - EventBase: newLogEventBase(this, md), - TableID: this.TableID, - ColumnID: this.ColumnID, + TableID: this.TableID, + ColumnID: this.ColumnID, } }), emit(func(this *scpb.Column) *scop.RefreshStats { @@ -63,9 +59,6 @@ func init() { ColumnID: this.ColumnID, } }), - emit(func(this *scpb.Column, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), ), to(scpb.Status_DELETE_ONLY, revertible(false), @@ -79,9 +72,8 @@ func init() { to(scpb.Status_ABSENT, emit(func(this *scpb.Column, md *opGenContext) *scop.MakeDeleteOnlyColumnAbsent { return &scop.MakeDeleteOnlyColumnAbsent{ - EventBase: newLogEventBase(this, md), - TableID: this.TableID, - ColumnID: this.ColumnID, + TableID: this.TableID, + ColumnID: this.ColumnID, } }), ), diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_column_comment.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_column_comment.go index ba51b2953095..2e95cac834ac 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_column_comment.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_column_comment.go @@ -28,9 +28,6 @@ func init() { PGAttributeNum: this.PgAttributeNum, } }), - emit(func(this *scpb.ColumnComment, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), ), ), toAbsent( @@ -43,9 +40,6 @@ func init() { PgAttributeNum: this.PgAttributeNum, } }), - emit(func(this *scpb.ColumnComment, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), ), ), ) diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_composite_type.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_composite_type.go index 09225cd1b8d2..4e99a7e0cbbb 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_composite_type.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_composite_type.go @@ -51,9 +51,6 @@ func init() { }), ), to(scpb.Status_ABSENT, - emit(func(this *scpb.CompositeType, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), emit(func(this *scpb.CompositeType) *scop.DeleteDescriptor { return &scop.DeleteDescriptor{ DescriptorID: this.TypeID, diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_constraint_comment.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_constraint_comment.go index 176a4a8b3458..bc62a25c972c 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_constraint_comment.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_constraint_comment.go @@ -27,9 +27,6 @@ func init() { Comment: this.Comment, } }), - emit(func(this *scpb.ConstraintComment, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), ), ), toAbsent( @@ -41,9 +38,6 @@ func init() { ConstraintID: this.ConstraintID, } }), - emit(func(this *scpb.ConstraintComment, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), ), ), ) diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_database.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_database.go index aacc54d38f40..0adb1ea57300 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_database.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_database.go @@ -52,9 +52,6 @@ func init() { }), ), to(scpb.Status_ABSENT, - emit(func(this *scpb.Database, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), emit(func(this *scpb.Database, md *opGenContext) *scop.CreateGCJobForDatabase { if !md.ActiveVersion.IsActive(clusterversion.V23_1) { return &scop.CreateGCJobForDatabase{ diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_database_comment.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_database_comment.go index 9a9aad3497d1..b080b2a2be2f 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_database_comment.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_database_comment.go @@ -26,9 +26,6 @@ func init() { Comment: this.Comment, } }), - emit(func(this *scpb.DatabaseComment, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), ), ), toAbsent( @@ -39,9 +36,6 @@ func init() { DatabaseID: this.DatabaseID, } }), - emit(func(this *scpb.DatabaseComment, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), ), ), ) diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_enum_type.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_enum_type.go index 65f0c9d7364b..23c9f987fbea 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_enum_type.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_enum_type.go @@ -51,9 +51,6 @@ func init() { }), ), to(scpb.Status_ABSENT, - emit(func(this *scpb.EnumType, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), emit(func(this *scpb.EnumType) *scop.DeleteDescriptor { return &scop.DeleteDescriptor{ DescriptorID: this.TypeID, diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_index_comment.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_index_comment.go index 2606f24a0693..1cf61b32a142 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_index_comment.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_index_comment.go @@ -27,9 +27,6 @@ func init() { Comment: this.Comment, } }), - emit(func(this *scpb.IndexComment, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), ), ), toAbsent( @@ -41,9 +38,6 @@ func init() { IndexID: this.IndexID, } }), - emit(func(this *scpb.IndexComment, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), ), ), ) diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_primary_index.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_primary_index.go index 82f4cb396695..a2fe2fa85d39 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_primary_index.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_primary_index.go @@ -87,9 +87,8 @@ func init() { to(scpb.Status_PUBLIC, emit(func(this *scpb.PrimaryIndex, md *opGenContext) *scop.MakeValidatedPrimaryIndexPublic { return &scop.MakeValidatedPrimaryIndexPublic{ - EventBase: newLogEventBase(this, md), - TableID: this.TableID, - IndexID: this.IndexID, + TableID: this.TableID, + IndexID: this.IndexID, } }), ), @@ -134,9 +133,8 @@ func init() { }), emit(func(this *scpb.PrimaryIndex, md *opGenContext) *scop.MakeIndexAbsent { return &scop.MakeIndexAbsent{ - EventBase: newLogEventBase(this, md), - TableID: this.TableID, - IndexID: this.IndexID, + TableID: this.TableID, + IndexID: this.IndexID, } }), ), diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_schema.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_schema.go index c066e26cb063..13440c923a03 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_schema.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_schema.go @@ -50,9 +50,6 @@ func init() { }), ), to(scpb.Status_ABSENT, - emit(func(this *scpb.Schema, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), emit(func(this *scpb.Schema) *scop.DeleteDescriptor { return &scop.DeleteDescriptor{ DescriptorID: this.SchemaID, diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_schema_comment.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_schema_comment.go index 60f5812610c4..c35632fc3a63 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_schema_comment.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_schema_comment.go @@ -26,9 +26,6 @@ func init() { Comment: this.Comment, } }), - emit(func(this *scpb.SchemaComment, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), ), ), toAbsent( diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_secondary_index.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_secondary_index.go index 7fedc8e50a2b..8603c514e7db 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_secondary_index.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_secondary_index.go @@ -86,20 +86,17 @@ func init() { }), ), to(scpb.Status_PUBLIC, - emit(func(this *scpb.SecondaryIndex) *scop.RefreshStats { - return &scop.RefreshStats{ - TableID: this.TableID, - } - }), - emit(func(this *scpb.SecondaryIndex, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), emit(func(this *scpb.SecondaryIndex) *scop.MakeValidatedSecondaryIndexPublic { return &scop.MakeValidatedSecondaryIndexPublic{ TableID: this.TableID, IndexID: this.IndexID, } }), + emit(func(this *scpb.SecondaryIndex) *scop.RefreshStats { + return &scop.RefreshStats{ + TableID: this.TableID, + } + }), ), ), toAbsent( @@ -119,9 +116,6 @@ func init() { equiv(scpb.Status_MERGE_ONLY), equiv(scpb.Status_MERGED), to(scpb.Status_DELETE_ONLY, - emit(func(this *scpb.SecondaryIndex, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), emit(func(this *scpb.SecondaryIndex) *scop.MakeWriteOnlyIndexDeleteOnly { return &scop.MakeWriteOnlyIndexDeleteOnly{ TableID: this.TableID, diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_sequence.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_sequence.go index c98ed2f47748..ce711723ba92 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_sequence.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_sequence.go @@ -52,9 +52,6 @@ func init() { }), ), to(scpb.Status_ABSENT, - emit(func(this *scpb.Sequence, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), emit(func(this *scpb.Sequence, md *opGenContext) *scop.CreateGCJobForTable { if !md.ActiveVersion.IsActive(clusterversion.V23_1) { return &scop.CreateGCJobForTable{ diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_table.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_table.go index 797546c43a8b..919b2b83bcb2 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_table.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_table.go @@ -54,9 +54,6 @@ func init() { }), ), to(scpb.Status_ABSENT, - emit(func(this *scpb.Table, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), emit(func(this *scpb.Table, md *opGenContext) *scop.CreateGCJobForTable { if !md.ActiveVersion.IsActive(clusterversion.V23_1) { return &scop.CreateGCJobForTable{ diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_table_comment.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_table_comment.go index bb6153911e54..f38998f64a94 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_table_comment.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_table_comment.go @@ -26,9 +26,6 @@ func init() { Comment: this.Comment, } }), - emit(func(this *scpb.TableComment, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), ), ), toAbsent( @@ -39,9 +36,6 @@ func init() { TableID: this.TableID, } }), - emit(func(this *scpb.TableComment, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), ), ), ) diff --git a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_view.go b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_view.go index d2a5cf41c761..6b7cb98069f2 100644 --- a/pkg/sql/schemachanger/scplan/internal/opgen/opgen_view.go +++ b/pkg/sql/schemachanger/scplan/internal/opgen/opgen_view.go @@ -70,9 +70,6 @@ func init() { }), ), to(scpb.Status_ABSENT, - emit(func(this *scpb.View, md *opGenContext) *scop.LogEvent { - return newLogEventOp(this, md) - }), emit(func(this *scpb.View, md *opGenContext) *scop.CreateGCJobForTable { if this.IsMaterialized && !md.ActiveVersion.IsActive(clusterversion.V23_1) { return &scop.CreateGCJobForTable{ diff --git a/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column b/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column index 94bd62848dbc..206da34b6026 100644 --- a/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column +++ b/pkg/sql/schemachanger/scplan/testdata/alter_table_add_column @@ -6,7 +6,7 @@ CREATE TYPE defaultdb.footyp AS ENUM('a'); ops ALTER TABLE defaultdb.foo ADD COLUMN j defaultdb.footyp; ---- -StatementPhase stage 1 of 1 with 6 MutationType ops +StatementPhase stage 1 of 1 with 5 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 2}, PUBLIC], ABSENT] -> DELETE_ONLY [[ColumnName:{DescID: 104, Name: j, ColumnID: 2}, PUBLIC], ABSENT] -> PUBLIC @@ -18,21 +18,6 @@ StatementPhase stage 1 of 1 with 6 MutationType ops ColumnID: 2 PgAttributeNum: 2 TableID: 104 - *scop.LogEvent - Element: - Column: - columnId: 2 - pgAttributeNum: 2 - tableId: 104 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹j› defaultdb.footyp - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 *scop.SetColumnName ColumnID: 2 Name: j @@ -108,14 +93,6 @@ PostCommitNonRevertiblePhase stage 1 of 1 with 6 MutationType ops ops: *scop.MakeWriteOnlyColumnPublic ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹j› defaultdb.footyp - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 104 *scop.RefreshStats TableID: 104 @@ -139,7 +116,7 @@ PostCommitNonRevertiblePhase stage 1 of 1 with 6 MutationType ops ops ALTER TABLE defaultdb.foo ADD COLUMN j INT NOT NULL DEFAULT 123 ---- -StatementPhase stage 1 of 1 with 11 MutationType ops +StatementPhase stage 1 of 1 with 10 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 2}, PUBLIC], ABSENT] -> DELETE_ONLY [[ColumnName:{DescID: 104, Name: j, ColumnID: 2}, PUBLIC], ABSENT] -> PUBLIC @@ -158,22 +135,6 @@ StatementPhase stage 1 of 1 with 11 MutationType ops ColumnID: 2 PgAttributeNum: 2 TableID: 104 - *scop.LogEvent - Element: - Column: - columnId: 2 - pgAttributeNum: 2 - tableId: 104 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT - ‹123› - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 *scop.SetColumnName ColumnID: 2 Name: j @@ -343,28 +304,10 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 9 MutationType ops IndexID: 3 TableID: 104 *scop.MakeValidatedPrimaryIndexPublic - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT - ‹123› - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 2 TableID: 104 *scop.MakeWriteOnlyColumnPublic ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT - ‹123› - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 104 *scop.RefreshStats TableID: 104 @@ -396,15 +339,6 @@ PostCommitNonRevertiblePhase stage 3 of 3 with 5 MutationType ops [[IndexData:{DescID: 104, IndexID: 3}, TRANSIENT_ABSENT], PUBLIC] -> TRANSIENT_ABSENT ops: *scop.MakeIndexAbsent - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT - ‹123› - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 1 TableID: 104 *scop.CreateGCJobForIndex @@ -430,7 +364,7 @@ ops ALTER TABLE defaultdb.foo ADD COLUMN j INT DEFAULT 123; ALTER TABLE defaultdb.foo ADD COLUMN k INT DEFAULT 456; ---- -StatementPhase stage 1 of 1 with 18 MutationType ops +StatementPhase stage 1 of 1 with 16 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 2}, PUBLIC], ABSENT] -> DELETE_ONLY [[ColumnName:{DescID: 104, Name: j, ColumnID: 2}, PUBLIC], ABSENT] -> PUBLIC @@ -455,21 +389,6 @@ StatementPhase stage 1 of 1 with 18 MutationType ops ColumnID: 2 PgAttributeNum: 2 TableID: 104 - *scop.LogEvent - Element: - Column: - columnId: 2 - pgAttributeNum: 2 - tableId: 104 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹j› INT8 DEFAULT ‹123› - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 *scop.SetColumnName ColumnID: 2 Name: j @@ -495,22 +414,6 @@ StatementPhase stage 1 of 1 with 18 MutationType ops ColumnID: 3 PgAttributeNum: 3 TableID: 104 - *scop.LogEvent - Element: - Column: - columnId: 3 - pgAttributeNum: 3 - tableId: 104 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹k› INT8 DEFAULT ‹456› - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - StatementID: 1 - SubWorkID: 1 - TargetStatus: 2 *scop.SetColumnName ColumnID: 3 Name: k @@ -702,40 +605,15 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 11 MutationType ops IndexID: 3 TableID: 104 *scop.MakeValidatedPrimaryIndexPublic - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹j› INT8 DEFAULT ‹123› - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 2 TableID: 104 *scop.MakeWriteOnlyColumnPublic ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹j› INT8 DEFAULT ‹123› - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 104 *scop.RefreshStats TableID: 104 *scop.MakeWriteOnlyColumnPublic ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹k› INT8 DEFAULT ‹456› - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - StatementID: 1 - SubWorkID: 1 TableID: 104 *scop.RefreshStats TableID: 104 @@ -767,14 +645,6 @@ PostCommitNonRevertiblePhase stage 3 of 3 with 5 MutationType ops [[IndexData:{DescID: 104, IndexID: 3}, TRANSIENT_ABSENT], PUBLIC] -> TRANSIENT_ABSENT ops: *scop.MakeIndexAbsent - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹j› INT8 DEFAULT ‹123› - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 1 TableID: 104 *scop.CreateGCJobForIndex @@ -799,7 +669,7 @@ PostCommitNonRevertiblePhase stage 3 of 3 with 5 MutationType ops ops ALTER TABLE defaultdb.foo ADD COLUMN a INT AS (i+1) STORED ---- -StatementPhase stage 1 of 1 with 10 MutationType ops +StatementPhase stage 1 of 1 with 9 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 2}, PUBLIC], ABSENT] -> DELETE_ONLY [[ColumnName:{DescID: 104, Name: a, ColumnID: 2}, PUBLIC], ABSENT] -> PUBLIC @@ -817,22 +687,6 @@ StatementPhase stage 1 of 1 with 10 MutationType ops ColumnID: 2 PgAttributeNum: 2 TableID: 104 - *scop.LogEvent - Element: - Column: - columnId: 2 - pgAttributeNum: 2 - tableId: 104 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹a› INT8 AS (‹i› + ‹1›) - STORED - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 *scop.SetColumnName ColumnID: 2 Name: a @@ -1001,28 +855,10 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 9 MutationType ops IndexID: 3 TableID: 104 *scop.MakeValidatedPrimaryIndexPublic - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹a› INT8 AS (‹i› + ‹1›) - STORED - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 2 TableID: 104 *scop.MakeWriteOnlyColumnPublic ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹a› INT8 AS (‹i› + ‹1›) - STORED - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 104 *scop.RefreshStats TableID: 104 @@ -1054,15 +890,6 @@ PostCommitNonRevertiblePhase stage 3 of 3 with 5 MutationType ops [[IndexData:{DescID: 104, IndexID: 3}, TRANSIENT_ABSENT], PUBLIC] -> TRANSIENT_ABSENT ops: *scop.MakeIndexAbsent - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹a› INT8 AS (‹i› + ‹1›) - STORED - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 1 TableID: 104 *scop.CreateGCJobForIndex @@ -1093,7 +920,7 @@ ops ALTER TABLE defaultdb.foo ADD COLUMN a INT; ALTER TABLE defaultdb.bar ADD COLUMN b INT; ---- -StatementPhase stage 1 of 1 with 10 MutationType ops +StatementPhase stage 1 of 1 with 8 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 2}, PUBLIC], ABSENT] -> DELETE_ONLY [[ColumnName:{DescID: 104, Name: a, ColumnID: 2}, PUBLIC], ABSENT] -> PUBLIC @@ -1109,21 +936,6 @@ StatementPhase stage 1 of 1 with 10 MutationType ops ColumnID: 2 PgAttributeNum: 2 TableID: 104 - *scop.LogEvent - Element: - Column: - columnId: 2 - pgAttributeNum: 2 - tableId: 104 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹a› INT8 - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 *scop.SetColumnName ColumnID: 2 Name: a @@ -1148,22 +960,6 @@ StatementPhase stage 1 of 1 with 10 MutationType ops ColumnID: 3 PgAttributeNum: 3 TableID: 107 - *scop.LogEvent - Element: - Column: - columnId: 3 - pgAttributeNum: 3 - tableId: 107 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹bar› ADD COLUMN ‹b› INT8 - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - StatementID: 1 - SubWorkID: 1 - TargetStatus: 2 *scop.SetColumnName ColumnID: 3 Name: b @@ -1233,28 +1029,11 @@ PostCommitNonRevertiblePhase stage 1 of 1 with 7 MutationType ops ops: *scop.MakeWriteOnlyColumnPublic ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› ADD COLUMN ‹a› INT8 - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 104 *scop.RefreshStats TableID: 104 *scop.MakeWriteOnlyColumnPublic ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹bar› ADD COLUMN ‹b› INT8 - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - StatementID: 1 - SubWorkID: 1 TableID: 107 *scop.RefreshStats TableID: 107 @@ -1485,7 +1264,7 @@ PostCommitPhase stage 7 of 7 with 2 ValidationType ops *scop.ValidateIndex IndexID: 4 TableID: 108 -PostCommitNonRevertiblePhase stage 1 of 3 with 11 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 3 with 10 MutationType ops transitions: [[IndexColumn:{DescID: 108, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexColumn:{DescID: 108, ColumnID: 2, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -1513,41 +1292,15 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 11 MutationType ops *scop.MakeWriteOnlyIndexDeleteOnly IndexID: 3 TableID: 108 - *scop.RefreshStats - TableID: 108 - *scop.LogEvent - Element: - SecondaryIndex: - constraintId: 4 - indexId: 4 - isUnique: true - sourceIndexId: 1 - tableId: 108 - temporaryIndexId: 5 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 *scop.MakeValidatedSecondaryIndexPublic IndexID: 4 TableID: 108 + *scop.RefreshStats + TableID: 108 *scop.MakeWriteOnlyIndexDeleteOnly IndexID: 5 TableID: 108 *scop.MakeValidatedPrimaryIndexPublic - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 2 TableID: 108 *scop.SetJobStateOnDescriptor @@ -1583,14 +1336,6 @@ PostCommitNonRevertiblePhase stage 3 of 3 with 6 MutationType ops [[IndexData:{DescID: 108, IndexID: 5}, TRANSIENT_ABSENT], PUBLIC] -> TRANSIENT_ABSENT ops: *scop.MakeIndexAbsent - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 1 TableID: 108 *scop.CreateGCJobForIndex @@ -1624,7 +1369,7 @@ CREATE TABLE defaultdb.baz (i INT PRIMARY KEY); ops ALTER TABLE defaultdb.baz ADD g INT UNIQUE DEFAULT 1 ---- -StatementPhase stage 1 of 1 with 11 MutationType ops +StatementPhase stage 1 of 1 with 10 MutationType ops transitions: [[Column:{DescID: 109, ColumnID: 2}, PUBLIC], ABSENT] -> DELETE_ONLY [[ColumnName:{DescID: 109, Name: g, ColumnID: 2}, PUBLIC], ABSENT] -> PUBLIC @@ -1643,22 +1388,6 @@ StatementPhase stage 1 of 1 with 11 MutationType ops ColumnID: 2 PgAttributeNum: 2 TableID: 109 - *scop.LogEvent - Element: - Column: - columnId: 2 - pgAttributeNum: 2 - tableId: 109 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹baz› ADD COLUMN ‹g› INT8 UNIQUE DEFAULT - ‹1› - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 *scop.SetColumnName ColumnID: 2 Name: g @@ -1829,15 +1558,6 @@ PostCommitPhase stage 8 of 15 with 13 MutationType ops Name: baz_pkey TableID: 109 *scop.MakeValidatedPrimaryIndexPublic - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹baz› ADD COLUMN ‹g› INT8 UNIQUE DEFAULT - ‹1› - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 2 TableID: 109 *scop.MakeAbsentIndexBackfilling @@ -1951,7 +1671,7 @@ PostCommitPhase stage 15 of 15 with 1 ValidationType op *scop.ValidateIndex IndexID: 4 TableID: 109 -PostCommitNonRevertiblePhase stage 1 of 2 with 10 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 2 with 9 MutationType ops transitions: [[IndexColumn:{DescID: 109, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[PrimaryIndex:{DescID: 109, IndexID: 1, ConstraintID: 1}, ABSENT], VALIDATED] -> DELETE_ONLY @@ -1964,45 +1684,17 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 10 MutationType ops ops: *scop.MakeWriteOnlyColumnPublic ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹baz› ADD COLUMN ‹g› INT8 UNIQUE DEFAULT - ‹1› - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 109 *scop.RefreshStats TableID: 109 *scop.MakeWriteOnlyIndexDeleteOnly IndexID: 3 TableID: 109 - *scop.RefreshStats - TableID: 109 - *scop.LogEvent - Element: - SecondaryIndex: - constraintId: 4 - indexId: 4 - isUnique: true - sourceIndexId: 2 - tableId: 109 - temporaryIndexId: 5 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹baz› ADD COLUMN ‹g› INT8 UNIQUE DEFAULT - ‹1› - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 *scop.MakeValidatedSecondaryIndexPublic IndexID: 4 TableID: 109 + *scop.RefreshStats + TableID: 109 *scop.MakeWriteOnlyIndexDeleteOnly IndexID: 5 TableID: 109 @@ -2024,15 +1716,6 @@ PostCommitNonRevertiblePhase stage 2 of 2 with 8 MutationType ops [[IndexData:{DescID: 109, IndexID: 5}, TRANSIENT_ABSENT], PUBLIC] -> TRANSIENT_ABSENT ops: *scop.MakeIndexAbsent - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹baz› ADD COLUMN ‹g› INT8 UNIQUE DEFAULT - ‹1› - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 1 TableID: 109 *scop.CreateGCJobForIndex diff --git a/pkg/sql/schemachanger/scplan/testdata/alter_table_alter_primary_key b/pkg/sql/schemachanger/scplan/testdata/alter_table_alter_primary_key index 7c01c96f542d..23d63a6922a6 100644 --- a/pkg/sql/schemachanger/scplan/testdata/alter_table_alter_primary_key +++ b/pkg/sql/schemachanger/scplan/testdata/alter_table_alter_primary_key @@ -5,7 +5,7 @@ CREATE TABLE t (k INT NOT NULL, v STRING); ops ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (k); ---- -StatementPhase stage 1 of 1 with 14 MutationType ops +StatementPhase stage 1 of 1 with 13 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 104, Name: rowid, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT @@ -26,22 +26,6 @@ StatementPhase stage 1 of 1 with 14 MutationType ops *scop.MakePublicColumnWriteOnly ColumnID: 3 TableID: 104 - *scop.LogEvent - Element: - Column: - columnId: 3 - isHidden: true - pgAttributeNum: 3 - tableId: 104 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹k›) - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.SetColumnName ColumnID: 3 Name: crdb_internal_column_3_name_placeholder @@ -216,14 +200,6 @@ PostCommitPhase stage 8 of 15 with 9 MutationType ops Name: t_pkey TableID: 104 *scop.MakeValidatedPrimaryIndexPublic - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹k›) - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 2 TableID: 104 *scop.MakeAbsentTempIndexDeleteOnly @@ -360,14 +336,6 @@ PostCommitNonRevertiblePhase stage 2 of 4 with 9 MutationType ops [[TemporaryIndex:{DescID: 104, IndexID: 5, ConstraintID: 5, SourceIndexID: 2}, TRANSIENT_ABSENT], TRANSIENT_DELETE_ONLY] -> TRANSIENT_ABSENT ops: *scop.MakeIndexAbsent - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹k›) - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 1 TableID: 104 *scop.MakePublicPrimaryIndexWriteOnly @@ -388,14 +356,6 @@ PostCommitNonRevertiblePhase stage 2 of 4 with 9 MutationType ops IndexID: 5 TableID: 104 *scop.MakeValidatedPrimaryIndexPublic - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹k›) - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 4 TableID: 104 *scop.SetJobStateOnDescriptor @@ -435,14 +395,6 @@ PostCommitNonRevertiblePhase stage 4 of 4 with 9 MutationType ops Statement: ALTER TABLE defaultdb.public.t ALTER PRIMARY KEY USING COLUMNS (k) TableID: 104 *scop.MakeIndexAbsent - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹k›) - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 2 TableID: 104 *scop.CreateGCJobForIndex @@ -462,14 +414,6 @@ PostCommitNonRevertiblePhase stage 4 of 4 with 9 MutationType ops TableID: 104 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹k›) - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 104 *scop.RemoveJobStateFromDescriptor DescriptorID: 104 diff --git a/pkg/sql/schemachanger/scplan/testdata/alter_table_drop_column b/pkg/sql/schemachanger/scplan/testdata/alter_table_drop_column index 7c12a009e910..06b4d7db546b 100644 --- a/pkg/sql/schemachanger/scplan/testdata/alter_table_drop_column +++ b/pkg/sql/schemachanger/scplan/testdata/alter_table_drop_column @@ -14,7 +14,7 @@ SET sql_safe_updates = false; ops ALTER TABLE defaultdb.foo DROP COLUMN v1 CASCADE; ---- -StatementPhase stage 1 of 1 with 11 MutationType ops +StatementPhase stage 1 of 1 with 10 MutationType ops transitions: [[Column:{DescID: 107, ColumnID: 2}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 107, Name: v1, ColumnID: 2}, ABSENT], PUBLIC] -> ABSENT @@ -36,21 +36,6 @@ StatementPhase stage 1 of 1 with 11 MutationType ops *scop.MakePublicColumnWriteOnly ColumnID: 2 TableID: 107 - *scop.LogEvent - Element: - Column: - columnId: 2 - pgAttributeNum: 2 - tableId: 107 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v1› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.SetColumnName ColumnID: 2 Name: crdb_internal_column_2_name_placeholder @@ -214,7 +199,7 @@ PostCommitPhase stage 7 of 7 with 1 ValidationType op *scop.ValidateIndex IndexID: 3 TableID: 107 -PostCommitNonRevertiblePhase stage 1 of 3 with 25 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 3 with 24 MutationType ops transitions: [[Column:{DescID: 107, ColumnID: 2}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -289,22 +274,6 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 25 MutationType ops *scop.MakeWriteOnlyIndexDeleteOnly IndexID: 4 TableID: 107 - *scop.LogEvent - Element: - SecondaryIndex: - constraintId: 1 - indexId: 2 - isUnique: true - tableId: 107 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v1› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.MakeWriteOnlyIndexDeleteOnly IndexID: 2 TableID: 107 @@ -320,68 +289,20 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 25 MutationType ops SchemaID: 101 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v1› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v1› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v1› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v1› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v1› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 108 *scop.MakeValidatedPrimaryIndexPublic - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v1› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 3 TableID: 107 *scop.SetJobStateOnDescriptor @@ -395,7 +316,7 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 25 MutationType ops *scop.UpdateSchemaChangerJob IsNonCancelable: true JobID: 1 -PostCommitNonRevertiblePhase stage 2 of 3 with 9 MutationType ops +PostCommitNonRevertiblePhase stage 2 of 3 with 8 MutationType ops transitions: [[PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, ABSENT], VALIDATED] -> DELETE_ONLY [[SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, ABSENT], DELETE_ONLY] -> ABSENT @@ -405,29 +326,6 @@ PostCommitNonRevertiblePhase stage 2 of 3 with 9 MutationType ops *scop.MakeIndexAbsent IndexID: 2 TableID: 107 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 1 - - 2 - - 3 - toId: 107 - usesRelationIds: - - 107 - usesTypeIds: - - 104 - viewId: 108 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v1› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 108 *scop.MakeIndexAbsent @@ -465,14 +363,6 @@ PostCommitNonRevertiblePhase stage 3 of 3 with 11 MutationType ops - 104 - 105 *scop.MakeIndexAbsent - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v1› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 1 TableID: 107 *scop.CreateGCJobForIndex @@ -492,14 +382,6 @@ PostCommitNonRevertiblePhase stage 3 of 3 with 11 MutationType ops TableID: 107 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v1› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 107 *scop.RemoveJobStateFromDescriptor DescriptorID: 104 @@ -961,7 +843,7 @@ ALTER TABLE defaultdb.foo DROP COLUMN v1 CASCADE; ops ALTER TABLE defaultdb.foo DROP COLUMN v2 CASCADE; ---- -StatementPhase stage 1 of 1 with 11 MutationType ops +StatementPhase stage 1 of 1 with 10 MutationType ops transitions: [[Column:{DescID: 107, ColumnID: 3}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 107, Name: v2, ColumnID: 3}, ABSENT], PUBLIC] -> ABSENT @@ -1021,21 +903,6 @@ StatementPhase stage 1 of 1 with 11 MutationType ops *scop.MakePublicColumnWriteOnly ColumnID: 3 TableID: 107 - *scop.LogEvent - Element: - Column: - columnId: 3 - pgAttributeNum: 3 - tableId: 107 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v2› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.SetColumnName ColumnID: 3 Name: crdb_internal_column_3_name_placeholder @@ -1173,7 +1040,7 @@ PostCommitPhase stage 7 of 7 with 1 ValidationType op *scop.ValidateIndex IndexID: 3 TableID: 107 -PostCommitNonRevertiblePhase stage 1 of 3 with 26 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 3 with 25 MutationType ops transitions: [[Column:{DescID: 107, ColumnID: 3}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[IndexColumn:{DescID: 107, ColumnID: 1, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -1248,22 +1115,6 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 26 MutationType ops *scop.MakeWriteOnlyIndexDeleteOnly IndexID: 4 TableID: 107 - *scop.LogEvent - Element: - SecondaryIndex: - constraintId: 1 - indexId: 2 - isUnique: true - tableId: 107 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v2› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.MakeWriteOnlyIndexDeleteOnly IndexID: 2 TableID: 107 @@ -1279,68 +1130,20 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 26 MutationType ops SchemaID: 101 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v2› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v2› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v2› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v2› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v2› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 108 *scop.MakeValidatedPrimaryIndexPublic - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v2› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 3 TableID: 107 *scop.SetJobStateOnDescriptor @@ -1356,7 +1159,7 @@ PostCommitNonRevertiblePhase stage 1 of 3 with 26 MutationType ops *scop.UpdateSchemaChangerJob IsNonCancelable: true JobID: 1 -PostCommitNonRevertiblePhase stage 2 of 3 with 10 MutationType ops +PostCommitNonRevertiblePhase stage 2 of 3 with 9 MutationType ops transitions: [[PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 2}, ABSENT], VALIDATED] -> DELETE_ONLY [[SecondaryIndex:{DescID: 107, IndexID: 2, ConstraintID: 1}, ABSENT], DELETE_ONLY] -> ABSENT @@ -1366,29 +1169,6 @@ PostCommitNonRevertiblePhase stage 2 of 3 with 10 MutationType ops *scop.MakeIndexAbsent IndexID: 2 TableID: 107 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 1 - - 2 - - 3 - toId: 107 - usesRelationIds: - - 107 - usesTypeIds: - - 104 - viewId: 108 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v2› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 108 *scop.MakeIndexAbsent @@ -1429,14 +1209,6 @@ PostCommitNonRevertiblePhase stage 3 of 3 with 12 MutationType ops SequenceIDs: - 106 *scop.MakeIndexAbsent - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v2› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 IndexID: 1 TableID: 107 *scop.CreateGCJobForIndex @@ -1456,14 +1228,6 @@ PostCommitNonRevertiblePhase stage 3 of 3 with 12 MutationType ops TableID: 107 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: ALTER TABLE ‹defaultdb›.public.‹foo› DROP COLUMN ‹v2› CASCADE - StatementTag: ALTER TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 107 *scop.RemoveJobStateFromDescriptor DescriptorID: 104 diff --git a/pkg/sql/schemachanger/scplan/testdata/comment_on b/pkg/sql/schemachanger/scplan/testdata/comment_on index debab4d1af54..4e0ea70b6cd0 100644 --- a/pkg/sql/schemachanger/scplan/testdata/comment_on +++ b/pkg/sql/schemachanger/scplan/testdata/comment_on @@ -11,82 +11,40 @@ CREATE TABLE db1.sc1.t1 ( ops COMMENT ON DATABASE db1 IS 'db1 is good'; ---- -StatementPhase stage 1 of 1 with 2 MutationType ops +StatementPhase stage 1 of 1 with 1 MutationType op transitions: [[DatabaseComment:{DescID: 104, Comment: db1 is good}, PUBLIC], ABSENT] -> PUBLIC ops: *scop.UpsertDatabaseComment Comment: db1 is good DatabaseID: 104 - *scop.LogEvent - Element: - DatabaseComment: - comment: db1 is good - databaseId: 104 - EventBase: - Authorization: - UserName: root - Statement: COMMENT ON DATABASE ‹db1› IS 'db1 is good' - StatementTag: COMMENT ON DATABASE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 ops COMMENT ON SCHEMA db1.sc1 IS 'sc1 is good'; ---- -StatementPhase stage 1 of 1 with 2 MutationType ops +StatementPhase stage 1 of 1 with 1 MutationType op transitions: [[SchemaComment:{DescID: 106, Comment: sc1 is good}, PUBLIC], ABSENT] -> PUBLIC ops: *scop.UpsertSchemaComment Comment: sc1 is good SchemaID: 106 - *scop.LogEvent - Element: - SchemaComment: - comment: sc1 is good - schemaId: 106 - EventBase: - Authorization: - UserName: root - Statement: COMMENT ON SCHEMA ‹db1›.‹sc1› IS 'sc1 is good' - StatementTag: COMMENT ON SCHEMA - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 ops COMMENT ON TABLE db1.sc1.t1 IS 't1 is good'; ---- -StatementPhase stage 1 of 1 with 2 MutationType ops +StatementPhase stage 1 of 1 with 1 MutationType op transitions: [[TableComment:{DescID: 107, Comment: t1 is good}, PUBLIC], ABSENT] -> PUBLIC ops: *scop.UpsertTableComment Comment: t1 is good TableID: 107 - *scop.LogEvent - Element: - TableComment: - comment: t1 is good - tableId: 107 - EventBase: - Authorization: - UserName: root - Statement: COMMENT ON TABLE ‹db1›.‹sc1›.‹t1› IS 't1 is good' - StatementTag: COMMENT ON TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 ops COMMENT ON COLUMN db1.sc1.t1.id IS 'id is important'; ---- -StatementPhase stage 1 of 1 with 2 MutationType ops +StatementPhase stage 1 of 1 with 1 MutationType op transitions: [[ColumnComment:{DescID: 107, ColumnID: 1, Comment: id is important}, PUBLIC], ABSENT] -> PUBLIC ops: @@ -95,27 +53,11 @@ StatementPhase stage 1 of 1 with 2 MutationType ops Comment: id is important PGAttributeNum: 1 TableID: 107 - *scop.LogEvent - Element: - ColumnComment: - columnId: 1 - comment: id is important - pgAttributeNum: 1 - tableId: 107 - EventBase: - Authorization: - UserName: root - Statement: COMMENT ON COLUMN ‹db1›.‹sc1›.‹t1›.‹id› IS 'id is important' - StatementTag: COMMENT ON COLUMN - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 ops COMMENT ON INDEX db1.sc1.t1_pkey IS 'pkey is good'; ---- -StatementPhase stage 1 of 1 with 2 MutationType ops +StatementPhase stage 1 of 1 with 1 MutationType op transitions: [[IndexComment:{DescID: 107, IndexID: 1, Comment: pkey is good}, PUBLIC], ABSENT] -> PUBLIC ops: @@ -123,26 +65,11 @@ StatementPhase stage 1 of 1 with 2 MutationType ops Comment: pkey is good IndexID: 1 TableID: 107 - *scop.LogEvent - Element: - IndexComment: - comment: pkey is good - indexId: 1 - tableId: 107 - EventBase: - Authorization: - UserName: root - Statement: COMMENT ON INDEX ‹db1›.‹sc1›.‹t1›@‹t1_pkey› IS 'pkey is good' - StatementTag: COMMENT ON INDEX - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 ops COMMENT ON CONSTRAINT t1_amount_gt_10 ON db1.sc1.t1 IS 'this is a rule'; ---- -StatementPhase stage 1 of 1 with 2 MutationType ops +StatementPhase stage 1 of 1 with 1 MutationType op transitions: [[ConstraintComment:{DescID: 107, ConstraintID: 2, Comment: this is a rule}, PUBLIC], ABSENT] -> PUBLIC ops: @@ -150,22 +77,6 @@ StatementPhase stage 1 of 1 with 2 MutationType ops Comment: this is a rule ConstraintID: 2 TableID: 107 - *scop.LogEvent - Element: - ConstraintComment: - comment: this is a rule - constraintId: 2 - tableId: 107 - EventBase: - Authorization: - UserName: root - Statement: COMMENT ON CONSTRAINT ‹t1_amount_gt_10› ON ‹db1›.‹sc1›.‹t1› IS 'this - is a rule' - StatementTag: COMMENT ON CONSTRAINT - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 setup COMMENT ON DATABASE db1 IS 'db1 is good'; @@ -179,26 +90,12 @@ COMMENT ON CONSTRAINT t1_amount_gt_10 ON db1.sc1.t1 IS 'this is a rule'; ops COMMENT ON DATABASE db1 IS NULL; ---- -StatementPhase stage 1 of 1 with 2 MutationType ops +StatementPhase stage 1 of 1 with 1 MutationType op transitions: [[DatabaseComment:{DescID: 104, Comment: db1 is good}, ABSENT], PUBLIC] -> ABSENT ops: *scop.RemoveDatabaseComment DatabaseID: 104 - *scop.LogEvent - Element: - DatabaseComment: - comment: db1 is good - databaseId: 104 - EventBase: - Authorization: - UserName: root - Statement: COMMENT ON DATABASE ‹db1› IS NULL - StatementTag: COMMENT ON DATABASE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 ops COMMENT ON SCHEMA db1.sc1 IS NULL; @@ -213,31 +110,17 @@ StatementPhase stage 1 of 1 with 1 MutationType op ops COMMENT ON TABLE db1.sc1.t1 IS NULL; ---- -StatementPhase stage 1 of 1 with 2 MutationType ops +StatementPhase stage 1 of 1 with 1 MutationType op transitions: [[TableComment:{DescID: 107, Comment: t1 is good}, ABSENT], PUBLIC] -> ABSENT ops: *scop.RemoveTableComment TableID: 107 - *scop.LogEvent - Element: - TableComment: - comment: t1 is good - tableId: 107 - EventBase: - Authorization: - UserName: root - Statement: COMMENT ON TABLE ‹db1›.‹sc1›.‹t1› IS NULL - StatementTag: COMMENT ON TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 ops COMMENT ON COLUMN db1.sc1.t1.id IS NULL; ---- -StatementPhase stage 1 of 1 with 2 MutationType ops +StatementPhase stage 1 of 1 with 1 MutationType op transitions: [[ColumnComment:{DescID: 107, ColumnID: 1, Comment: id is important}, ABSENT], PUBLIC] -> ABSENT ops: @@ -245,71 +128,25 @@ StatementPhase stage 1 of 1 with 2 MutationType ops ColumnID: 1 PgAttributeNum: 1 TableID: 107 - *scop.LogEvent - Element: - ColumnComment: - columnId: 1 - comment: id is important - pgAttributeNum: 1 - tableId: 107 - EventBase: - Authorization: - UserName: root - Statement: COMMENT ON COLUMN ‹db1›.‹sc1›.‹t1›.‹id› IS NULL - StatementTag: COMMENT ON COLUMN - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 ops COMMENT ON INDEX db1.sc1.t1_pkey IS NULL; ---- -StatementPhase stage 1 of 1 with 2 MutationType ops +StatementPhase stage 1 of 1 with 1 MutationType op transitions: [[IndexComment:{DescID: 107, IndexID: 1, Comment: pkey is good}, ABSENT], PUBLIC] -> ABSENT ops: *scop.RemoveIndexComment IndexID: 1 TableID: 107 - *scop.LogEvent - Element: - IndexComment: - comment: pkey is good - indexId: 1 - tableId: 107 - EventBase: - Authorization: - UserName: root - Statement: COMMENT ON INDEX ‹db1›.‹sc1›.‹t1›@‹t1_pkey› IS NULL - StatementTag: COMMENT ON INDEX - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 ops COMMENT ON CONSTRAINT t1_amount_gt_10 ON db1.sc1.t1 IS NULL; ---- -StatementPhase stage 1 of 1 with 2 MutationType ops +StatementPhase stage 1 of 1 with 1 MutationType op transitions: [[ConstraintComment:{DescID: 107, ConstraintID: 2, Comment: this is a rule}, ABSENT], PUBLIC] -> ABSENT ops: *scop.RemoveConstraintComment ConstraintID: 2 TableID: 107 - *scop.LogEvent - Element: - ConstraintComment: - comment: this is a rule - constraintId: 2 - tableId: 107 - EventBase: - Authorization: - UserName: root - Statement: COMMENT ON CONSTRAINT ‹t1_amount_gt_10› ON ‹db1›.‹sc1›.‹t1› IS NULL - StatementTag: COMMENT ON CONSTRAINT - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 diff --git a/pkg/sql/schemachanger/scplan/testdata/create_index b/pkg/sql/schemachanger/scplan/testdata/create_index index b85441a776a2..3aedf9764b98 100644 --- a/pkg/sql/schemachanger/scplan/testdata/create_index +++ b/pkg/sql/schemachanger/scplan/testdata/create_index @@ -150,7 +150,7 @@ PostCommitPhase stage 7 of 7 with 1 ValidationType op *scop.ValidateIndex IndexID: 2 TableID: 104 -PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 2 with 5 MutationType ops transitions: [[SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC], VALIDATED] -> PUBLIC [[TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 1, SourceIndexID: 1}, TRANSIENT_ABSENT], WRITE_ONLY] -> TRANSIENT_DELETE_ONLY @@ -158,28 +158,11 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops [[IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3}, TRANSIENT_ABSENT], PUBLIC] -> TRANSIENT_ABSENT [[IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3}, TRANSIENT_ABSENT], PUBLIC] -> TRANSIENT_ABSENT ops: - *scop.RefreshStats - TableID: 104 - *scop.LogEvent - Element: - SecondaryIndex: - indexId: 2 - sourceIndexId: 1 - tableId: 104 - temporaryIndexId: 3 - EventBase: - Authorization: - UserName: root - Statement: CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING - (‹money›) - StatementTag: CREATE INDEX - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 *scop.MakeValidatedSecondaryIndexPublic IndexID: 2 TableID: 104 + *scop.RefreshStats + TableID: 104 *scop.MakeWriteOnlyIndexDeleteOnly IndexID: 3 TableID: 104 @@ -502,37 +485,18 @@ PostCommitPhase stage 7 of 7 with 1 ValidationType op *scop.ValidateIndex IndexID: 2 TableID: 104 -PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 2 with 5 MutationType ops transitions: [[SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0, TemporaryIndexID: 3, SourceIndexID: 1}, PUBLIC], VALIDATED] -> PUBLIC [[TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 1, SourceIndexID: 1}, TRANSIENT_ABSENT], WRITE_ONLY] -> TRANSIENT_DELETE_ONLY [[IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3}, TRANSIENT_ABSENT], PUBLIC] -> TRANSIENT_ABSENT [[IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 3}, TRANSIENT_ABSENT], PUBLIC] -> TRANSIENT_ABSENT ops: - *scop.RefreshStats - TableID: 104 - *scop.LogEvent - Element: - SecondaryIndex: - indexId: 2 - isConcurrently: true - isInverted: true - sourceIndexId: 1 - tableId: 104 - temporaryIndexId: 3 - EventBase: - Authorization: - UserName: root - Statement: CREATE INVERTED INDEX CONCURRENTLY ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, - ‹name› gin_trgm_ops) - StatementTag: CREATE INDEX - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 2 *scop.MakeValidatedSecondaryIndexPublic IndexID: 2 TableID: 104 + *scop.RefreshStats + TableID: 104 *scop.MakeWriteOnlyIndexDeleteOnly IndexID: 3 TableID: 104 diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_database b/pkg/sql/schemachanger/scplan/testdata/drop_database index da3822027322..44b503966052 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_database +++ b/pkg/sql/schemachanger/scplan/testdata/drop_database @@ -96,7 +96,7 @@ StatementPhase stage 1 of 1 with 14 MutationType ops DescriptorID: 116 *scop.MarkDescriptorAsSyntheticallyDropped DescriptorID: 117 -PreCommitPhase stage 1 of 1 with 91 MutationType ops +PreCommitPhase stage 1 of 1 with 89 MutationType ops transitions: [[Namespace:{DescID: 104, Name: db1, ReferencedDescID: 0}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -301,20 +301,6 @@ PreCommitPhase stage 1 of 1 with 91 MutationType ops DatabaseID: 104 *scop.RemoveDatabaseComment DatabaseID: 104 - *scop.LogEvent - Element: - DatabaseComment: - comment: db1 is good - databaseId: 104 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.MarkDescriptorAsDropped DescriptorID: 105 *scop.RemoveSchemaParent @@ -347,20 +333,6 @@ PreCommitPhase stage 1 of 1 with 91 MutationType ops DescriptorID: 109 *scop.RemoveTableComment TableID: 109 - *scop.LogEvent - Element: - TableComment: - comment: t1 is good - tableId: 109 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 - TargetStatus: 1 *scop.RemoveColumnDefaultExpression ColumnID: 3 TableID: 109 @@ -437,47 +409,15 @@ PreCommitPhase stage 1 of 1 with 91 MutationType ops SchemaID: 105 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 TableID: 110 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 TableID: 110 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 TableID: 110 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 TableID: 110 *scop.DrainDescriptorName Namespace: @@ -493,47 +433,15 @@ PreCommitPhase stage 1 of 1 with 91 MutationType ops SchemaID: 106 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 TableID: 109 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 TableID: 109 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 TableID: 109 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 TableID: 109 *scop.DrainDescriptorName Namespace: @@ -543,36 +451,12 @@ PreCommitPhase stage 1 of 1 with 91 MutationType ops SchemaID: 106 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 8 - SubWorkID: 1 TableID: 111 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 8 - SubWorkID: 1 TableID: 111 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 8 - SubWorkID: 1 TableID: 111 *scop.DrainDescriptorName Namespace: @@ -582,47 +466,15 @@ PreCommitPhase stage 1 of 1 with 91 MutationType ops SchemaID: 106 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 9 - SubWorkID: 1 TableID: 112 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 9 - SubWorkID: 1 TableID: 112 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 9 - SubWorkID: 1 TableID: 112 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 9 - SubWorkID: 1 TableID: 112 *scop.DrainDescriptorName Namespace: @@ -632,47 +484,15 @@ PreCommitPhase stage 1 of 1 with 91 MutationType ops SchemaID: 106 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 10 - SubWorkID: 1 TableID: 113 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 10 - SubWorkID: 1 TableID: 113 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 10 - SubWorkID: 1 TableID: 113 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 10 - SubWorkID: 1 TableID: 113 *scop.DrainDescriptorName Namespace: @@ -682,47 +502,15 @@ PreCommitPhase stage 1 of 1 with 91 MutationType ops SchemaID: 106 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 10 - SubWorkID: 1 TableID: 114 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 10 - SubWorkID: 1 TableID: 114 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 10 - SubWorkID: 1 TableID: 114 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 10 - SubWorkID: 1 TableID: 114 *scop.DrainDescriptorName Namespace: @@ -744,80 +532,24 @@ PreCommitPhase stage 1 of 1 with 91 MutationType ops SchemaID: 106 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 12 - SubWorkID: 1 TableID: 117 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 12 - SubWorkID: 1 TableID: 117 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 12 - SubWorkID: 1 TableID: 117 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 12 - SubWorkID: 1 TableID: 117 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 12 - SubWorkID: 1 TableID: 117 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 TableID: 110 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 TableID: 109 *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -881,13 +613,13 @@ PreCommitPhase stage 1 of 1 with 91 MutationType ops - 117 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 31 MutationType ops + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 17 MutationType ops pending Statements: - statement: DROP DATABASE db1 CASCADE redactedstatement: DROP DATABASE ‹db1› CASCADE statementtag: DROP DATABASE -PostCommitNonRevertiblePhase stage 1 of 1 with 46 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 1 with 32 MutationType ops transitions: [[Database:{DescID: 104}, ABSENT], DROPPED] -> ABSENT [[DatabaseData:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -911,284 +643,48 @@ PostCommitNonRevertiblePhase stage 1 of 1 with 46 MutationType ops [[AliasType:{DescID: 116, ReferencedTypeIDs: [115 116]}, ABSENT], DROPPED] -> ABSENT [[View:{DescID: 117}, ABSENT], DROPPED] -> ABSENT ops: - *scop.LogEvent - Element: - Database: - databaseId: 104 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 104 *scop.CreateGCJobForDatabase DatabaseID: 104 StatementForDropJob: Statement: DROP DATABASE db1 CASCADE - *scop.LogEvent - Element: - Schema: - isPublic: true - schemaId: 105 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 105 - *scop.LogEvent - Element: - Schema: - schemaId: 106 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 106 - *scop.LogEvent - Element: - Sequence: - sequenceId: 107 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 104 StatementForDropJob: Statement: DROP DATABASE db1 CASCADE TableID: 107 - *scop.LogEvent - Element: - Table: - tableId: 110 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 104 StatementForDropJob: Statement: DROP DATABASE db1 CASCADE TableID: 110 - *scop.LogEvent - Element: - Sequence: - sequenceId: 108 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 104 StatementForDropJob: Statement: DROP DATABASE db1 CASCADE TableID: 108 - *scop.LogEvent - Element: - Table: - tableId: 109 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 104 StatementForDropJob: Statement: DROP DATABASE db1 CASCADE TableID: 109 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 2 - toId: 109 - usesRelationIds: - - 109 - viewId: 111 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 8 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 111 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 1 - toId: 111 - usesRelationIds: - - 111 - viewId: 112 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 9 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 112 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 1 - toId: 111 - - columnIds: - - 1 - - 2 - toId: 112 - usesRelationIds: - - 111 - - 112 - viewId: 113 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 10 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 113 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 1 - - 2 - toId: 112 - usesRelationIds: - - 112 - viewId: 114 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 10 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 114 - *scop.LogEvent - Element: - EnumType: - arrayTypeId: 116 - typeId: 115 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 115 - *scop.LogEvent - Element: - AliasType: - closedTypeIds: - - 115 - - 116 - type: - arrayContents: - family: EnumFamily - oid: 100115 - udtMetadata: - arrayTypeOid: 100116 - arrayElemType: EnumFamily - family: ArrayFamily - oid: 100116 - typeId: 116 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 14 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 116 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 1 - - 2 - toId: 114 - usesRelationIds: - - 114 - usesTypeIds: - - 115 - - 116 - viewId: 117 - EventBase: - Authorization: - UserName: root - Statement: DROP DATABASE ‹db1› CASCADE - StatementTag: DROP DATABASE - TargetMetadata: - SourceElementID: 12 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 117 *scop.CreateGCJobForIndex diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_index b/pkg/sql/schemachanger/scplan/testdata/drop_index index ae688922df00..26797d7cc10f 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_index +++ b/pkg/sql/schemachanger/scplan/testdata/drop_index @@ -40,31 +40,16 @@ PreCommitPhase stage 1 of 1 with 2 MutationType ops - 104 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 3 MutationType ops pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 2 MutationType ops pending Statements: - statement: DROP INDEX idx1 CASCADE redactedstatement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx1› CASCADE statementtag: DROP INDEX -PostCommitNonRevertiblePhase stage 1 of 2 with 5 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops transitions: [[SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 104, Name: idx1, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT ops: - *scop.LogEvent - Element: - SecondaryIndex: - indexId: 2 - isCreatedExplicitly: true - tableId: 104 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx1› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.MakeWriteOnlyIndexDeleteOnly IndexID: 2 TableID: 104 @@ -150,7 +135,7 @@ DROP INDEX idx1 CASCADE ops DROP INDEX idx2 CASCADE ---- -StatementPhase stage 1 of 1 with 4 MutationType ops +StatementPhase stage 1 of 1 with 3 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 4}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 4}, ABSENT], PUBLIC] -> ABSENT @@ -162,22 +147,6 @@ StatementPhase stage 1 of 1 with 4 MutationType ops *scop.MakePublicColumnWriteOnly ColumnID: 4 TableID: 104 - *scop.LogEvent - Element: - Column: - columnId: 4 - isInaccessible: true - pgAttributeNum: 4 - tableId: 104 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx2› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 - TargetStatus: 1 *scop.SetColumnName ColumnID: 4 Name: crdb_internal_column_4_name_placeholder @@ -197,12 +166,12 @@ PreCommitPhase stage 1 of 1 with 2 MutationType ops - 104 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 3 MutationType ops pending Statements: - statement: DROP INDEX idx2 CASCADE redactedstatement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx2› CASCADE statementtag: DROP INDEX -PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 2 with 5 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 4}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY @@ -211,21 +180,6 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops *scop.MakeWriteOnlyColumnDeleteOnly ColumnID: 4 TableID: 104 - *scop.LogEvent - Element: - SecondaryIndex: - indexId: 4 - isCreatedExplicitly: true - tableId: 104 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx2› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.MakeWriteOnlyIndexDeleteOnly IndexID: 4 TableID: 104 @@ -259,14 +213,6 @@ PostCommitNonRevertiblePhase stage 2 of 2 with 6 MutationType ops TableID: 104 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx2› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 104 *scop.RemoveJobStateFromDescriptor DescriptorID: 104 @@ -380,7 +326,7 @@ DROP INDEX idx2 CASCADE ops DROP INDEX idx3 CASCADE ---- -StatementPhase stage 1 of 1 with 6 MutationType ops +StatementPhase stage 1 of 1 with 5 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 5}, ABSENT], PUBLIC] -> WRITE_ONLY [[ColumnName:{DescID: 104, Name: crdb_internal_i_shard_16, ColumnID: 5}, ABSENT], PUBLIC] -> ABSENT @@ -401,22 +347,6 @@ StatementPhase stage 1 of 1 with 6 MutationType ops *scop.MakePublicColumnWriteOnly ColumnID: 5 TableID: 104 - *scop.LogEvent - Element: - Column: - columnId: 5 - isHidden: true - pgAttributeNum: 5 - tableId: 104 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx3› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 - TargetStatus: 1 *scop.SetColumnName ColumnID: 5 Name: crdb_internal_column_5_name_placeholder @@ -437,12 +367,12 @@ PreCommitPhase stage 1 of 1 with 2 MutationType ops - 104 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 5 MutationType ops pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops pending Statements: - statement: DROP INDEX idx3 CASCADE redactedstatement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx3› CASCADE statementtag: DROP INDEX -PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops transitions: [[Column:{DescID: 104, ColumnID: 5}, ABSENT], WRITE_ONLY] -> DELETE_ONLY [[SecondaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY @@ -455,27 +385,6 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops *scop.RemoveCheckConstraint ConstraintID: 2 TableID: 104 - *scop.LogEvent - Element: - SecondaryIndex: - indexId: 6 - isCreatedExplicitly: true - sharding: - columnNames: - - i - isSharded: true - name: crdb_internal_i_shard_16 - shardBuckets: 16 - tableId: 104 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx3› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.MakeWriteOnlyIndexDeleteOnly IndexID: 6 TableID: 104 @@ -505,14 +414,6 @@ PostCommitNonRevertiblePhase stage 2 of 2 with 5 MutationType ops TableID: 104 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 5 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx3› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 104 *scop.RemoveJobStateFromDescriptor DescriptorID: 104 @@ -689,36 +590,12 @@ PreCommitPhase stage 1 of 1 with 10 MutationType ops SchemaID: 101 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx4› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 105 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx4› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 105 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx4› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 105 *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -734,56 +611,19 @@ PreCommitPhase stage 1 of 1 with 10 MutationType ops - 105 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 5 MutationType ops pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 3 MutationType ops pending Statements: - statement: DROP INDEX idx4 CASCADE redactedstatement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx4› CASCADE statementtag: DROP INDEX -PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 2 with 5 MutationType ops transitions: [[SecondaryIndex:{DescID: 104, IndexID: 8, ConstraintID: 3}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 104, Name: idx4, IndexID: 8}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 105}, ABSENT], DROPPED] -> ABSENT ops: - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 2 - indexId: 8 - toId: 104 - usesRelationIds: - - 104 - viewId: 105 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx4› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 105 - *scop.LogEvent - Element: - SecondaryIndex: - constraintId: 3 - indexId: 8 - isCreatedExplicitly: true - isUnique: true - tableId: 104 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹t1›@‹idx4› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.MakeWriteOnlyIndexDeleteOnly IndexID: 8 TableID: 104 @@ -1044,47 +884,15 @@ PreCommitPhase stage 1 of 1 with 12 MutationType ops SchemaID: 101 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹v2›@‹idx› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 107 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹v2›@‹idx› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 107 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹v2›@‹idx› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 107 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹v2›@‹idx› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 107 *scop.SetJobStateOnDescriptor DescriptorID: 106 @@ -1100,12 +908,12 @@ PreCommitPhase stage 1 of 1 with 12 MutationType ops - 107 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops pending Statements: - statement: DROP INDEX v2@idx CASCADE redactedstatement: DROP INDEX ‹defaultdb›.public.‹v2›@‹idx› CASCADE statementtag: DROP INDEX -PostCommitNonRevertiblePhase stage 1 of 2 with 8 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops transitions: [[SecondaryIndex:{DescID: 106, IndexID: 2, ConstraintID: 0}, ABSENT], VALIDATED] -> DELETE_ONLY [[IndexName:{DescID: 106, Name: idx, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT @@ -1113,47 +921,11 @@ PostCommitNonRevertiblePhase stage 1 of 2 with 8 MutationType ops [[IndexData:{DescID: 107, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[TableData:{DescID: 107, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT ops: - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 2 - indexId: 2 - toId: 106 - isMaterialized: true - usesRelationIds: - - 106 - viewId: 107 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹v2›@‹idx› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 100 StatementForDropJob: Statement: DROP INDEX defaultdb.public.v2@idx CASCADE TableID: 107 - *scop.LogEvent - Element: - SecondaryIndex: - indexId: 2 - isCreatedExplicitly: true - tableId: 106 - EventBase: - Authorization: - UserName: root - Statement: DROP INDEX ‹defaultdb›.public.‹v2›@‹idx› CASCADE - StatementTag: DROP INDEX - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.MakeWriteOnlyIndexDeleteOnly IndexID: 2 TableID: 106 diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_owned_by b/pkg/sql/schemachanger/scplan/testdata/drop_owned_by index 323244149fff..46e20af97bff 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_owned_by +++ b/pkg/sql/schemachanger/scplan/testdata/drop_owned_by @@ -269,47 +269,15 @@ PreCommitPhase stage 1 of 1 with 57 MutationType ops SchemaID: 101 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 109 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 109 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 109 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 109 *scop.DrainDescriptorName Namespace: @@ -325,47 +293,15 @@ PreCommitPhase stage 1 of 1 with 57 MutationType ops SchemaID: 105 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 108 *scop.DrainDescriptorName Namespace: @@ -375,36 +311,12 @@ PreCommitPhase stage 1 of 1 with 57 MutationType ops SchemaID: 105 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 110 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 110 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 110 *scop.DrainDescriptorName Namespace: @@ -426,69 +338,21 @@ PreCommitPhase stage 1 of 1 with 57 MutationType ops SchemaID: 105 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 113 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 113 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 113 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 113 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 109 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 108 *scop.SetJobStateOnDescriptor DescriptorID: 100 @@ -540,13 +404,13 @@ PreCommitPhase stage 1 of 1 with 57 MutationType ops - 113 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 20 MutationType ops + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 11 MutationType ops pending Statements: - statement: DROP OWNED BY r redactedstatement: DROP OWNED BY r statementtag: DROP OWNED BY -PostCommitNonRevertiblePhase stage 1 of 1 with 32 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 1 with 23 MutationType ops transitions: [[Schema:{DescID: 105}, ABSENT], DROPPED] -> ABSENT [[Sequence:{DescID: 106}, ABSENT], DROPPED] -> ABSENT @@ -564,179 +428,34 @@ PostCommitNonRevertiblePhase stage 1 of 1 with 32 MutationType ops [[AliasType:{DescID: 112, ReferencedTypeIDs: [111 112]}, ABSENT], DROPPED] -> ABSENT [[View:{DescID: 113}, ABSENT], DROPPED] -> ABSENT ops: - *scop.LogEvent - Element: - Schema: - schemaId: 105 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 105 - *scop.LogEvent - Element: - Sequence: - sequenceId: 106 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 100 StatementForDropJob: Statement: DROP OWNED BY r TableID: 106 - *scop.LogEvent - Element: - Table: - tableId: 109 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 100 StatementForDropJob: Statement: DROP OWNED BY r TableID: 109 - *scop.LogEvent - Element: - Sequence: - sequenceId: 107 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 100 StatementForDropJob: Statement: DROP OWNED BY r TableID: 107 - *scop.LogEvent - Element: - Table: - tableId: 108 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 100 StatementForDropJob: Statement: DROP OWNED BY r TableID: 108 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 2 - toId: 108 - usesRelationIds: - - 108 - viewId: 110 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 110 - *scop.LogEvent - Element: - EnumType: - arrayTypeId: 112 - typeId: 111 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 111 - *scop.LogEvent - Element: - AliasType: - closedTypeIds: - - 111 - - 112 - type: - arrayContents: - family: EnumFamily - oid: 100111 - udtMetadata: - arrayTypeOid: 100112 - arrayElemType: EnumFamily - family: ArrayFamily - oid: 100112 - typeId: 112 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 112 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 1 - toId: 110 - usesRelationIds: - - 110 - usesTypeIds: - - 111 - - 112 - viewId: 113 - EventBase: - Authorization: - UserName: root - Statement: DROP OWNED BY r - StatementTag: DROP OWNED BY - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 113 *scop.CreateGCJobForIndex diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_schema b/pkg/sql/schemachanger/scplan/testdata/drop_schema index dbd89cd3b95f..5acd6fbf43eb 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_schema +++ b/pkg/sql/schemachanger/scplan/testdata/drop_schema @@ -1126,7 +1126,7 @@ StatementPhase stage 1 of 1 with 10 MutationType ops DescriptorID: 112 *scop.MarkDescriptorAsSyntheticallyDropped DescriptorID: 113 -PreCommitPhase stage 1 of 1 with 69 MutationType ops +PreCommitPhase stage 1 of 1 with 68 MutationType ops transitions: [[Namespace:{DescID: 104, Name: sc1, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 104}, ABSENT], PUBLIC] -> ABSENT @@ -1290,20 +1290,6 @@ PreCommitPhase stage 1 of 1 with 69 MutationType ops DescriptorID: 106 *scop.RemoveTableComment TableID: 106 - *scop.LogEvent - Element: - TableComment: - comment: t1 is good table - tableId: 106 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 - TargetStatus: 1 *scop.RemoveColumnDefaultExpression ColumnID: 3 TableID: 106 @@ -1371,47 +1357,15 @@ PreCommitPhase stage 1 of 1 with 69 MutationType ops SchemaID: 104 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 106 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 106 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 106 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 106 *scop.DrainDescriptorName Namespace: @@ -1421,36 +1375,12 @@ PreCommitPhase stage 1 of 1 with 69 MutationType ops SchemaID: 104 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 4 - SubWorkID: 1 TableID: 107 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 4 - SubWorkID: 1 TableID: 107 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 4 - SubWorkID: 1 TableID: 107 *scop.DrainDescriptorName Namespace: @@ -1460,47 +1390,15 @@ PreCommitPhase stage 1 of 1 with 69 MutationType ops SchemaID: 104 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 5 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 5 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 5 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 5 - SubWorkID: 1 TableID: 108 *scop.DrainDescriptorName Namespace: @@ -1510,47 +1408,15 @@ PreCommitPhase stage 1 of 1 with 69 MutationType ops SchemaID: 104 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 TableID: 109 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 TableID: 109 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 TableID: 109 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 TableID: 109 *scop.DrainDescriptorName Namespace: @@ -1560,47 +1426,15 @@ PreCommitPhase stage 1 of 1 with 69 MutationType ops SchemaID: 104 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 TableID: 110 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 TableID: 110 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 TableID: 110 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 TableID: 110 *scop.DrainDescriptorName Namespace: @@ -1622,69 +1456,21 @@ PreCommitPhase stage 1 of 1 with 69 MutationType ops SchemaID: 104 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 8 - SubWorkID: 1 TableID: 113 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 8 - SubWorkID: 1 TableID: 113 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 8 - SubWorkID: 1 TableID: 113 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 8 - SubWorkID: 1 TableID: 113 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 8 - SubWorkID: 1 TableID: 113 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 106 *scop.SetJobStateOnDescriptor DescriptorID: 100 @@ -1736,13 +1522,13 @@ PreCommitPhase stage 1 of 1 with 69 MutationType ops - 113 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 21 MutationType ops + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 11 MutationType ops pending Statements: - statement: DROP SCHEMA defaultdb.sc1 CASCADE redactedstatement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE statementtag: DROP SCHEMA -PostCommitNonRevertiblePhase stage 1 of 1 with 33 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 1 with 23 MutationType ops transitions: [[Schema:{DescID: 104}, ABSENT], DROPPED] -> ABSENT [[Sequence:{DescID: 105}, ABSENT], DROPPED] -> ABSENT @@ -1758,213 +1544,30 @@ PostCommitNonRevertiblePhase stage 1 of 1 with 33 MutationType ops [[AliasType:{DescID: 112, ReferencedTypeIDs: [111 112]}, ABSENT], DROPPED] -> ABSENT [[View:{DescID: 113}, ABSENT], DROPPED] -> ABSENT ops: - *scop.LogEvent - Element: - Schema: - schemaId: 104 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 104 - *scop.LogEvent - Element: - Sequence: - sequenceId: 105 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 100 StatementForDropJob: Statement: DROP SCHEMA defaultdb.sc1 CASCADE TableID: 105 - *scop.LogEvent - Element: - Table: - tableId: 106 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 100 StatementForDropJob: Statement: DROP SCHEMA defaultdb.sc1 CASCADE TableID: 106 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 2 - toId: 106 - usesRelationIds: - - 106 - viewId: 107 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 4 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 107 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 1 - toId: 107 - usesRelationIds: - - 107 - viewId: 108 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 5 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 108 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 1 - toId: 107 - - columnIds: - - 1 - - 2 - toId: 108 - usesRelationIds: - - 107 - - 108 - viewId: 109 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 109 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 1 - - 2 - toId: 108 - usesRelationIds: - - 108 - viewId: 110 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 6 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 110 - *scop.LogEvent - Element: - EnumType: - arrayTypeId: 112 - typeId: 111 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 111 - *scop.LogEvent - Element: - AliasType: - closedTypeIds: - - 111 - - 112 - type: - arrayContents: - family: EnumFamily - oid: 100111 - udtMetadata: - arrayTypeOid: 100112 - arrayElemType: EnumFamily - family: ArrayFamily - oid: 100112 - typeId: 112 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 10 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 112 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 1 - - 2 - toId: 110 - usesRelationIds: - - 110 - usesTypeIds: - - 111 - - 112 - viewId: 113 - EventBase: - Authorization: - UserName: root - Statement: DROP SCHEMA ‹defaultdb›.‹sc1› CASCADE - StatementTag: DROP SCHEMA - TargetMetadata: - SourceElementID: 8 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 113 *scop.CreateGCJobForIndex diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_sequence b/pkg/sql/schemachanger/scplan/testdata/drop_sequence index 8202c21c5dda..5cd96180c427 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_sequence +++ b/pkg/sql/schemachanger/scplan/testdata/drop_sequence @@ -38,29 +38,16 @@ PreCommitPhase stage 1 of 1 with 4 MutationType ops - 104 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 2 MutationType ops pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 1 MutationType op pending Statements: - statement: DROP SEQUENCE defaultdb.sq1 redactedstatement: DROP SEQUENCE ‹defaultdb›.public.‹sq1› statementtag: DROP SEQUENCE -PostCommitNonRevertiblePhase stage 1 of 1 with 4 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 1 with 3 MutationType ops transitions: [[Sequence:{DescID: 104}, ABSENT], DROPPED] -> ABSENT [[TableData:{DescID: 104, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT ops: - *scop.LogEvent - Element: - Sequence: - sequenceId: 104 - EventBase: - Authorization: - UserName: root - Statement: DROP SEQUENCE ‹defaultdb›.public.‹sq1› - StatementTag: DROP SEQUENCE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 100 StatementForDropJob: @@ -142,29 +129,16 @@ PreCommitPhase stage 1 of 1 with 10 MutationType ops - 106 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 2 MutationType ops pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 1 MutationType op pending Statements: - statement: DROP SEQUENCE defaultdb.sq1 CASCADE redactedstatement: DROP SEQUENCE ‹defaultdb›.public.‹sq1› CASCADE statementtag: DROP SEQUENCE -PostCommitNonRevertiblePhase stage 1 of 1 with 6 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 1 with 5 MutationType ops transitions: [[Sequence:{DescID: 104}, ABSENT], DROPPED] -> ABSENT [[TableData:{DescID: 104, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT ops: - *scop.LogEvent - Element: - Sequence: - sequenceId: 104 - EventBase: - Authorization: - UserName: root - Statement: DROP SEQUENCE ‹defaultdb›.public.‹sq1› CASCADE - StatementTag: DROP SEQUENCE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 100 StatementForDropJob: diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_table b/pkg/sql/schemachanger/scplan/testdata/drop_table index 5f9f738e3532..779a7a7f48ca 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_table +++ b/pkg/sql/schemachanger/scplan/testdata/drop_table @@ -56,7 +56,7 @@ StatementPhase stage 1 of 1 with 3 MutationType ops DescriptorID: 110 *scop.MarkDescriptorAsSyntheticallyDropped DescriptorID: 111 -PreCommitPhase stage 1 of 1 with 47 MutationType ops +PreCommitPhase stage 1 of 1 with 43 MutationType ops transitions: [[Namespace:{DescID: 109, Name: shipments, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[Owner:{DescID: 109}, ABSENT], PUBLIC] -> ABSENT @@ -139,20 +139,6 @@ PreCommitPhase stage 1 of 1 with 47 MutationType ops DescriptorID: 109 *scop.RemoveTableComment TableID: 109 - *scop.LogEvent - Element: - TableComment: - comment: shipment is important - tableId: 109 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.RemoveColumnDefaultExpression ColumnID: 1 TableID: 109 @@ -160,22 +146,6 @@ PreCommitPhase stage 1 of 1 with 47 MutationType ops ColumnID: 1 PgAttributeNum: 1 TableID: 109 - *scop.LogEvent - Element: - ColumnComment: - columnId: 1 - comment: tracking_number is a must - pgAttributeNum: 1 - tableId: 109 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.RemoveDroppedColumnType ColumnID: 3 TableID: 109 @@ -195,42 +165,12 @@ PreCommitPhase stage 1 of 1 with 47 MutationType ops *scop.RemoveIndexComment IndexID: 1 TableID: 109 - *scop.LogEvent - Element: - IndexComment: - comment: pkey is good - indexId: 1 - tableId: 109 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.RemoveDroppedIndexPartialPredicate IndexID: 2 TableID: 109 *scop.RemoveConstraintComment ConstraintID: 2 TableID: 109 - *scop.LogEvent - Element: - ConstraintComment: - comment: customer is not god - constraintId: 2 - tableId: 109 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.MarkDescriptorAsDropped DescriptorID: 110 *scop.MarkDescriptorAsDropped @@ -253,47 +193,15 @@ PreCommitPhase stage 1 of 1 with 47 MutationType ops SequenceID: 110 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 109 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 109 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 109 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 109 *scop.RemoveForeignKeyBackReference OriginConstraintID: 2 @@ -323,80 +231,24 @@ PreCommitPhase stage 1 of 1 with 47 MutationType ops SchemaID: 101 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 111 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 111 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 111 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 111 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 109 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 5 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 109 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 109 *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -436,12 +288,12 @@ PreCommitPhase stage 1 of 1 with 47 MutationType ops - 111 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 8 MutationType ops pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 5 MutationType ops pending Statements: - statement: DROP TABLE defaultdb.shipments CASCADE redactedstatement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE statementtag: DROP TABLE -PostCommitNonRevertiblePhase stage 1 of 1 with 17 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 1 with 14 MutationType ops transitions: [[Table:{DescID: 109}, ABSENT], DROPPED] -> ABSENT [[IndexData:{DescID: 109, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT @@ -451,62 +303,16 @@ PostCommitNonRevertiblePhase stage 1 of 1 with 17 MutationType ops [[TableData:{DescID: 110, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT [[View:{DescID: 111}, ABSENT], DROPPED] -> ABSENT ops: - *scop.LogEvent - Element: - Table: - tableId: 109 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 100 StatementForDropJob: Statement: DROP TABLE defaultdb.public.shipments CASCADE TableID: 109 - *scop.LogEvent - Element: - Sequence: - sequenceId: 110 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 100 StatementForDropJob: Statement: DROP TABLE defaultdb.public.shipments CASCADE TableID: 110 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 2 - - 4 - toId: 109 - usesRelationIds: - - 109 - viewId: 111 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹shipments› CASCADE - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 111 *scop.CreateGCJobForIndex @@ -1359,36 +1165,12 @@ PreCommitPhase stage 1 of 1 with 20 MutationType ops SchemaID: 101 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹greeter› - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 114 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹greeter› - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 114 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹greeter› - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 114 *scop.RemoveCheckConstraint ConstraintID: 2 @@ -1400,25 +1182,9 @@ PreCommitPhase stage 1 of 1 with 20 MutationType ops - 113 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹greeter› - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 114 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹greeter› - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 114 *scop.SetJobStateOnDescriptor DescriptorID: 112 @@ -1438,31 +1204,18 @@ PreCommitPhase stage 1 of 1 with 20 MutationType ops - 114 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 4 MutationType ops pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 3 MutationType ops pending Statements: - statement: DROP TABLE defaultdb.greeter redactedstatement: DROP TABLE ‹defaultdb›.public.‹greeter› statementtag: DROP TABLE -PostCommitNonRevertiblePhase stage 1 of 1 with 8 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 1 with 7 MutationType ops transitions: [[Table:{DescID: 114}, ABSENT], DROPPED] -> ABSENT [[IndexData:{DescID: 114, IndexID: 1}, ABSENT], PUBLIC] -> ABSENT [[IndexData:{DescID: 114, IndexID: 2}, ABSENT], PUBLIC] -> ABSENT [[TableData:{DescID: 114, ReferencedDescID: 100}, ABSENT], PUBLIC] -> ABSENT ops: - *scop.LogEvent - Element: - Table: - tableId: 114 - EventBase: - Authorization: - UserName: root - Statement: DROP TABLE ‹defaultdb›.public.‹greeter› - StatementTag: DROP TABLE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.CreateGCJobForTable DatabaseID: 100 StatementForDropJob: diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_type b/pkg/sql/schemachanger/scplan/testdata/drop_type index 120eb4329b48..076754f0fa5c 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_type +++ b/pkg/sql/schemachanger/scplan/testdata/drop_type @@ -63,57 +63,18 @@ PreCommitPhase stage 1 of 1 with 7 MutationType ops - 105 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 4 MutationType ops pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 2 MutationType ops pending Statements: - statement: DROP TYPE defaultdb.typ redactedstatement: DROP TYPE ‹defaultdb›.‹public›.‹typ› statementtag: DROP TYPE -PostCommitNonRevertiblePhase stage 1 of 1 with 7 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 1 with 5 MutationType ops transitions: [[EnumType:{DescID: 104}, ABSENT], DROPPED] -> ABSENT [[AliasType:{DescID: 105, ReferencedTypeIDs: [104 105]}, ABSENT], DROPPED] -> ABSENT ops: - *scop.LogEvent - Element: - EnumType: - arrayTypeId: 105 - typeId: 104 - EventBase: - Authorization: - UserName: root - Statement: DROP TYPE ‹defaultdb›.‹public›.‹typ› - StatementTag: DROP TYPE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 104 - *scop.LogEvent - Element: - AliasType: - closedTypeIds: - - 104 - - 105 - type: - arrayContents: - family: EnumFamily - oid: 100104 - udtMetadata: - arrayTypeOid: 100105 - arrayElemType: EnumFamily - family: ArrayFamily - oid: 100105 - typeId: 105 - EventBase: - Authorization: - UserName: root - Statement: DROP TYPE ‹defaultdb›.‹public›.‹typ› - StatementTag: DROP TYPE - TargetMetadata: - SourceElementID: 2 - SubWorkID: 2 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 105 *scop.RemoveJobStateFromDescriptor @@ -267,67 +228,18 @@ PreCommitPhase stage 1 of 1 with 9 MutationType ops - 107 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 4 MutationType ops pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 2 MutationType ops pending Statements: - statement: DROP TYPE defaultdb.ctyp redactedstatement: DROP TYPE ‹defaultdb›.‹public›.‹ctyp› statementtag: DROP TYPE -PostCommitNonRevertiblePhase stage 1 of 1 with 7 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 1 with 5 MutationType ops transitions: [[CompositeType:{DescID: 106}, ABSENT], DROPPED] -> ABSENT [[AliasType:{DescID: 107, ReferencedTypeIDs: [106 107]}, ABSENT], DROPPED] -> ABSENT ops: - *scop.LogEvent - Element: - CompositeType: - arrayTypeId: 107 - typeId: 106 - EventBase: - Authorization: - UserName: root - Statement: DROP TYPE ‹defaultdb›.‹public›.‹ctyp› - StatementTag: DROP TYPE - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 106 - *scop.LogEvent - Element: - AliasType: - closedTypeIds: - - 106 - - 107 - type: - arrayContents: - family: TupleFamily - oid: 100106 - tupleContents: - - family: IntFamily - oid: 20 - width: 64 - - family: IntFamily - oid: 20 - width: 64 - tupleLabels: - - a - - b - udtMetadata: - arrayTypeOid: 100107 - arrayElemType: TupleFamily - family: ArrayFamily - oid: 100107 - typeId: 107 - EventBase: - Authorization: - UserName: root - Statement: DROP TYPE ‹defaultdb›.‹public›.‹ctyp› - StatementTag: DROP TYPE - TargetMetadata: - SourceElementID: 2 - SubWorkID: 2 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 107 *scop.RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/scplan/testdata/drop_view b/pkg/sql/schemachanger/scplan/testdata/drop_view index d90576fc4a94..9f6710a099a2 100644 --- a/pkg/sql/schemachanger/scplan/testdata/drop_view +++ b/pkg/sql/schemachanger/scplan/testdata/drop_view @@ -47,36 +47,12 @@ PreCommitPhase stage 1 of 1 with 9 MutationType ops SchemaID: 101 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 105 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 105 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 105 *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -92,34 +68,15 @@ PreCommitPhase stage 1 of 1 with 9 MutationType ops - 105 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 2 MutationType ops pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 1 MutationType op pending Statements: - statement: DROP VIEW defaultdb.v1 redactedstatement: DROP VIEW ‹defaultdb›.public.‹v1› statementtag: DROP VIEW -PostCommitNonRevertiblePhase stage 1 of 1 with 5 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 1 with 4 MutationType ops transitions: [[View:{DescID: 105}, ABSENT], DROPPED] -> ABSENT ops: - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 2 - toId: 104 - usesRelationIds: - - 104 - viewId: 105 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 105 *scop.RemoveJobStateFromDescriptor @@ -425,36 +382,12 @@ PreCommitPhase stage 1 of 1 with 45 MutationType ops SchemaID: 101 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 105 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 105 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 TableID: 105 *scop.DrainDescriptorName Namespace: @@ -464,47 +397,15 @@ PreCommitPhase stage 1 of 1 with 45 MutationType ops SchemaID: 101 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 106 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 106 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 106 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 TableID: 106 *scop.DrainDescriptorName Namespace: @@ -514,47 +415,15 @@ PreCommitPhase stage 1 of 1 with 45 MutationType ops SchemaID: 101 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 TableID: 107 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 TableID: 107 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 TableID: 107 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 TableID: 107 *scop.DrainDescriptorName Namespace: @@ -564,47 +433,15 @@ PreCommitPhase stage 1 of 1 with 45 MutationType ops SchemaID: 101 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 TableID: 108 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 TableID: 108 *scop.DrainDescriptorName Namespace: @@ -614,58 +451,18 @@ PreCommitPhase stage 1 of 1 with 45 MutationType ops SchemaID: 101 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 1 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 5 - SubWorkID: 1 TableID: 111 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 2 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 5 - SubWorkID: 1 TableID: 111 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 3 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 5 - SubWorkID: 1 TableID: 111 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967295 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 5 - SubWorkID: 1 TableID: 111 *scop.MakeDeleteOnlyColumnAbsent ColumnID: 4294967294 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 5 - SubWorkID: 1 TableID: 111 *scop.SetJobStateOnDescriptor DescriptorID: 104 @@ -705,13 +502,12 @@ PreCommitPhase stage 1 of 1 with 45 MutationType ops - 111 JobID: 1 NonCancelable: true - RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 10 MutationType ops - pending + RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 5 MutationType ops pending Statements: - statement: DROP VIEW defaultdb.v1 CASCADE redactedstatement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE statementtag: DROP VIEW -PostCommitNonRevertiblePhase stage 1 of 1 with 19 MutationType ops +PostCommitNonRevertiblePhase stage 1 of 1 with 14 MutationType ops transitions: [[View:{DescID: 105}, ABSENT], DROPPED] -> ABSENT [[View:{DescID: 106}, ABSENT], DROPPED] -> ABSENT @@ -719,119 +515,14 @@ PostCommitNonRevertiblePhase stage 1 of 1 with 19 MutationType ops [[View:{DescID: 108}, ABSENT], DROPPED] -> ABSENT [[View:{DescID: 111}, ABSENT], DROPPED] -> ABSENT ops: - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 2 - toId: 104 - usesRelationIds: - - 104 - viewId: 105 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 1 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 105 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 1 - toId: 105 - usesRelationIds: - - 105 - viewId: 106 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 2 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 106 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 1 - toId: 105 - - columnIds: - - 1 - - 2 - toId: 106 - usesRelationIds: - - 105 - - 106 - viewId: 107 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 107 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 1 - - 2 - toId: 106 - usesRelationIds: - - 106 - viewId: 108 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 3 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 108 - *scop.LogEvent - Element: - View: - forwardReferences: - - columnIds: - - 1 - - 2 - toId: 108 - usesRelationIds: - - 108 - usesTypeIds: - - 109 - - 110 - viewId: 111 - EventBase: - Authorization: - UserName: root - Statement: DROP VIEW ‹defaultdb›.public.‹v1› CASCADE - StatementTag: DROP VIEW - TargetMetadata: - SourceElementID: 5 - SubWorkID: 1 - TargetStatus: 1 *scop.DeleteDescriptor DescriptorID: 111 *scop.RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/scrun/BUILD.bazel b/pkg/sql/schemachanger/scrun/BUILD.bazel index a93d5ea12a3a..149ef6a3f2cb 100644 --- a/pkg/sql/schemachanger/scrun/BUILD.bazel +++ b/pkg/sql/schemachanger/scrun/BUILD.bazel @@ -17,12 +17,16 @@ go_library( "//pkg/settings/cluster", "//pkg/sql/catalog", "//pkg/sql/catalog/descpb", + "//pkg/sql/pgwire/pgerror", "//pkg/sql/schemachanger/scerrors", "//pkg/sql/schemachanger/scexec", "//pkg/sql/schemachanger/scop", "//pkg/sql/schemachanger/scpb", "//pkg/sql/schemachanger/scplan", + "//pkg/sql/schemachanger/screl", "//pkg/util/buildutil", + "//pkg/util/log/eventpb", + "//pkg/util/log/logpb", "@com_github_cockroachdb_errors//:errors", "@com_github_cockroachdb_redact//:redact", ], @@ -39,7 +43,6 @@ go_test( "//pkg/sql/catalog", "//pkg/sql/catalog/descpb", "//pkg/sql/catalog/tabledesc", - "//pkg/sql/schemachanger/scexec", "//pkg/sql/schemachanger/scpb", "//pkg/util/leaktest", "@com_github_stretchr_testify//require", diff --git a/pkg/sql/schemachanger/scrun/dependencies.go b/pkg/sql/schemachanger/scrun/dependencies.go index 0b74cf59f24b..80ecddf2300b 100644 --- a/pkg/sql/schemachanger/scrun/dependencies.go +++ b/pkg/sql/schemachanger/scrun/dependencies.go @@ -15,11 +15,12 @@ import ( "github.com/cockroachdb/cockroach/pkg/settings/cluster" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec" + "github.com/cockroachdb/cockroach/pkg/util/log/logpb" ) // JobTxnFunc is used to run a transactional stage of a schema change on // behalf of a job. See JobRunDependencies.WithTxnInJob(). -type JobTxnFunc = func(ctx context.Context, txnDeps scexec.Dependencies) error +type JobTxnFunc = func(ctx context.Context, txnDeps scexec.Dependencies, eventLogger EventLogger) error // JobRunDependencies contains the dependencies required for // executing the schema change job, i.e. for the logic in its Resume() method. @@ -32,3 +33,15 @@ type JobRunDependencies interface { // ClusterSettings returns the cluster settings. ClusterSettings() *cluster.Settings } + +// EventLogger contains the dependencies required for logging schema change +// events. +type EventLogger interface { + + // LogEventForSchemaChange writes a schema change job event into the event + // log: reverse_schema_change, finish_schema_change or + // finish_schema_change_rollback. + LogEventForSchemaChange( + ctx context.Context, event logpb.EventPayload, + ) error +} diff --git a/pkg/sql/schemachanger/scrun/make_state_test.go b/pkg/sql/schemachanger/scrun/make_state_test.go index c20132d33f40..bb526f26115d 100644 --- a/pkg/sql/schemachanger/scrun/make_state_test.go +++ b/pkg/sql/schemachanger/scrun/make_state_test.go @@ -18,32 +18,11 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/catalog" "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb" "github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc" - "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" "github.com/cockroachdb/cockroach/pkg/util/leaktest" "github.com/stretchr/testify/require" ) -// fakeCatalog is a fake implementation of scexec.Catalog for testing makeState. -type fakeCatalog struct { - descs map[descpb.ID]catalog.Descriptor - scexec.Catalog -} - -func (fc fakeCatalog) MustReadImmutableDescriptors( - ctx context.Context, ids ...descpb.ID, -) ([]catalog.Descriptor, error) { - ret := make([]catalog.Descriptor, len(ids)) - for i, id := range ids { - d, ok := fc.descs[id] - if !ok { - panic("boom") - } - ret[i] = d - } - return ret, nil -} - // TestMakeState tests some validation checking in the makeState function. func TestMakeState(t *testing.T) { defer leaktest.AfterTest(t)() @@ -53,7 +32,6 @@ func TestMakeState(t *testing.T) { for _, tc := range []struct { name string ids []descpb.ID - rollback bool jobID jobspb.JobID descriptors []catalog.Descriptor expErr string @@ -142,16 +120,8 @@ func TestMakeState(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - cat := fakeCatalog{ - descs: map[descpb.ID]catalog.Descriptor{}, - } - for _, d := range tc.descriptors { - cat.descs[d.GetID()] = d - } - _, err := makeState(ctx, 1, tc.ids, true, func( - ctx context.Context, f func(context.Context, scexec.Catalog) error) error { - return f(ctx, cat) - }) + const jobID = 1 + _, err := makeState(ctx, jobID, tc.ids, tc.descriptors) if tc.expErr == "" { require.NoError(t, err) } else { diff --git a/pkg/sql/schemachanger/scrun/scrun.go b/pkg/sql/schemachanger/scrun/scrun.go index 4034b8ff76bd..944b28064a09 100644 --- a/pkg/sql/schemachanger/scrun/scrun.go +++ b/pkg/sql/schemachanger/scrun/scrun.go @@ -20,12 +20,15 @@ import ( "github.com/cockroachdb/cockroach/pkg/settings" "github.com/cockroachdb/cockroach/pkg/sql/catalog" "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb" + "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scerrors" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scop" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan" + "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" "github.com/cockroachdb/cockroach/pkg/util/buildutil" + "github.com/cockroachdb/cockroach/pkg/util/log/eventpb" "github.com/cockroachdb/errors" "github.com/cockroachdb/redact" ) @@ -103,47 +106,40 @@ func RunSchemaChangesInJob( deps JobRunDependencies, jobID jobspb.JobID, descriptorIDs []descpb.ID, - rollback bool, + rollbackCause error, ) error { - state, err := makeState(ctx, jobID, descriptorIDs, rollback, func( - ctx context.Context, f catalogFunc, - ) error { - return deps.WithTxnInJob(ctx, func( - ctx context.Context, txnDeps scexec.Dependencies, - ) error { - return f(ctx, txnDeps.Catalog()) - }) - }) - if err != nil { - if knobs != nil && knobs.OnPostCommitPlanError != nil { - return knobs.OnPostCommitPlanError(nil, err) - } - return errors.Wrapf(err, "failed to construct state for job %d", jobID) - } - sc, err := scplan.MakePlan(ctx, state, scplan.Params{ - ActiveVersion: deps.ClusterSettings().Version.ActiveVersion(ctx), - ExecutionPhase: scop.PostCommitPhase, - SchemaChangerJobIDSupplier: func() jobspb.JobID { return jobID }, - }) + p, err := makePostCommitPlan(ctx, deps, jobID, descriptorIDs, rollbackCause) if err != nil { if knobs != nil && knobs.OnPostCommitPlanError != nil { - return knobs.OnPostCommitPlanError(&state, err) + return knobs.OnPostCommitPlanError(err) } return err } - - for i := range sc.Stages { + for i := range p.Stages { // Execute each stage in its own transaction. - if err := deps.WithTxnInJob(ctx, func(ctx context.Context, td scexec.Dependencies) error { - if err := td.TransactionalJobRegistry().CheckPausepoint( - pausepointName(state, i), - ); err != nil { + if err := deps.WithTxnInJob(ctx, func(ctx context.Context, td scexec.Dependencies, el EventLogger) error { + if err := td.TransactionalJobRegistry().CheckPausepoint(pausepointName(p, i)); err != nil { + return err + } + if err := executeStage(ctx, knobs, td, p, i, p.Stages[i]); err != nil { return err } - return executeStage(ctx, knobs, td, sc, i, sc.Stages[i]) + // In the last stage, log that the schema change has finished. + if i+1 == len(p.Stages) { + var template eventpb.EventWithCommonSchemaChangePayload + if p.CurrentState.InRollback { + template = &eventpb.FinishSchemaChangeRollback{} + } else { + template = &eventpb.FinishSchemaChange{} + } + if err := logSchemaChangeEvents(ctx, el, p.CurrentState, template); err != nil { + return err + } + } + return nil }); err != nil { if knobs != nil && knobs.OnPostCommitError != nil { - return knobs.OnPostCommitError(sc, i, err) + return knobs.OnPostCommitError(p, i, err) } return err } @@ -152,10 +148,10 @@ func RunSchemaChangesInJob( } // pausepointName construct a name for the job execution phase pausepoint. -func pausepointName(state scpb.CurrentState, i int) string { +func pausepointName(p scplan.Plan, i int) string { return fmt.Sprintf( "schemachanger.%s.%s.%d", - state.Authorization.UserName, state.Authorization.AppName, i, + p.CurrentState.Authorization.UserName, p.CurrentState.Authorization.AppName, i, ) } @@ -203,26 +199,94 @@ func executeStage( return nil } -type ( - catalogFunc = func(context.Context, scexec.Catalog) error - withCatalogFunc = func(context.Context, catalogFunc) error -) +func makePostCommitPlan( + ctx context.Context, + deps JobRunDependencies, + jobID jobspb.JobID, + descriptorIDs []descpb.ID, + rollbackCause error, +) (scplan.Plan, error) { + var state scpb.CurrentState + do := func(ctx context.Context, txnDeps scexec.Dependencies, eventLogger EventLogger) error { + // Read the descriptors which each contain a part of the declarative + // schema change state. + descriptors, err := txnDeps.Catalog().MustReadImmutableDescriptors(ctx, descriptorIDs...) + if err != nil { + // TODO(ajwerner): It seems possible that a descriptor could be deleted + // and the schema change is in a happy place. Ideally we'd enforce that + // descriptors may only be deleted on the very last step of the schema + // change. + return errors.Wrapf(err, + "failed to read descriptors %v for the declarative schema change state", + descriptorIDs) + } + // Rebuild the state from its constituent parts. + state, err = makeState(ctx, jobID, descriptorIDs, descriptors) + if err != nil { + return err + } + if rollbackCause == nil && state.InRollback { + // If we do not mark the error as permanent, but we've configured the job to + // be non-cancelable, we'll never make it to the reverting state. + return jobs.MarkAsPermanentJobError(errors.Errorf( + "job in running state but schema change in rollback, " + + "returning an error to restart in the reverting state")) + } + if rollbackCause != nil && !state.InRollback { + // Revert the schema change and write about it in the event log. + state.Rollback() + return logSchemaChangeEvents(ctx, eventLogger, state, &eventpb.ReverseSchemaChange{ + Error: fmt.Sprintf("%v", rollbackCause), + SQLSTATE: pgerror.GetPGCode(rollbackCause).String(), + }) + } + return nil + } + if err := deps.WithTxnInJob(ctx, do); err != nil { + return scplan.Plan{}, err + } + // Plan the schema change. + return scplan.MakePlan(ctx, state, scplan.Params{ + ActiveVersion: deps.ClusterSettings().Version.ActiveVersion(ctx), + ExecutionPhase: scop.PostCommitPhase, + SchemaChangerJobIDSupplier: func() jobspb.JobID { return jobID }, + }) +} + +func logSchemaChangeEvents( + ctx context.Context, + eventLogger EventLogger, + state scpb.CurrentState, + template eventpb.EventWithCommonSchemaChangePayload, +) error { + var ids catalog.DescriptorIDSet + for _, t := range state.TargetState.Targets { + if t.Metadata.SourceElementID > 1 { + // Ignore targets which are the product of CASCADEs. + continue + } + ids.Add(screl.GetDescID(t.Element())) + } + for _, id := range ids.Ordered() { + template.CommonSchemaChangeDetails().DescriptorID = uint32(id) + if err := eventLogger.LogEventForSchemaChange(ctx, template); err != nil { + return err + } + } + return nil +} func makeState( ctx context.Context, jobID jobspb.JobID, descriptorIDs []descpb.ID, - rollback bool, - withCatalog withCatalogFunc, + descriptors []catalog.Descriptor, ) (state scpb.CurrentState, err error) { defer scerrors.StartEventf( ctx, "rebuilding declarative schema change state from descriptors %v", redact.Safe(descriptorIDs), ).HandlePanicAndLogError(ctx, &err) - descError := func(desc catalog.Descriptor, err error) error { - return errors.Wrapf(err, "descriptor %q (%d)", desc.GetName(), desc.GetID()) - } validateJobID := func(fromDesc jobspb.JobID) error { switch { case fromDesc == jobspb.InvalidJobID: @@ -248,7 +312,10 @@ func makeState( return nil } var descriptorStates []*scpb.DescriptorState - addDescriptorState := func(desc catalog.Descriptor) error { + addDescriptorState := func(desc catalog.Descriptor) (err error) { + defer func() { + err = errors.Wrapf(err, "descriptor %q (%d)", desc.GetName(), desc.GetID()) + }() cs := desc.GetDeclarativeSchemaChangerState() if cs == nil { return errors.New("missing schema changer state") @@ -262,40 +329,10 @@ func makeState( descriptorStates = append(descriptorStates, cs) return nil } - if err := withCatalog(ctx, func( - ctx context.Context, cat scexec.Catalog, - ) error { - descriptorStates = nil // reset for restarts - descs, err := cat.MustReadImmutableDescriptors(ctx, descriptorIDs...) - if err != nil { - // TODO(ajwerner): It seems possible that a descriptor could be deleted - // and the schema change is in a happy place. Ideally we'd enforce that - // descriptors may only be deleted on the very last step of the schema - // change. - return err - } - for _, desc := range descs { - if err := addDescriptorState(desc); err != nil { - return descError(desc, err) - } + for _, desc := range descriptors { + if err := addDescriptorState(desc); err != nil { + return scpb.CurrentState{}, err } - return nil - }); err != nil { - return scpb.CurrentState{}, err - } - state, err = scpb.MakeCurrentStateFromDescriptors(descriptorStates) - if err != nil { - return scpb.CurrentState{}, err - } - if !rollback && state.InRollback { - // If we do not mark the error as permanent, but we've configured the job to - // be non-cancelable, we'll never make it to the reverting state. - return scpb.CurrentState{}, jobs.MarkAsPermanentJobError(errors.Errorf( - "job in running state but schema change in rollback, " + - "returning an error to restart in the reverting state")) - } - if rollback && !state.InRollback { - state.Rollback() } - return state, nil + return scpb.MakeCurrentStateFromDescriptors(descriptorStates) } diff --git a/pkg/sql/schemachanger/sctest/cumulative.go b/pkg/sql/schemachanger/sctest/cumulative.go index b91a0dfeaa34..e0c753f39527 100644 --- a/pkg/sql/schemachanger/sctest/cumulative.go +++ b/pkg/sql/schemachanger/sctest/cumulative.go @@ -33,7 +33,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scbuild" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scop" - "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/screl" "github.com/cockroachdb/cockroach/pkg/testutils" @@ -630,7 +629,7 @@ func Rollback(t *testing.T, relPath string, newCluster NewClusterFunc) { db, cleanup := newCluster(t, &scexec.TestingKnobs{ BeforeStage: beforeStage, - OnPostCommitPlanError: func(state *scpb.CurrentState, err error) error { + OnPostCommitPlanError: func(err error) error { panic(fmt.Sprintf("%+v", err)) }, OnPostCommitError: func(p scplan.Plan, stageIdx int, err error) error { diff --git a/pkg/sql/schemachanger/sctest/end_to_end.go b/pkg/sql/schemachanger/sctest/end_to_end.go index 1fd1d6cc8aee..3eaed04fd8e0 100644 --- a/pkg/sql/schemachanger/sctest/end_to_end.go +++ b/pkg/sql/schemachanger/sctest/end_to_end.go @@ -343,9 +343,8 @@ func execStatementWithTestDeps( // Run post-commit phase in mock schema change job. deps.IncrementPhase() deps.LogSideEffectf("# begin %s", deps.Phase()) - const rollback = false err = scrun.RunSchemaChangesInJob( - ctx, deps.TestingKnobs(), deps, jobID, job.DescriptorIDs, rollback, + ctx, deps.TestingKnobs(), deps, jobID, job.DescriptorIDs, nil, /* rollbackCause */ ) require.NoError(t, err, "error in mock schema change job execution") deps.LogSideEffectf("# end %s", deps.Phase()) diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column b/pkg/sql/schemachanger/testdata/end_to_end/add_column index fe72a30aebfe..05dd054f8439 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column @@ -44,7 +44,16 @@ increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.add_column increment telemetry for sql.schema.qualifcation.default_expr increment telemetry for sql.schema.new_column_type.int8 -## StatementPhase stage 1 of 1 with 11 MutationType ops +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 106 + statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT + ‹42› + tag: ALTER TABLE + user: root + tableName: db.public.tbl +## StatementPhase stage 1 of 1 with 10 MutationType ops upsert descriptor #106 ... - columnIds: @@ -139,7 +148,6 @@ upsert descriptor #106 unexposedParentSchemaId: 105 - version: "1" + version: "2" -write *eventpb.AlterTable to event log: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› # end StatementPhase # begin PreCommitPhase ## PreCommitPhase stage 1 of 1 with 2 MutationType ops @@ -493,12 +501,14 @@ upsert descriptor #106 unexposedParentSchemaId: 105 - version: "8" + version: "9" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for ALTER TABLE db.public.tbl ADD COLUMN j INT8 NOT NULL DEFAULT 42" descriptor IDs: [106] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 106 commit transaction #12 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq b/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq index b51239271ae9..c817df5656f1 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_seq @@ -54,7 +54,16 @@ increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.add_column increment telemetry for sql.schema.qualifcation.default_expr increment telemetry for sql.schema.new_column_type.int8 -## StatementPhase stage 1 of 1 with 12 MutationType ops +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 106 + statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT + nextval(‹'db.public.sq1'›) + tag: ALTER TABLE + user: root + tableName: db.public.tbl +## StatementPhase stage 1 of 1 with 11 MutationType ops upsert descriptor #106 ... - columnIds: @@ -167,7 +176,6 @@ upsert descriptor #107 unexposedParentSchemaId: 105 - version: "1" + version: "2" -write *eventpb.AlterTable to event log: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) # end StatementPhase # begin PreCommitPhase ## PreCommitPhase stage 1 of 1 with 3 MutationType ops @@ -598,12 +606,14 @@ upsert descriptor #107 unexposedParentSchemaId: 105 - version: "8" + version: "9" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for ALTER TABLE db.public.tbl ADD COLUMN l INT8 NOT NULL DEFAULT nextval('db.public.sq1')" descriptor IDs: [106] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 106 commit transaction #12 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_unique b/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_unique index d0ef5e07d896..b4d38411091d 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_unique +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column_default_unique @@ -91,7 +91,16 @@ increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.add_column increment telemetry for sql.schema.qualifcation.default_expr increment telemetry for sql.schema.new_column_type.int8 -## StatementPhase stage 1 of 1 with 11 MutationType ops +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 106 + statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, + now()) AS INT8) + tag: ALTER TABLE + user: root + tableName: db.public.tbl +## StatementPhase stage 1 of 1 with 10 MutationType ops upsert descriptor #106 ... - columnIds: @@ -187,7 +196,6 @@ upsert descriptor #106 unexposedParentSchemaId: 105 - version: "1" + version: "2" -write *eventpb.AlterTable to event log: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, now()) AS INT8) # end StatementPhase # begin PreCommitPhase ## PreCommitPhase stage 1 of 1 with 2 MutationType ops @@ -538,7 +546,7 @@ begin transaction #17 validate forward indexes [4] in table #106 commit transaction #17 begin transaction #18 -## PostCommitNonRevertiblePhase stage 1 of 2 with 10 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 2 with 9 MutationType ops upsert descriptor #106 ... oid: 20 @@ -658,7 +666,6 @@ upsert descriptor #106 unexposedParentSchemaId: 105 - version: "11" + version: "12" -write *eventpb.CreateIndex to event log: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, now()) AS INT8) adding table for stats refresh: 106 update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 2 with 6 MutationType ops pending" set schema change job #1 to non-cancellable @@ -771,12 +778,14 @@ upsert descriptor #106 unexposedParentSchemaId: 105 - version: "12" + version: "13" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for ALTER TABLE db.public.tbl ADD COLUMN j INT8 UNIQUE DEFAULT CAST(date_part('year', now()) AS INT8)" descriptor IDs: [106] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 106 commit transaction #19 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/add_column_no_default b/pkg/sql/schemachanger/testdata/end_to_end/add_column_no_default index 231dac0cef29..c03ee97028fa 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/add_column_no_default +++ b/pkg/sql/schemachanger/testdata/end_to_end/add_column_no_default @@ -41,7 +41,15 @@ checking for feature: ALTER TABLE increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.add_column increment telemetry for sql.schema.new_column_type.int8 -## StatementPhase stage 1 of 1 with 5 MutationType ops +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 106 + statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 + tag: ALTER TABLE + user: root + tableName: db.public.tbl +## StatementPhase stage 1 of 1 with 4 MutationType ops upsert descriptor #106 ... - columnIds: @@ -87,7 +95,6 @@ upsert descriptor #106 unexposedParentSchemaId: 105 - version: "1" + version: "2" -write *eventpb.AlterTable to event log: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 # end StatementPhase # begin PreCommitPhase ## PreCommitPhase stage 1 of 1 with 2 MutationType ops @@ -201,10 +208,12 @@ upsert descriptor #106 unexposedParentSchemaId: 105 - version: "3" + version: "4" -write *eventpb.FinishSchemaChange to event log adding table for stats refresh: 106 update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 106 commit transaction #4 # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_vanilla b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_vanilla index 65a8b55289ec..9d8343f2f48b 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_vanilla +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_vanilla @@ -13,6 +13,14 @@ begin transaction #1 checking for feature: ALTER TABLE increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.add_constraint +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 104 + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CHECK (‹i› > ‹0›) + tag: ALTER TABLE + user: root + tableName: defaultdb.public.t ## StatementPhase stage 1 of 1 with 1 MutationType op upsert descriptor #104 ... @@ -141,5 +149,8 @@ upsert descriptor #104 update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #4 # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_with_seq_and_udt b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_with_seq_and_udt index 9d23c02e47b6..50ac2dfa7063 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_with_seq_and_udt +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_check_with_seq_and_udt @@ -17,6 +17,15 @@ begin transaction #1 checking for feature: ALTER TABLE increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.add_constraint +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 107 + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CHECK ((‹i› > nextval(‹'s'›)) + OR (‹j›::‹typ› = ‹'a'›)) + tag: ALTER TABLE + user: root + tableName: defaultdb.public.t ## StatementPhase stage 1 of 1 with 3 MutationType ops upsert descriptor #104 ... @@ -274,5 +283,8 @@ upsert descriptor #107 update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 107 commit transaction #4 # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_foreign_key b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_foreign_key index 7e9587d48380..844fc5d167b4 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_foreign_key +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_foreign_key @@ -14,6 +14,15 @@ begin transaction #1 checking for feature: ALTER TABLE increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.add_constraint +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 104 + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t1› ADD CONSTRAINT ‹t1_i_fkey› FOREIGN + KEY (‹i›) REFERENCES ‹defaultdb›.‹public›.‹t2› (‹i›) + tag: ALTER TABLE + user: root + tableName: defaultdb.public.t1 ## StatementPhase stage 1 of 1 with 1 MutationType op upsert descriptor #104 ... @@ -204,5 +213,8 @@ upsert descriptor #105 update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #4 # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_primary_key_drop_rowid b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_primary_key_drop_rowid index 8b941bdbdb9b..7f7819551c9b 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_primary_key_drop_rowid +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_primary_key_drop_rowid @@ -37,7 +37,15 @@ begin transaction #1 checking for feature: ALTER TABLE increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.add_constraint -## StatementPhase stage 1 of 1 with 11 MutationType ops +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 104 + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD PRIMARY KEY (‹a›) + tag: ALTER TABLE + user: root + tableName: defaultdb.public.t +## StatementPhase stage 1 of 1 with 10 MutationType ops upsert descriptor #104 ... oid: 20 @@ -172,7 +180,6 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "1" + version: "2" -write *eventpb.AlterTable to event log: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD PRIMARY KEY (‹a›) # end StatementPhase # begin PreCommitPhase ## PreCommitPhase stage 1 of 1 with 2 MutationType ops @@ -801,12 +808,14 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "14" + version: "15" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for ALTER TABLE defaultdb.public.t ADD PRIMARY KEY (a)" descriptor IDs: [104] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #21 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_unique_without_index b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_unique_without_index index 8e3e93ca513e..97cc19de636d 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_unique_without_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_add_unique_without_index @@ -13,6 +13,15 @@ begin transaction #1 checking for feature: ALTER TABLE increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.add_constraint +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 104 + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD CONSTRAINT ‹unique_j› UNIQUE + WITHOUT INDEX (‹j›) + tag: ALTER TABLE + user: root + tableName: defaultdb.public.t ## StatementPhase stage 1 of 1 with 1 MutationType op upsert descriptor #104 ... @@ -142,5 +151,8 @@ upsert descriptor #104 update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #4 # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_drop_rowid b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_drop_rowid index 9f3163cf67a6..860cd461daa7 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_drop_rowid +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_drop_rowid @@ -39,7 +39,16 @@ begin transaction #1 checking for feature: ALTER TABLE increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.alter_primary_key -## StatementPhase stage 1 of 1 with 11 MutationType ops +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 104 + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS + (‹a›) + tag: ALTER TABLE + user: root + tableName: defaultdb.public.t +## StatementPhase stage 1 of 1 with 10 MutationType ops upsert descriptor #104 ... oid: 20 @@ -174,7 +183,6 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "1" + version: "2" -write *eventpb.AlterTable to event log: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) # end StatementPhase # begin PreCommitPhase ## PreCommitPhase stage 1 of 1 with 2 MutationType ops @@ -805,12 +813,14 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "14" + version: "15" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for ALTER TABLE defaultdb.public.t ALTER PRIMARY KEY USING COLUMNS (a)" descriptor IDs: [104] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #21 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_vanilla b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_vanilla index 65afb1630263..a913f7963856 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_vanilla +++ b/pkg/sql/schemachanger/testdata/end_to_end/alter_table_alter_primary_key_vanilla @@ -36,6 +36,15 @@ begin transaction #1 checking for feature: ALTER TABLE increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.alter_primary_key +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 104 + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS + (‹j›) + tag: ALTER TABLE + user: root + tableName: defaultdb.public.t ## StatementPhase stage 1 of 1 with 13 MutationType ops upsert descriptor #104 ... @@ -305,7 +314,7 @@ validate forward indexes [2] in table #104 validate forward indexes [4] in table #104 commit transaction #9 begin transaction #10 -## PostCommitNonRevertiblePhase stage 1 of 3 with 11 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 3 with 10 MutationType ops upsert descriptor #104 ... statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) @@ -472,7 +481,6 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "6" + version: "7" -write *eventpb.CreateIndex to event log: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) adding table for stats refresh: 104 update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 3 with 3 MutationType ops pending" set schema change job #1 to non-cancellable @@ -610,12 +618,14 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "8" + version: "9" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for ALTER TABLE defaultdb.public.t ALTER PRIMARY KEY USING COLUMNS (j)" descriptor IDs: [104] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #12 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/create_index b/pkg/sql/schemachanger/testdata/end_to_end/create_index index 5c5d162cf52e..f76c6e6cd438 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/create_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/create_index @@ -48,6 +48,15 @@ begin transaction #1 # begin StatementPhase checking for feature: CREATE INDEX increment telemetry for sql.schema.partial_index +write *eventpb.CreateIndex to event log: + indexName: idx1 + mutationId: 1 + sql: + descriptorId: 106 + statement: CREATE INDEX ‹idx1› ON ‹defaultdb›.‹public›.‹t› (‹v›) WHERE (‹v› = ‹'a'›) + tag: CREATE INDEX + user: root + tableName: defaultdb.public.t ## StatementPhase stage 1 of 1 with 9 MutationType ops upsert descriptor #106 ... @@ -233,7 +242,7 @@ begin transaction #9 validate forward indexes [2] in table #106 commit transaction #9 begin transaction #10 -## PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops upsert descriptor #106 ... statement: CREATE INDEX idx1 ON t (v) WHERE (v = 'a') @@ -314,7 +323,6 @@ upsert descriptor #106 unexposedParentSchemaId: 101 - version: "6" + version: "7" -write *eventpb.CreateIndex to event log: CREATE INDEX ‹idx1› ON ‹defaultdb›.‹public›.‹t› (‹v›) WHERE (‹v› = ‹'a'›) adding table for stats refresh: 106 update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 2 with 2 MutationType ops pending" set schema change job #1 to non-cancellable @@ -376,12 +384,14 @@ upsert descriptor #106 unexposedParentSchemaId: 101 - version: "7" + version: "8" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for CREATE INDEX idx1 ON defaultdb.public.t (v) WHERE (v = 'a')" descriptor IDs: [106] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 106 commit transaction #11 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_basic b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_basic index 5536a2b10179..ffa8ea3b2bd6 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_basic +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_basic @@ -39,7 +39,15 @@ begin transaction #1 checking for feature: ALTER TABLE increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.drop_column -## StatementPhase stage 1 of 1 with 9 MutationType ops +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 104 + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› + tag: ALTER TABLE + user: root + tableName: defaultdb.public.t +## StatementPhase stage 1 of 1 with 7 MutationType ops upsert descriptor #104 ... oid: 20 @@ -141,10 +149,9 @@ upsert descriptor #104 ... time: {} unexposedParentSchemaId: 101 - - version: "2" - + version: "3" + - version: "1" + + version: "2" delete comment ColumnCommentType(objID: 104, subID: 2) -write *eventpb.AlterTable to event log: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› # end StatementPhase # begin PreCommitPhase ## PreCommitPhase stage 1 of 1 with 2 MutationType ops @@ -170,8 +177,8 @@ upsert descriptor #104 ... time: {} unexposedParentSchemaId: 101 - - version: "2" - + version: "3" + - version: "1" + + version: "2" create job #1 (non-cancelable: false): "ALTER TABLE defaultdb.public.t DROP COLUMN j" descriptor IDs: [104] # end PreCommitPhase @@ -193,8 +200,8 @@ upsert descriptor #104 ... time: {} unexposedParentSchemaId: 101 - - version: "3" - + version: "4" + - version: "2" + + version: "3" update progress of schema change job #1: "PostCommitPhase stage 2 of 7 with 1 BackfillType op pending" commit transaction #3 begin transaction #4 @@ -214,8 +221,8 @@ upsert descriptor #104 ... time: {} unexposedParentSchemaId: 101 - - version: "4" - + version: "5" + - version: "3" + + version: "4" update progress of schema change job #1: "PostCommitPhase stage 4 of 7 with 1 MutationType op pending" commit transaction #5 begin transaction #6 @@ -231,8 +238,8 @@ upsert descriptor #104 ... time: {} unexposedParentSchemaId: 101 - - version: "5" - + version: "6" + - version: "4" + + version: "5" update progress of schema change job #1: "PostCommitPhase stage 5 of 7 with 1 BackfillType op pending" commit transaction #6 begin transaction #7 @@ -252,8 +259,8 @@ upsert descriptor #104 ... time: {} unexposedParentSchemaId: 101 - - version: "6" - + version: "7" + - version: "5" + + version: "6" update progress of schema change job #1: "PostCommitPhase stage 7 of 7 with 1 ValidationType op pending" commit transaction #8 begin transaction #9 @@ -358,8 +365,8 @@ upsert descriptor #104 ... time: {} unexposedParentSchemaId: 101 - - version: "7" - + version: "8" + - version: "6" + + version: "7" update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 3 with 2 MutationType ops pending" set schema change job #1 to non-cancellable commit transaction #10 @@ -405,8 +412,8 @@ upsert descriptor #104 ... time: {} unexposedParentSchemaId: 101 - - version: "8" - + version: "9" + - version: "7" + + version: "8" update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 3 of 3 with 4 MutationType ops pending" commit transaction #11 begin transaction #12 @@ -483,14 +490,16 @@ upsert descriptor #104 ... time: {} unexposedParentSchemaId: 101 - - version: "9" - + version: "10" -write *eventpb.FinishSchemaChange to event log + - version: "8" + + version: "9" create job #2 (non-cancelable: true): "GC for ALTER TABLE defaultdb.public.t DROP COLUMN j" descriptor IDs: [104] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #12 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_computed_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_computed_index index ab09c2e4f8bb..2fd4a0422015 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_computed_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_computed_index @@ -37,7 +37,15 @@ begin transaction #1 checking for feature: ALTER TABLE increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.drop_column -## StatementPhase stage 1 of 1 with 11 MutationType ops +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 104 + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE + tag: ALTER TABLE + user: root + tableName: defaultdb.public.t +## StatementPhase stage 1 of 1 with 9 MutationType ops upsert descriptor #104 ... oid: 20 @@ -205,7 +213,6 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "1" + version: "2" -write *eventpb.AlterTable to event log: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE # end StatementPhase # begin PreCommitPhase ## PreCommitPhase stage 1 of 1 with 2 MutationType ops @@ -322,7 +329,7 @@ begin transaction #9 validate forward indexes [3] in table #104 commit transaction #9 begin transaction #10 -## PostCommitNonRevertiblePhase stage 1 of 3 with 12 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 3 with 11 MutationType ops upsert descriptor #104 ... statement: ALTER TABLE t DROP COLUMN j CASCADE @@ -443,7 +450,6 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "6" + version: "7" -write *eventpb.DropIndex to event log: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 3 with 4 MutationType ops pending" set schema change job #1 to non-cancellable commit transaction #10 @@ -604,12 +610,14 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "8" + version: "9" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for ALTER TABLE defaultdb.public.t DROP COLUMN j CASCADE" descriptor IDs: [104] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #12 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_create_index_separate_statements b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_create_index_separate_statements index 6e228b418d6e..e80bee7b579a 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_create_index_separate_statements +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_create_index_separate_statements @@ -38,7 +38,15 @@ begin transaction #1 checking for feature: ALTER TABLE increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.drop_column -## StatementPhase stage 1 of 1 with 13 MutationType ops +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 104 + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE + tag: ALTER TABLE + user: root + tableName: defaultdb.public.t +## StatementPhase stage 1 of 1 with 11 MutationType ops upsert descriptor #104 ... oid: 20 @@ -223,8 +231,16 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "1" + version: "2" -write *eventpb.AlterTable to event log: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE checking for feature: CREATE INDEX +write *eventpb.CreateIndex to event log: + indexName: idx + mutationId: 1 + sql: + descriptorId: 104 + statement: CREATE UNIQUE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹k›) + tag: CREATE INDEX + user: root + tableName: defaultdb.public.t # end StatementPhase # begin PreCommitPhase ## PreCommitPhase stage 1 of 1 with 2 MutationType ops @@ -602,7 +618,7 @@ begin transaction #17 validate forward indexes [5] in table #104 commit transaction #17 begin transaction #18 -## PostCommitNonRevertiblePhase stage 1 of 2 with 13 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 2 with 11 MutationType ops upsert descriptor #104 ... statementTag: CREATE INDEX @@ -721,8 +737,6 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "11" + version: "12" -write *eventpb.DropIndex to event log: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE -write *eventpb.CreateIndex to event log: CREATE UNIQUE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹k›) adding table for stats refresh: 104 update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 2 with 10 MutationType ops pending" set schema change job #1 to non-cancellable @@ -901,12 +915,14 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "12" + version: "13" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for ALTER TABLE defaultdb.public.t DROP COLUMN j CASCADE; CREATE UNIQUE INDEX idx ON defaultdb.public.t (k)" descriptor IDs: [104] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #19 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_unique_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_unique_index index 36eb9c6afa9d..278ed98c2f0f 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_unique_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_unique_index @@ -17,7 +17,15 @@ begin transaction #1 checking for feature: ALTER TABLE increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.drop_column -## StatementPhase stage 1 of 1 with 11 MutationType ops +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 106 + statement: ALTER TABLE ‹t›.‹public›.‹test› DROP COLUMN ‹pi› + tag: ALTER TABLE + user: root + tableName: t.public.test +## StatementPhase stage 1 of 1 with 10 MutationType ops upsert descriptor #106 ... oid: 20 @@ -131,7 +139,6 @@ upsert descriptor #106 unexposedParentSchemaId: 105 - version: "16" + version: "17" -write *eventpb.AlterTable to event log: ALTER TABLE ‹t›.‹public›.‹test› DROP COLUMN ‹pi› # end StatementPhase # begin PreCommitPhase ## PreCommitPhase stage 1 of 1 with 2 MutationType ops @@ -486,12 +493,14 @@ upsert descriptor #106 unexposedParentSchemaId: 105 - version: "23" + version: "24" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for ALTER TABLE t.public.test DROP COLUMN pi" descriptor IDs: [106] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 106 commit transaction #12 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_with_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_with_index index d8ccd4b75ec0..09ec5c44610e 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_column_with_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_column_with_index @@ -38,7 +38,15 @@ begin transaction #1 checking for feature: ALTER TABLE increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.drop_column -## StatementPhase stage 1 of 1 with 8 MutationType ops +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 104 + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› + tag: ALTER TABLE + user: root + tableName: defaultdb.public.t +## StatementPhase stage 1 of 1 with 7 MutationType ops upsert descriptor #104 ... oid: 20 @@ -298,7 +306,7 @@ begin transaction #9 validate forward indexes [3] in table #104 commit transaction #9 begin transaction #10 -## PostCommitNonRevertiblePhase stage 1 of 3 with 11 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 3 with 10 MutationType ops upsert descriptor #104 ... statement: ALTER TABLE t DROP COLUMN j @@ -428,7 +436,6 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "6" + version: "7" -write *eventpb.DropIndex to event log: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 3 with 3 MutationType ops pending" set schema change job #1 to non-cancellable commit transaction #10 @@ -575,12 +582,14 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "8" + version: "9" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for ALTER TABLE defaultdb.public.t DROP COLUMN j" descriptor IDs: [104] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #12 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index index 4c6adcd4f650..b02b564062eb 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_hash_sharded_index @@ -24,7 +24,16 @@ begin transaction #1 # begin StatementPhase checking for feature: DROP INDEX increment telemetry for sql.schema.drop_index -## StatementPhase stage 1 of 1 with 6 MutationType ops +write *eventpb.DropIndex to event log: + indexName: idx + mutationId: 1 + sql: + descriptorId: 104 + statement: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE + tag: DROP INDEX + user: root + tableName: defaultdb.public.t +## StatementPhase stage 1 of 1 with 5 MutationType ops upsert descriptor #104 ... - 3 @@ -190,7 +199,7 @@ notified job registry to adopt jobs: [1] begin transaction #2 commit transaction #2 begin transaction #3 -## PostCommitNonRevertiblePhase stage 1 of 2 with 7 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops upsert descriptor #104 table: - checks: @@ -249,7 +258,6 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "9" + version: "10" -write *eventpb.DropIndex to event log: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 2 with 3 MutationType ops pending" commit transaction #3 begin transaction #4 @@ -327,12 +335,14 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "10" + version: "11" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for DROP INDEX defaultdb.public.t@idx CASCADE" descriptor IDs: [104] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #4 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_partial_expression_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_partial_expression_index index db202cce3405..f08aaaddea88 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_partial_expression_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_partial_expression_index @@ -16,7 +16,16 @@ begin transaction #1 # begin StatementPhase checking for feature: DROP INDEX increment telemetry for sql.schema.drop_index -## StatementPhase stage 1 of 1 with 4 MutationType ops +write *eventpb.DropIndex to event log: + indexName: idx + mutationId: 1 + sql: + descriptorId: 104 + statement: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE + tag: DROP INDEX + user: root + tableName: defaultdb.public.t +## StatementPhase stage 1 of 1 with 3 MutationType ops upsert descriptor #104 ... family: StringFamily @@ -138,7 +147,7 @@ notified job registry to adopt jobs: [1] begin transaction #2 commit transaction #2 begin transaction #3 -## PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 2 with 5 MutationType ops upsert descriptor #104 ... keySuffixColumnIds: @@ -166,7 +175,6 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "9" + version: "10" -write *eventpb.DropIndex to event log: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 2 with 4 MutationType ops pending" commit transaction #3 begin transaction #4 @@ -238,12 +246,14 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "10" + version: "11" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for DROP INDEX defaultdb.public.t@idx CASCADE" descriptor IDs: [104] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #4 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_vanilla_index b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_vanilla_index index 2aa7990d81db..ec9747b2f1a0 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_vanilla_index +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_vanilla_index @@ -29,6 +29,15 @@ begin transaction #1 # begin StatementPhase checking for feature: DROP INDEX increment telemetry for sql.schema.drop_index +write *eventpb.DropIndex to event log: + indexName: idx + mutationId: 1 + sql: + descriptorId: 104 + statement: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE + tag: DROP INDEX + user: root + tableName: defaultdb.public.t ## StatementPhase stage 1 of 1 with 1 MutationType op upsert descriptor #104 ... @@ -120,7 +129,7 @@ notified job registry to adopt jobs: [1] begin transaction #2 commit transaction #2 begin transaction #3 -## PostCommitNonRevertiblePhase stage 1 of 2 with 5 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops upsert descriptor #104 ... keySuffixColumnIds: @@ -140,7 +149,6 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "9" + version: "10" -write *eventpb.DropIndex to event log: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 2 with 2 MutationType ops pending" commit transaction #3 begin transaction #4 @@ -197,12 +205,14 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "10" + version: "11" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for DROP INDEX defaultdb.public.t@idx CASCADE" descriptor IDs: [104] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #4 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_with_materialized_view_dep b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_with_materialized_view_dep index ec0351b82087..6983ce7fc8b3 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_index_with_materialized_view_dep +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_index_with_materialized_view_dep @@ -33,6 +33,17 @@ begin transaction #1 # begin StatementPhase checking for feature: DROP INDEX increment telemetry for sql.schema.drop_index +write *eventpb.DropIndex to event log: + cascadeDroppedViews: + - defaultdb.public.v3 + indexName: idx + mutationId: 1 + sql: + descriptorId: 105 + statement: DROP INDEX ‹defaultdb›.‹public›.‹v2›@‹idx› CASCADE + tag: DROP INDEX + user: root + tableName: defaultdb.public.v2 ## StatementPhase stage 1 of 1 with 1 MutationType op add synthetic descriptor #106: ... @@ -168,7 +179,7 @@ notified job registry to adopt jobs: [1] begin transaction #2 commit transaction #2 begin transaction #3 -## PostCommitNonRevertiblePhase stage 1 of 2 with 8 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops upsert descriptor #105 ... keySuffixColumnIds: @@ -189,7 +200,6 @@ upsert descriptor #105 - version: "11" + version: "12" viewQuery: SELECT i, j FROM defaultdb.public.t1 -write *eventpb.DropIndex to event log: DROP INDEX ‹defaultdb›.‹public›.‹v2›@‹idx› CASCADE create job #2 (non-cancelable: true): "GC for DROP INDEX defaultdb.public.v2@idx CASCADE" descriptor IDs: [106] update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 2 with 2 MutationType ops pending" @@ -252,12 +262,14 @@ upsert descriptor #105 - version: "12" + version: "13" viewQuery: SELECT i, j FROM defaultdb.public.t1 -write *eventpb.FinishSchemaChange to event log create job #3 (non-cancelable: true): "GC for DROP INDEX defaultdb.public.v2@idx CASCADE" descriptor IDs: [105] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [106] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 105 commit transaction #4 notified job registry to adopt jobs: [3] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_multiple_columns_separate_statements b/pkg/sql/schemachanger/testdata/end_to_end/drop_multiple_columns_separate_statements index 3b3e4f14c190..fdf989d58673 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_multiple_columns_separate_statements +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_multiple_columns_separate_statements @@ -52,7 +52,15 @@ begin transaction #1 checking for feature: ALTER TABLE increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.drop_column -## StatementPhase stage 1 of 1 with 13 MutationType ops +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 104 + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE + tag: ALTER TABLE + user: root + tableName: defaultdb.public.t +## StatementPhase stage 1 of 1 with 11 MutationType ops upsert descriptor #104 ... oid: 20 @@ -237,11 +245,18 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "1" + version: "2" -write *eventpb.AlterTable to event log: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE checking for feature: ALTER TABLE increment telemetry for sql.schema.alter_table increment telemetry for sql.schema.alter_table.drop_column -## StatementPhase stage 1 of 1 with 3 MutationType ops +write *eventpb.AlterTable to event log: + mutationId: 1 + sql: + descriptorId: 104 + statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹k› CASCADE + tag: ALTER TABLE + user: root + tableName: defaultdb.public.t +## StatementPhase stage 1 of 1 with 2 MutationType ops upsert descriptor #104 ... oid: 20 @@ -436,7 +451,7 @@ begin transaction #9 validate forward indexes [3] in table #104 commit transaction #9 begin transaction #10 -## PostCommitNonRevertiblePhase stage 1 of 3 with 14 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 3 with 13 MutationType ops upsert descriptor #104 ... statementTag: ALTER TABLE @@ -572,7 +587,6 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "6" + version: "7" -write *eventpb.DropIndex to event log: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE update progress of schema change job #1: "PostCommitNonRevertiblePhase stage 2 of 3 with 4 MutationType ops pending" set schema change job #1 to non-cancellable commit transaction #10 @@ -762,12 +776,14 @@ upsert descriptor #104 unexposedParentSchemaId: 101 - version: "8" + version: "9" -write *eventpb.FinishSchemaChange to event log create job #2 (non-cancelable: true): "GC for ALTER TABLE defaultdb.public.t DROP COLUMN j CASCADE" descriptor IDs: [104] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 104 commit transaction #12 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_schema b/pkg/sql/schemachanger/testdata/end_to_end/drop_schema index ca46b5be0448..c176f93a7aa8 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_schema +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_schema @@ -15,6 +15,13 @@ begin transaction #1 checking for feature: DROP SCHEMA increment telemetry for sql.schema.drop_schema increment telemetry for sql.uds.drop_schema +write *eventpb.DropSchema to event log: + schemaName: db.sc + sql: + descriptorId: 106 + statement: DROP SCHEMA ‹db›.‹sc› + tag: DROP SCHEMA + user: root ## StatementPhase stage 1 of 1 with 1 MutationType op add synthetic descriptor #106: schema: @@ -79,7 +86,7 @@ notified job registry to adopt jobs: [1] begin transaction #2 commit transaction #2 begin transaction #3 -## PostCommitNonRevertiblePhase stage 1 of 1 with 5 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 1 with 4 MutationType ops upsert descriptor #104 database: - declarativeSchemaChangerState: @@ -94,9 +101,11 @@ upsert descriptor #104 - version: "3" + version: "4" delete descriptor #106 -write *eventpb.DropSchema to event log: DROP SCHEMA ‹db›.‹sc› update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 106 commit transaction #3 # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/end_to_end/drop_table b/pkg/sql/schemachanger/testdata/end_to_end/drop_table index 8a08c5aa0a3c..0e814868c48b 100644 --- a/pkg/sql/schemachanger/testdata/end_to_end/drop_table +++ b/pkg/sql/schemachanger/testdata/end_to_end/drop_table @@ -20,6 +20,13 @@ begin transaction #1 # begin StatementPhase checking for feature: DROP TABLE increment telemetry for sql.schema.drop_table +write *eventpb.DropTable to event log: + sql: + descriptorId: 107 + statement: DROP TABLE ‹db›.‹sc›.‹t› + tag: DROP TABLE + user: root + tableName: db.sc.t ## StatementPhase stage 1 of 1 with 1 MutationType op add synthetic descriptor #107: ... @@ -38,7 +45,7 @@ add synthetic descriptor #107: version: "1" # end StatementPhase # begin PreCommitPhase -## PreCommitPhase stage 1 of 1 with 12 MutationType ops +## PreCommitPhase stage 1 of 1 with 11 MutationType ops delete object namespace entry {104 106 t} -> 107 upsert descriptor #107 ... @@ -67,7 +74,6 @@ upsert descriptor #107 - version: "1" + version: "2" delete comment TableCommentType(objID: 107, subID: 0) -write *eventpb.CommentOnTable to event log: DROP TABLE ‹db›.‹sc›.‹t› create job #1 (non-cancelable: true): "DROP TABLE db.sc.t" descriptor IDs: [107] # end PreCommitPhase @@ -77,7 +83,7 @@ notified job registry to adopt jobs: [1] begin transaction #2 commit transaction #2 begin transaction #3 -## PostCommitNonRevertiblePhase stage 1 of 1 with 5 MutationType ops +## PostCommitNonRevertiblePhase stage 1 of 1 with 4 MutationType ops upsert descriptor #107 ... createAsOfTime: @@ -101,12 +107,14 @@ upsert descriptor #107 unexposedParentSchemaId: 106 - version: "2" + version: "3" -write *eventpb.DropTable to event log: DROP TABLE ‹db›.‹sc›.‹t› create job #2 (non-cancelable: true): "GC for DROP TABLE db.sc.t" descriptor IDs: [107] update progress of schema change job #1: "all stages completed" set schema change job #1 to non-cancellable updated schema change job #1 descriptor IDs to [] +write *eventpb.FinishSchemaChange to event log: + sc: + descriptorId: 107 commit transaction #3 notified job registry to adopt jobs: [2] # end PostCommitPhase diff --git a/pkg/sql/schemachanger/testdata/explain/add_column b/pkg/sql/schemachanger/testdata/explain/add_column index 4b446c528154..f0e359341763 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column +++ b/pkg/sql/schemachanger/testdata/explain/add_column @@ -22,9 +22,8 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ ├── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} - │ └── 11 Mutation operations + │ └── 10 Mutation operations │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"PgAttributeNum":2,"TableID":106}} - │ ├── LogEvent {"TargetStatus":2} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":2,"TableID":106}} │ ├── AddColumnDefaultExpression {"Default":{"ColumnID":2,"TableID":106}} diff --git a/pkg/sql/schemachanger/testdata/explain/add_column_default_seq b/pkg/sql/schemachanger/testdata/explain/add_column_default_seq index 64f58345c27d..e164d9bfb89c 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column_default_seq +++ b/pkg/sql/schemachanger/testdata/explain/add_column_default_seq @@ -22,9 +22,8 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ ├── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} - │ └── 12 Mutation operations + │ └── 11 Mutation operations │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"PgAttributeNum":2,"TableID":106}} - │ ├── LogEvent {"TargetStatus":2} │ ├── SetColumnName {"ColumnID":2,"Name":"l","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":2,"TableID":106}} │ ├── AddColumnDefaultExpression {"Default":{"ColumnID":2,"TableID":106}} diff --git a/pkg/sql/schemachanger/testdata/explain/add_column_default_unique b/pkg/sql/schemachanger/testdata/explain/add_column_default_unique index a8958b4c8004..f0739c92985c 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column_default_unique +++ b/pkg/sql/schemachanger/testdata/explain/add_column_default_unique @@ -21,9 +21,8 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ ├── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} - │ └── 11 Mutation operations + │ └── 10 Mutation operations │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"PgAttributeNum":2,"TableID":106}} - │ ├── LogEvent {"TargetStatus":2} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":2,"IsNullable":true,"TableID":106}} │ ├── AddColumnDefaultExpression {"Default":{"ColumnID":2,"TableID":106}} @@ -173,13 +172,12 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ ├── 2 elements transitioning toward ABSENT │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 1} │ │ └── VALIDATED → DELETE_ONLY PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} - │ └── 10 Mutation operations + │ └── 9 Mutation operations │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":106} │ ├── RefreshStats {"TableID":106} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":106} - │ ├── RefreshStats {"TableID":106} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":4,"TableID":106} + │ ├── RefreshStats {"TableID":106} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":5,"TableID":106} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":1,"TableID":106} │ ├── SetJobStateOnDescriptor {"DescriptorID":106} diff --git a/pkg/sql/schemachanger/testdata/explain/add_column_default_unique.rollback_13_of_15 b/pkg/sql/schemachanger/testdata/explain/add_column_default_unique.rollback_13_of_15 index 26f6a2e88743..4b484efa8a5e 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column_default_unique.rollback_13_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/add_column_default_unique.rollback_13_of_15 @@ -29,7 +29,7 @@ Schema change plan for rolling back ALTER TABLE ‹db›.public.‹tbl› ADD CO │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 5} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ └── 13 Mutation operations + │ └── 12 Mutation operations │ ├── SetIndexName {"IndexID":1,"Name":"tbl_pkey","TableID":106} │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":2,"TableID":106} │ ├── SetColumnName {"ColumnID":2,"Name":"crdb_internal_co...","TableID":106} @@ -38,7 +38,6 @@ Schema change plan for rolling back ALTER TABLE ‹db›.public.‹tbl› ADD CO │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":106} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":5,"TableID":106} │ ├── MakeValidatedPrimaryIndexPublic {"IndexID":1,"TableID":106} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":106} │ ├── SetIndexName {"IndexID":4,"Name":"crdb_internal_in...","TableID":106} │ ├── SetJobStateOnDescriptor {"DescriptorID":106} diff --git a/pkg/sql/schemachanger/testdata/explain/add_column_default_unique.rollback_14_of_15 b/pkg/sql/schemachanger/testdata/explain/add_column_default_unique.rollback_14_of_15 index a223f8fafe68..7e5e9f138de5 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column_default_unique.rollback_14_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/add_column_default_unique.rollback_14_of_15 @@ -29,7 +29,7 @@ Schema change plan for rolling back ALTER TABLE ‹db›.public.‹tbl› ADD CO │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 5} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ └── 13 Mutation operations + │ └── 12 Mutation operations │ ├── SetIndexName {"IndexID":1,"Name":"tbl_pkey","TableID":106} │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":2,"TableID":106} │ ├── SetColumnName {"ColumnID":2,"Name":"crdb_internal_co...","TableID":106} @@ -38,7 +38,6 @@ Schema change plan for rolling back ALTER TABLE ‹db›.public.‹tbl› ADD CO │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":106} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":5,"TableID":106} │ ├── MakeValidatedPrimaryIndexPublic {"IndexID":1,"TableID":106} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":106} │ ├── SetIndexName {"IndexID":4,"Name":"crdb_internal_in...","TableID":106} │ ├── SetJobStateOnDescriptor {"DescriptorID":106} diff --git a/pkg/sql/schemachanger/testdata/explain/add_column_default_unique.rollback_15_of_15 b/pkg/sql/schemachanger/testdata/explain/add_column_default_unique.rollback_15_of_15 index 1bbb0a2f562d..719f812a9a2f 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column_default_unique.rollback_15_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/add_column_default_unique.rollback_15_of_15 @@ -29,14 +29,13 @@ Schema change plan for rolling back ALTER TABLE ‹db›.public.‹tbl› ADD CO │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 5} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 5} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} - │ └── 13 Mutation operations + │ └── 12 Mutation operations │ ├── SetIndexName {"IndexID":1,"Name":"tbl_pkey","TableID":106} │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":2,"TableID":106} │ ├── SetColumnName {"ColumnID":2,"Name":"crdb_internal_co...","TableID":106} │ ├── MakePublicPrimaryIndexWriteOnly {"IndexID":2,"TableID":106} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":106} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":106} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":106} │ ├── SetIndexName {"IndexID":4,"Name":"crdb_internal_in...","TableID":106} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":5,"TableID":106} diff --git a/pkg/sql/schemachanger/testdata/explain/add_column_no_default b/pkg/sql/schemachanger/testdata/explain/add_column_no_default index 05964fabdeb2..065c37766a9c 100644 --- a/pkg/sql/schemachanger/testdata/explain/add_column_no_default +++ b/pkg/sql/schemachanger/testdata/explain/add_column_no_default @@ -13,9 +13,8 @@ Schema change plan for ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN │ │ ├── ABSENT → PUBLIC ColumnName:{DescID: 106, Name: j, ColumnID: 2} │ │ ├── ABSENT → PUBLIC ColumnType:{DescID: 106, ColumnFamilyID: 0, ColumnID: 2} │ │ └── ABSENT → PUBLIC IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 1} - │ └── 5 Mutation operations + │ └── 4 Mutation operations │ ├── MakeAbsentColumnDeleteOnly {"Column":{"ColumnID":2,"PgAttributeNum":2,"TableID":106}} - │ ├── LogEvent {"TargetStatus":2} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":106} │ ├── SetAddedColumnType {"ColumnType":{"ColumnID":2,"IsNullable":true,"TableID":106}} │ └── AddColumnToIndex {"ColumnID":2,"IndexID":1,"Kind":2,"TableID":106} diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid index 7eab6d4bd36a..fd7270314451 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_add_primary_key_drop_rowid @@ -22,9 +22,8 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD PRIM │ ├── 2 elements transitioning toward ABSENT │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 104, ColumnID: 2} │ │ └── PUBLIC → ABSENT ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} - │ └── 11 Mutation operations + │ └── 10 Mutation operations │ ├── MakePublicColumnWriteOnly {"ColumnID":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── SetColumnName {"ColumnID":2,"Name":"crdb_internal_co...","TableID":104} │ ├── MakeAbsentIndexBackfilling {"Index":{"ConstraintID":2,"IndexID":2,"IsUnique":true,"SourceIndexID":1,"TableID":104,"TemporaryIndexID":3}} │ ├── AddColumnToIndex {"ColumnID":1,"IndexID":2,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid index 3bbc86874a51..6d60b214b1c7 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_drop_rowid @@ -22,9 +22,8 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PR │ ├── 2 elements transitioning toward ABSENT │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 104, ColumnID: 2} │ │ └── PUBLIC → ABSENT ColumnName:{DescID: 104, Name: rowid, ColumnID: 2} - │ └── 11 Mutation operations + │ └── 10 Mutation operations │ ├── MakePublicColumnWriteOnly {"ColumnID":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── SetColumnName {"ColumnID":2,"Name":"crdb_internal_co...","TableID":104} │ ├── MakeAbsentIndexBackfilling {"Index":{"ConstraintID":2,"IndexID":2,"IsUnique":true,"SourceIndexID":1,"TableID":104,"TemporaryIndexID":3}} │ ├── AddColumnToIndex {"ColumnID":1,"IndexID":2,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla index 97099049b3ed..845bd1f2786f 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla @@ -119,14 +119,13 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PR │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 1} │ │ ├── PUBLIC → VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_pkey, IndexID: 1} - │ └── 11 Mutation operations + │ └── 10 Mutation operations │ ├── MakePublicPrimaryIndexWriteOnly {"IndexID":1,"TableID":104} │ ├── SetIndexName {"IndexID":1,"Name":"crdb_internal_in...","TableID":104} │ ├── SetIndexName {"IndexID":2,"Name":"t_pkey","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":4,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":5,"TableID":104} │ ├── MakeValidatedPrimaryIndexPublic {"IndexID":2,"TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla.rollback_5_of_7 index a937e3643ffb..26a096a1b6a4 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla.rollback_5_of_7 @@ -22,11 +22,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 4} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 5} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_i_key, IndexID: 4} - │ └── 8 Mutation operations + │ └── 7 Mutation operations │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":5,"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} │ ├── SetIndexName {"IndexID":4,"Name":"crdb_internal_in...","TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla.rollback_6_of_7 index 43686f58d43c..77578957643d 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla.rollback_6_of_7 @@ -22,11 +22,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 4} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 5} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_i_key, IndexID: 4} - │ └── 8 Mutation operations + │ └── 7 Mutation operations │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":5,"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} │ ├── SetIndexName {"IndexID":4,"Name":"crdb_internal_in...","TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla.rollback_7_of_7 index 5a24458d92d3..13886d35ff36 100644 --- a/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/alter_table_alter_primary_key_vanilla.rollback_7_of_7 @@ -22,10 +22,9 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› A │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 4} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 2, IndexID: 5} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_i_key, IndexID: 4} - │ └── 8 Mutation operations + │ └── 7 Mutation operations │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":5,"TableID":104} │ ├── SetIndexName {"IndexID":4,"Name":"crdb_internal_in...","TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/create_index b/pkg/sql/schemachanger/testdata/explain/create_index index 64f28416a5e6..6e16f08f457f 100644 --- a/pkg/sql/schemachanger/testdata/explain/create_index +++ b/pkg/sql/schemachanger/testdata/explain/create_index @@ -89,10 +89,9 @@ Schema change plan for CREATE INDEX ‹idx1› ON ‹defaultdb›.‹public›. │ │ ├── PUBLIC → TRANSIENT_ABSENT SecondaryIndexPartial:{DescID: 106, IndexID: 3} │ │ ├── PUBLIC → TRANSIENT_ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ └── PUBLIC → TRANSIENT_ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} - │ └── 7 Mutation operations - │ ├── RefreshStats {"TableID":106} - │ ├── LogEvent {"TargetStatus":2} + │ └── 6 Mutation operations │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":106} + │ ├── RefreshStats {"TableID":106} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":106} │ ├── RemoveDroppedIndexPartialPredicate {"IndexID":3,"TableID":106} │ ├── SetJobStateOnDescriptor {"DescriptorID":106} diff --git a/pkg/sql/schemachanger/testdata/explain/create_index.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain/create_index.rollback_5_of_7 index 6864fdd1c6ed..69dc33f08159 100644 --- a/pkg/sql/schemachanger/testdata/explain/create_index.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/create_index.rollback_5_of_7 @@ -18,10 +18,9 @@ Schema change plan for rolling back CREATE INDEX ‹idx1› ON ‹defaultdb›.p │ │ ├── PUBLIC → ABSENT SecondaryIndexPartial:{DescID: 106, IndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} - │ └── 7 Mutation operations + │ └── 6 Mutation operations │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":106} │ ├── RemoveDroppedIndexPartialPredicate {"IndexID":3,"TableID":106} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":106} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":106} │ ├── SetJobStateOnDescriptor {"DescriptorID":106} diff --git a/pkg/sql/schemachanger/testdata/explain/create_index.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain/create_index.rollback_6_of_7 index 99b0509025e7..4145b0d996c3 100644 --- a/pkg/sql/schemachanger/testdata/explain/create_index.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/create_index.rollback_6_of_7 @@ -18,10 +18,9 @@ Schema change plan for rolling back CREATE INDEX ‹idx1› ON ‹defaultdb›.p │ │ ├── PUBLIC → ABSENT SecondaryIndexPartial:{DescID: 106, IndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} - │ └── 7 Mutation operations + │ └── 6 Mutation operations │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":106} │ ├── RemoveDroppedIndexPartialPredicate {"IndexID":3,"TableID":106} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":106} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":106} │ ├── SetJobStateOnDescriptor {"DescriptorID":106} diff --git a/pkg/sql/schemachanger/testdata/explain/create_index.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain/create_index.rollback_7_of_7 index 832dc92096a9..f370c1ec8861 100644 --- a/pkg/sql/schemachanger/testdata/explain/create_index.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/create_index.rollback_7_of_7 @@ -18,8 +18,7 @@ Schema change plan for rolling back CREATE INDEX ‹idx1› ON ‹defaultdb›.p │ │ ├── PUBLIC → ABSENT SecondaryIndexPartial:{DescID: 106, IndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 2, IndexID: 3} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 106, ColumnID: 1, IndexID: 3} - │ └── 7 Mutation operations - │ ├── LogEvent {"TargetStatus":1} + │ └── 6 Mutation operations │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":106} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":106} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":106} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic b/pkg/sql/schemachanger/testdata/explain/drop_column_basic index 21814ff421f2..1b9c569d2ccc 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic @@ -20,12 +20,10 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 104, ColumnID: 2} │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ └── PUBLIC → ABSENT ColumnComment:{DescID: 104, ColumnID: 2, Comment: j has a comment} - │ └── 9 Mutation operations + │ └── 7 Mutation operations │ ├── MakePublicColumnWriteOnly {"ColumnID":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── SetColumnName {"ColumnID":2,"Name":"crdb_internal_co...","TableID":104} │ ├── RemoveColumnComment {"ColumnID":2,"PgAttributeNum":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeAbsentIndexBackfilling {"Index":{"ConstraintID":2,"IndexID":2,"IsUnique":true,"SourceIndexID":1,"TableID":104,"TemporaryIndexID":3}} │ ├── AddColumnToIndex {"ColumnID":1,"IndexID":2,"TableID":104} │ ├── MakeAbsentTempIndexDeleteOnly {"Index":{"ConstraintID":3,"IndexID":3,"IsUnique":true,"SourceIndexID":1,"TableID":104}} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_1_of_7 index 9b0494ba1e0e..dddc8f9e3d55 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_1_of_7 @@ -20,10 +20,9 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ ├── PUBLIC → ABSENT IndexData:{DescID: 104, IndexID: 2} │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} - └── 10 Mutation operations + └── 9 Mutation operations ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} ├── UpsertColumnComment {"ColumnID":2,"Comment":"j has a comment","PGAttributeNum":2,"TableID":104} - ├── LogEvent {"TargetStatus":2} ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} ├── RefreshStats {"TableID":104} ├── MakeIndexAbsent {"IndexID":2,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_2_of_7 index 01e3106c3dbd..cf1f269cbe00 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_2_of_7 @@ -19,10 +19,9 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} - │ └── 9 Mutation operations + │ └── 8 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── UpsertColumnComment {"ColumnID":2,"Comment":"j has a comment","PGAttributeNum":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} │ ├── RefreshStats {"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_3_of_7 index 46a5e5fa45a1..a0a30c6251b1 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_3_of_7 @@ -19,10 +19,9 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} - │ └── 9 Mutation operations + │ └── 8 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── UpsertColumnComment {"ColumnID":2,"Comment":"j has a comment","PGAttributeNum":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} │ ├── RefreshStats {"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_4_of_7 index 56ef8f74e68b..b74cb104eb43 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_4_of_7 @@ -19,10 +19,9 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} - │ └── 9 Mutation operations + │ └── 8 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── UpsertColumnComment {"ColumnID":2,"Comment":"j has a comment","PGAttributeNum":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} │ ├── RefreshStats {"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_5_of_7 index 9b0e4ef6986e..704107080a93 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_5_of_7 @@ -19,10 +19,9 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} - │ └── 9 Mutation operations + │ └── 8 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── UpsertColumnComment {"ColumnID":2,"Comment":"j has a comment","PGAttributeNum":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} │ ├── RefreshStats {"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_6_of_7 index 96544a415864..0ff5e29cbb0c 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_6_of_7 @@ -19,10 +19,9 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} - │ └── 9 Mutation operations + │ └── 8 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── UpsertColumnComment {"ColumnID":2,"Comment":"j has a comment","PGAttributeNum":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} │ ├── RefreshStats {"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_7_of_7 index 39465446bbd1..5a40258268cc 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_basic.rollback_7_of_7 @@ -19,10 +19,9 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} - │ └── 9 Mutation operations + │ └── 8 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── UpsertColumnComment {"ColumnID":2,"Comment":"j has a comment","PGAttributeNum":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index index 393d8c26b83c..8b11a7d7be57 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index @@ -20,9 +20,8 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 104, ColumnID: 3} │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 3} │ │ └── PUBLIC → VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ └── 11 Mutation operations + │ └── 9 Mutation operations │ ├── MakePublicColumnWriteOnly {"ColumnID":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── SetColumnName {"ColumnID":2,"Name":"crdb_internal_co...","TableID":104} │ ├── MakePublicSecondaryIndexWriteOnly {"IndexID":2,"TableID":104} │ ├── MakeAbsentIndexBackfilling {"Index":{"ConstraintID":2,"IndexID":3,"IsUnique":true,"SourceIndexID":1,"TableID":104,"TemporaryIndexID":4}} @@ -30,7 +29,6 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ ├── MakeAbsentTempIndexDeleteOnly {"Index":{"ConstraintID":3,"IndexID":4,"IsUnique":true,"SourceIndexID":1,"TableID":104}} │ ├── AddColumnToIndex {"ColumnID":1,"IndexID":4,"TableID":104} │ ├── MakePublicColumnWriteOnly {"ColumnID":3,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ └── SetColumnName {"ColumnID":3,"Name":"crdb_internal_co...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase @@ -101,14 +99,13 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_expr_idx, IndexID: 2} - │ └── 12 Mutation operations + │ └── 11 Mutation operations │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":2,"TableID":104} │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":3,"TableID":104} │ ├── MakePublicPrimaryIndexWriteOnly {"IndexID":1,"TableID":104} │ ├── SetIndexName {"IndexID":1,"Name":"crdb_internal_in...","TableID":104} │ ├── SetIndexName {"IndexID":3,"Name":"t_pkey","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":104} │ ├── MakeValidatedPrimaryIndexPublic {"IndexID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_1_of_7 index 9c8bc2d2c43a..4eb4a722f1d4 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_1_of_7 @@ -20,12 +20,11 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ ├── PUBLIC → ABSENT IndexData:{DescID: 104, IndexID: 3} │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - └── 14 Mutation operations + └── 13 Mutation operations ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} ├── SetColumnName {"ColumnID":3,"Name":"crdb_internal_id...","TableID":104} - ├── RefreshStats {"TableID":104} - ├── LogEvent {"TargetStatus":2} ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + ├── RefreshStats {"TableID":104} ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} ├── RefreshStats {"TableID":104} ├── MakeWriteOnlyColumnPublic {"ColumnID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_2_of_7 index 6f552328f880..84d392b5c65b 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_2_of_7 @@ -19,12 +19,11 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ └── 13 Mutation operations + │ └── 12 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":3,"Name":"crdb_internal_id...","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} │ ├── RefreshStats {"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_3_of_7 index 5a0c79418f94..074a6fefff14 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_3_of_7 @@ -19,12 +19,11 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ └── 13 Mutation operations + │ └── 12 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":3,"Name":"crdb_internal_id...","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} │ ├── RefreshStats {"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_4_of_7 index d54eab4e1e1a..87c12686a90a 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_4_of_7 @@ -19,12 +19,11 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ └── 13 Mutation operations + │ └── 12 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":3,"Name":"crdb_internal_id...","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} │ ├── RefreshStats {"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_5_of_7 index 1cad9b369302..ba271df732a0 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_5_of_7 @@ -19,12 +19,11 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ └── 13 Mutation operations + │ └── 12 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":3,"Name":"crdb_internal_id...","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} │ ├── RefreshStats {"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_6_of_7 index bf48dfb0fb86..3659dc15b214 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_6_of_7 @@ -19,12 +19,11 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ └── 13 Mutation operations + │ └── 12 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":3,"Name":"crdb_internal_id...","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} │ ├── RefreshStats {"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_7_of_7 index e0737864a195..b5463c2e90a8 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_computed_index.rollback_7_of_7 @@ -19,12 +19,11 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ └── 13 Mutation operations + │ └── 12 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":3,"Name":"crdb_internal_id...","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_10_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_10_of_15 index d9e6b043b7f8..5524814d3841 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_10_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_10_of_15 @@ -32,11 +32,10 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 5, SourceIndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 6} - │ └── 19 Mutation operations + │ └── 18 Mutation operations │ ├── SetIndexName {"IndexID":1,"Name":"t_pkey","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakePublicPrimaryIndexWriteOnly {"IndexID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_11_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_11_of_15 index d0864d434890..254bf33e4d44 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_11_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_11_of_15 @@ -32,11 +32,10 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 5, SourceIndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 6} - │ └── 19 Mutation operations + │ └── 18 Mutation operations │ ├── SetIndexName {"IndexID":1,"Name":"t_pkey","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakePublicPrimaryIndexWriteOnly {"IndexID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_12_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_12_of_15 index ee38297a93d0..6dc694dbf594 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_12_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_12_of_15 @@ -32,11 +32,10 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 5, SourceIndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 6} - │ └── 19 Mutation operations + │ └── 18 Mutation operations │ ├── SetIndexName {"IndexID":1,"Name":"t_pkey","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakePublicPrimaryIndexWriteOnly {"IndexID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_13_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_13_of_15 index 94f68eab82f9..4fcb37ae1c8a 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_13_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_13_of_15 @@ -32,11 +32,10 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 5, SourceIndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 6} - │ └── 20 Mutation operations + │ └── 18 Mutation operations │ ├── SetIndexName {"IndexID":1,"Name":"t_pkey","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakePublicPrimaryIndexWriteOnly {"IndexID":3,"TableID":104} @@ -48,7 +47,6 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ ├── MakeWriteOnlyColumnPublic {"ColumnID":4,"TableID":104} │ ├── RefreshStats {"TableID":104} │ ├── MakeValidatedPrimaryIndexPublic {"IndexID":1,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":5,"TableID":104} │ ├── SetIndexName {"IndexID":5,"Name":"crdb_internal_in...","TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_14_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_14_of_15 index bfc52ecab960..a53bbe5a0a09 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_14_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_14_of_15 @@ -32,11 +32,10 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 5, SourceIndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 6} - │ └── 20 Mutation operations + │ └── 18 Mutation operations │ ├── SetIndexName {"IndexID":1,"Name":"t_pkey","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakePublicPrimaryIndexWriteOnly {"IndexID":3,"TableID":104} @@ -48,7 +47,6 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ ├── MakeWriteOnlyColumnPublic {"ColumnID":4,"TableID":104} │ ├── RefreshStats {"TableID":104} │ ├── MakeValidatedPrimaryIndexPublic {"IndexID":1,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":5,"TableID":104} │ ├── SetIndexName {"IndexID":5,"Name":"crdb_internal_in...","TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_15_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_15_of_15 index 5f02a800cf1c..405e7286ae98 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_15_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_15_of_15 @@ -32,17 +32,15 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 5, SourceIndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 6} - │ └── 20 Mutation operations + │ └── 18 Mutation operations │ ├── SetIndexName {"IndexID":1,"Name":"t_pkey","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakePublicPrimaryIndexWriteOnly {"IndexID":3,"TableID":104} │ ├── SetIndexName {"IndexID":3,"Name":"crdb_internal_in...","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":5,"TableID":104} │ ├── SetIndexName {"IndexID":5,"Name":"crdb_internal_in...","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":6,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_1_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_1_of_15 index 6e431c434753..b6d0573112dd 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_1_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_1_of_15 @@ -23,10 +23,9 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} │ ├── BACKFILL_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - └── 14 Mutation operations - ├── RefreshStats {"TableID":104} - ├── LogEvent {"TargetStatus":2} + └── 13 Mutation operations ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + ├── RefreshStats {"TableID":104} ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} ├── MakeIndexAbsent {"IndexID":4,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_2_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_2_of_15 index 1f1639e64b42..d2df25fa9fcb 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_2_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_2_of_15 @@ -22,10 +22,9 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} │ │ ├── BACKFILL_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ └── 13 Mutation operations - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} + │ └── 12 Mutation operations │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_3_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_3_of_15 index 81da5cad9310..97efb64e27df 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_3_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_3_of_15 @@ -22,10 +22,9 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} │ │ ├── BACKFILL_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ └── 13 Mutation operations - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} + │ └── 12 Mutation operations │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_4_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_4_of_15 index d8dc8c376106..dcc30c25c367 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_4_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_4_of_15 @@ -22,10 +22,9 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} │ │ ├── DELETE_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ └── 13 Mutation operations - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} + │ └── 12 Mutation operations │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_5_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_5_of_15 index 0cd83d935761..1128f9b3ab8a 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_5_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_5_of_15 @@ -22,10 +22,9 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} │ │ ├── MERGE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ └── 13 Mutation operations - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} + │ └── 12 Mutation operations │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_6_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_6_of_15 index 0af64568bd9e..dad160b054ec 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_6_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_6_of_15 @@ -22,10 +22,9 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} │ │ ├── MERGE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ └── 13 Mutation operations - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} + │ └── 12 Mutation operations │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_7_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_7_of_15 index 1a114b11423c..1c2a4d5d2b29 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_7_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_7_of_15 @@ -22,10 +22,9 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ └── 13 Mutation operations - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} + │ └── 12 Mutation operations │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_8_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_8_of_15 index fd60035562ee..58eca4ddc8dd 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_8_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_8_of_15 @@ -22,10 +22,9 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ └── 13 Mutation operations - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} + │ └── 12 Mutation operations │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_9_of_15 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_9_of_15 index 28c4e721f18a..515157e63987 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_9_of_15 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.rollback_9_of_15 @@ -32,11 +32,10 @@ Schema change plan for rolling back CREATE UNIQUE INDEX ‹idx› ON ‹defaultd │ │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 6, ConstraintID: 5, SourceIndexID: 3} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 6} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 6} - │ └── 19 Mutation operations + │ └── 18 Mutation operations │ ├── SetIndexName {"IndexID":1,"Name":"t_pkey","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakePublicPrimaryIndexWriteOnly {"IndexID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.statement_1_of_2 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.statement_1_of_2 index 5a6acedffb6d..dd0dc9ca87bb 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.statement_1_of_2 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.statement_1_of_2 @@ -22,9 +22,8 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 104, ColumnID: 4} │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 4} │ │ └── PUBLIC → VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ └── 13 Mutation operations + │ └── 11 Mutation operations │ ├── MakePublicColumnWriteOnly {"ColumnID":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── SetColumnName {"ColumnID":2,"Name":"crdb_internal_co...","TableID":104} │ ├── MakePublicSecondaryIndexWriteOnly {"IndexID":2,"TableID":104} │ ├── MakeAbsentIndexBackfilling {"Index":{"ConstraintID":2,"IndexID":3,"IsUnique":true,"SourceIndexID":1,"TableID":104,"TemporaryIndexID":4}} @@ -34,7 +33,6 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ ├── AddColumnToIndex {"ColumnID":1,"IndexID":4,"TableID":104} │ ├── AddColumnToIndex {"ColumnID":3,"IndexID":4,"Kind":2,"TableID":104} │ ├── MakePublicColumnWriteOnly {"ColumnID":4,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ └── SetColumnName {"ColumnID":4,"Name":"crdb_internal_co...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase @@ -108,14 +106,13 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} - │ └── 12 Mutation operations + │ └── 11 Mutation operations │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":2,"TableID":104} │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":4,"TableID":104} │ ├── MakePublicPrimaryIndexWriteOnly {"IndexID":1,"TableID":104} │ ├── SetIndexName {"IndexID":1,"Name":"crdb_internal_in...","TableID":104} │ ├── SetIndexName {"IndexID":3,"Name":"t_pkey","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":104} │ ├── MakeValidatedPrimaryIndexPublic {"IndexID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.statement_2_of_2 b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.statement_2_of_2 index 2606dd1feba3..b6a12dc43a2d 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.statement_2_of_2 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_create_index_separate_statements.statement_2_of_2 @@ -153,16 +153,14 @@ Schema change plan for CREATE UNIQUE INDEX ‹idx› ON ‹defaultdb›.‹publi │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} - │ └── 13 Mutation operations + │ └── 11 Mutation operations │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":2,"TableID":104} │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":4,"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":5,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":6,"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":1,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_unique_index b/pkg/sql/schemachanger/testdata/explain/drop_column_unique_index index 4db135b0ea38..9fd0d53c2fc6 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_unique_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_unique_index @@ -24,9 +24,8 @@ Schema change plan for ALTER TABLE ‹t›.‹public›.‹test› DROP COLUMN │ ├── 2 elements transitioning toward ABSENT │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 106, ColumnID: 3} │ │ └── PUBLIC → ABSENT ColumnName:{DescID: 106, Name: pi, ColumnID: 3} - │ └── 11 Mutation operations + │ └── 10 Mutation operations │ ├── MakePublicColumnWriteOnly {"ColumnID":3,"TableID":106} - │ ├── LogEvent {"TargetStatus":1} │ ├── SetColumnName {"ColumnID":3,"Name":"crdb_internal_co...","TableID":106} │ ├── MakeAbsentIndexBackfilling {"Index":{"ConstraintID":7,"IndexID":6,"IsCreatedExplicitly":true,"IsUnique":true,"SourceIndexID":4,"TableID":106,"TemporaryIndexID":7}} │ ├── AddColumnToIndex {"ColumnID":1,"IndexID":6,"TableID":106} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index index c7bea7f84d22..4d8205d20d0f 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index @@ -18,14 +18,13 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 104, ColumnID: 2} │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 104, Name: j, ColumnID: 2} │ │ └── PUBLIC → VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ └── 8 Mutation operations + │ └── 7 Mutation operations │ ├── MakePublicSecondaryIndexWriteOnly {"IndexID":2,"TableID":104} │ ├── MakeAbsentIndexBackfilling {"Index":{"ConstraintID":2,"IndexID":3,"IsUnique":true,"SourceIndexID":1,"TableID":104,"TemporaryIndexID":4}} │ ├── AddColumnToIndex {"ColumnID":1,"IndexID":3,"TableID":104} │ ├── MakeAbsentTempIndexDeleteOnly {"Index":{"ConstraintID":3,"IndexID":4,"IsUnique":true,"SourceIndexID":1,"TableID":104}} │ ├── AddColumnToIndex {"ColumnID":1,"IndexID":4,"TableID":104} │ ├── MakePublicColumnWriteOnly {"ColumnID":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ └── SetColumnName {"ColumnID":2,"Name":"crdb_internal_co...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase @@ -95,13 +94,12 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_j_idx, IndexID: 2} - │ └── 11 Mutation operations + │ └── 10 Mutation operations │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":2,"TableID":104} │ ├── MakePublicPrimaryIndexWriteOnly {"IndexID":1,"TableID":104} │ ├── SetIndexName {"IndexID":1,"Name":"crdb_internal_in...","TableID":104} │ ├── SetIndexName {"IndexID":3,"Name":"t_pkey","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":104} │ ├── MakeValidatedPrimaryIndexPublic {"IndexID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_1_of_7 index 07e7246ad03f..62f62b12064c 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_1_of_7 @@ -18,11 +18,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ ├── PUBLIC → ABSENT IndexData:{DescID: 104, IndexID: 3} │ ├── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - └── 11 Mutation operations + └── 10 Mutation operations ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} - ├── RefreshStats {"TableID":104} - ├── LogEvent {"TargetStatus":2} ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + ├── RefreshStats {"TableID":104} ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} ├── RefreshStats {"TableID":104} ├── MakeIndexAbsent {"IndexID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_2_of_7 index 388c877fc5ac..d68459bfb4b7 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_2_of_7 @@ -17,11 +17,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ └── 10 Mutation operations + │ └── 9 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} │ ├── RefreshStats {"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_3_of_7 index abb1d8ce3ce2..4627bd4d4493 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_3_of_7 @@ -17,11 +17,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ └── 10 Mutation operations + │ └── 9 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} │ ├── RefreshStats {"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_4_of_7 index 8aa01c813633..0fa082aae2a4 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_4_of_7 @@ -17,11 +17,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ └── 10 Mutation operations + │ └── 9 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} │ ├── RefreshStats {"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_5_of_7 index ac7641326020..db6e5fb6c88b 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_5_of_7 @@ -17,11 +17,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ └── 10 Mutation operations + │ └── 9 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} │ ├── RefreshStats {"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_6_of_7 index 409c250e8fdd..b307c8a6d775 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_6_of_7 @@ -17,11 +17,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ └── 10 Mutation operations + │ └── 9 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} │ ├── RefreshStats {"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_7_of_7 index 62f2b6725cde..bfe4ee3be75b 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_column_with_index.rollback_7_of_7 @@ -17,11 +17,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 3} │ │ ├── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} - │ └── 10 Mutation operations + │ └── 9 Mutation operations │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} │ ├── MakeWriteOnlyColumnPublic {"ColumnID":2,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index b/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index index 826f916e96b3..5d2d6f13487c 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_index_hash_sharded_index @@ -14,12 +14,11 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› │ │ ├── PUBLIC → VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ ├── PUBLIC → VALIDATED CheckConstraint:{DescID: 104, IndexID: 0, ConstraintID: 2} │ │ └── PUBLIC → ABSENT ConstraintWithoutIndexName:{DescID: 104, Name: check_crdb_internal_j_shard_16, ConstraintID: 2} - │ └── 6 Mutation operations + │ └── 5 Mutation operations │ ├── MakePublicSecondaryIndexWriteOnly {"IndexID":2,"TableID":104} │ ├── MakePublicCheckConstraintValidated {"ConstraintID":2,"TableID":104} │ ├── SetConstraintName {"ConstraintID":2,"Name":"crdb_internal_co...","TableID":104} │ ├── MakePublicColumnWriteOnly {"ColumnID":3,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ └── SetColumnName {"ColumnID":3,"Name":"crdb_internal_co...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase @@ -37,10 +36,9 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› │ │ ├── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: idx, IndexID: 2} │ │ └── VALIDATED → ABSENT CheckConstraint:{DescID: 104, IndexID: 0, ConstraintID: 2} - │ └── 7 Mutation operations + │ └── 6 Mutation operations │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":3,"TableID":104} │ ├── RemoveCheckConstraint {"ConstraintID":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index b/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index index 09e74699c2f0..b52be3f7d375 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_index_partial_expression_index @@ -12,10 +12,9 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 104, ColumnID: 3} │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 3} │ │ └── PUBLIC → VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ └── 4 Mutation operations + │ └── 3 Mutation operations │ ├── MakePublicSecondaryIndexWriteOnly {"IndexID":2,"TableID":104} │ ├── MakePublicColumnWriteOnly {"ColumnID":3,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ └── SetColumnName {"ColumnID":3,"Name":"crdb_internal_co...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase @@ -31,9 +30,8 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› │ │ ├── WRITE_ONLY → DELETE_ONLY Column:{DescID: 104, ColumnID: 3} │ │ ├── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 104, Name: idx, IndexID: 2} - │ └── 6 Mutation operations + │ └── 5 Mutation operations │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":3,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index b/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index index 862daba196a5..fbfe48e8b750 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index +++ b/pkg/sql/schemachanger/testdata/explain/drop_index_vanilla_index @@ -25,8 +25,7 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› │ ├── 2 elements transitioning toward ABSENT │ │ ├── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 104, Name: idx, IndexID: 2} - │ └── 5 Mutation operations - │ ├── LogEvent {"TargetStatus":1} + │ └── 4 Mutation operations │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":104} │ ├── SetJobStateOnDescriptor {"DescriptorID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_index_with_materialized_view_dep b/pkg/sql/schemachanger/testdata/explain/drop_index_with_materialized_view_dep index e214af1a7e46..5230c706935c 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_index_with_materialized_view_dep +++ b/pkg/sql/schemachanger/testdata/explain/drop_index_with_materialized_view_dep @@ -70,10 +70,8 @@ Schema change plan for DROP INDEX ‹defaultdb›.‹public›.‹v2›@‹idx │ │ ├── DROPPED → ABSENT View:{DescID: 106} │ │ ├── PUBLIC → ABSENT IndexData:{DescID: 106, IndexID: 1} │ │ └── PUBLIC → ABSENT TableData:{DescID: 106, ReferencedDescID: 100} - │ └── 8 Mutation operations - │ ├── LogEvent {"TargetStatus":1} + │ └── 6 Mutation operations │ ├── CreateGCJobForTable {"DatabaseID":100,"TableID":106} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":105} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":105} │ ├── CreateGCJobForIndex {"IndexID":1,"TableID":106} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_1_of_7 index f49bec21d13e..e583dc5d3657 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_1_of_7 @@ -23,11 +23,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ ├── BACKFILL_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ └── DELETE_ONLY → ABSENT TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - └── 17 Mutation operations + └── 16 Mutation operations ├── SetColumnName {"ColumnID":3,"Name":"k","TableID":104} - ├── RefreshStats {"TableID":104} - ├── LogEvent {"TargetStatus":2} ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + ├── RefreshStats {"TableID":104} ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} ├── MakeIndexAbsent {"IndexID":4,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_2_of_7 index 0d24a66ea573..1bc254fd0368 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_2_of_7 @@ -22,11 +22,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ ├── BACKFILL_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ └── 16 Mutation operations + │ └── 15 Mutation operations │ ├── SetColumnName {"ColumnID":3,"Name":"k","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_3_of_7 index 42a155eb26db..b0d04eae64d8 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_3_of_7 @@ -22,11 +22,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ ├── BACKFILL_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ └── 16 Mutation operations + │ └── 15 Mutation operations │ ├── SetColumnName {"ColumnID":3,"Name":"k","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_4_of_7 index 837a04521dab..14879e77d08c 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_4_of_7 @@ -22,11 +22,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ ├── DELETE_ONLY → ABSENT PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ └── 16 Mutation operations + │ └── 15 Mutation operations │ ├── SetColumnName {"ColumnID":3,"Name":"k","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakeIndexAbsent {"IndexID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_5_of_7 index dc8621e5dde0..af665b4f870c 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_5_of_7 @@ -22,11 +22,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ ├── MERGE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ └── 16 Mutation operations + │ └── 15 Mutation operations │ ├── SetColumnName {"ColumnID":3,"Name":"k","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_6_of_7 index a7848a88a372..254934e089ac 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_6_of_7 @@ -22,11 +22,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ ├── MERGE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ └── 16 Mutation operations + │ └── 15 Mutation operations │ ├── SetColumnName {"ColumnID":3,"Name":"k","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_7_of_7 index 4660ce6999ae..f78c74e89dc7 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.rollback_7_of_7 @@ -22,11 +22,10 @@ Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› D │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 4} │ │ ├── WRITE_ONLY → DELETE_ONLY PrimaryIndex:{DescID: 104, IndexID: 3, ConstraintID: 2, TemporaryIndexID: 4, SourceIndexID: 1} │ │ └── WRITE_ONLY → DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} - │ └── 16 Mutation operations + │ └── 15 Mutation operations │ ├── SetColumnName {"ColumnID":3,"Name":"k","TableID":104} - │ ├── RefreshStats {"TableID":104} - │ ├── LogEvent {"TargetStatus":2} │ ├── MakeValidatedSecondaryIndexPublic {"IndexID":2,"TableID":104} + │ ├── RefreshStats {"TableID":104} │ ├── SetColumnName {"ColumnID":2,"Name":"j","TableID":104} │ ├── SetColumnName {"ColumnID":4,"Name":"crdb_internal_id...","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_1_of_2 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_1_of_2 index 5a6acedffb6d..dd0dc9ca87bb 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_1_of_2 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_1_of_2 @@ -22,9 +22,8 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 104, ColumnID: 4} │ │ ├── PUBLIC → ABSENT ColumnName:{DescID: 104, Name: crdb_internal_idx_expr, ColumnID: 4} │ │ └── PUBLIC → VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} - │ └── 13 Mutation operations + │ └── 11 Mutation operations │ ├── MakePublicColumnWriteOnly {"ColumnID":2,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── SetColumnName {"ColumnID":2,"Name":"crdb_internal_co...","TableID":104} │ ├── MakePublicSecondaryIndexWriteOnly {"IndexID":2,"TableID":104} │ ├── MakeAbsentIndexBackfilling {"Index":{"ConstraintID":2,"IndexID":3,"IsUnique":true,"SourceIndexID":1,"TableID":104,"TemporaryIndexID":4}} @@ -34,7 +33,6 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ ├── AddColumnToIndex {"ColumnID":1,"IndexID":4,"TableID":104} │ ├── AddColumnToIndex {"ColumnID":3,"IndexID":4,"Kind":2,"TableID":104} │ ├── MakePublicColumnWriteOnly {"ColumnID":4,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ └── SetColumnName {"ColumnID":4,"Name":"crdb_internal_co...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase @@ -108,14 +106,13 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 1, IndexID: 2} │ │ ├── VALIDATED → DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} - │ └── 12 Mutation operations + │ └── 11 Mutation operations │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":2,"TableID":104} │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":4,"TableID":104} │ ├── MakePublicPrimaryIndexWriteOnly {"IndexID":1,"TableID":104} │ ├── SetIndexName {"IndexID":1,"Name":"crdb_internal_in...","TableID":104} │ ├── SetIndexName {"IndexID":3,"Name":"t_pkey","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":104} │ ├── MakeValidatedPrimaryIndexPublic {"IndexID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_2_of_2 b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_2_of_2 index ed1f893bb5d1..439baf750f43 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_2_of_2 +++ b/pkg/sql/schemachanger/testdata/explain/drop_multiple_columns_separate_statements.statement_2_of_2 @@ -11,9 +11,8 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ ├── 2 elements transitioning toward ABSENT │ │ ├── PUBLIC → WRITE_ONLY Column:{DescID: 104, ColumnID: 3} │ │ └── PUBLIC → ABSENT ColumnName:{DescID: 104, Name: k, ColumnID: 3} - │ └── 3 Mutation operations + │ └── 2 Mutation operations │ ├── MakePublicColumnWriteOnly {"ColumnID":3,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ └── SetColumnName {"ColumnID":3,"Name":"crdb_internal_co...","TableID":104} ├── PreCommitPhase │ └── Stage 1 of 1 in PreCommitPhase @@ -89,7 +88,7 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ │ ├── PUBLIC → ABSENT IndexName:{DescID: 104, Name: t_expr_k_idx, IndexID: 2} │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 3} │ │ └── PUBLIC → ABSENT IndexColumn:{DescID: 104, ColumnID: 3, IndexID: 4} - │ └── 14 Mutation operations + │ └── 13 Mutation operations │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":3,"TableID":104} │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":2,"TableID":104} │ ├── MakeWriteOnlyColumnDeleteOnly {"ColumnID":4,"TableID":104} @@ -98,7 +97,6 @@ Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COL │ ├── RemoveColumnFromIndex {"ColumnID":3,"IndexID":3,"Kind":2,"TableID":104} │ ├── SetIndexName {"IndexID":3,"Name":"t_pkey","TableID":104} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":4,"TableID":104} - │ ├── LogEvent {"TargetStatus":1} │ ├── MakeWriteOnlyIndexDeleteOnly {"IndexID":2,"TableID":104} │ ├── SetIndexName {"IndexID":2,"Name":"crdb_internal_in...","TableID":104} │ ├── MakeValidatedPrimaryIndexPublic {"IndexID":3,"TableID":104} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_schema b/pkg/sql/schemachanger/testdata/explain/drop_schema index 443312f93ce2..e18a280172bb 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_schema +++ b/pkg/sql/schemachanger/testdata/explain/drop_schema @@ -32,8 +32,7 @@ Schema change plan for DROP SCHEMA ‹db›.‹sc›; └── Stage 1 of 1 in PostCommitNonRevertiblePhase ├── 1 element transitioning toward ABSENT │ └── DROPPED → ABSENT Schema:{DescID: 106} - └── 5 Mutation operations - ├── LogEvent {"TargetStatus":1} + └── 4 Mutation operations ├── DeleteDescriptor {"DescriptorID":106} ├── RemoveJobStateFromDescriptor {"DescriptorID":104} ├── RemoveJobStateFromDescriptor {"DescriptorID":106} diff --git a/pkg/sql/schemachanger/testdata/explain/drop_table b/pkg/sql/schemachanger/testdata/explain/drop_table index 214e093f5695..e82e00df23de 100644 --- a/pkg/sql/schemachanger/testdata/explain/drop_table +++ b/pkg/sql/schemachanger/testdata/explain/drop_table @@ -53,10 +53,9 @@ Schema change plan for DROP TABLE ‹db›.‹sc›.‹t›; │ │ ├── PUBLIC → ABSENT IndexColumn:{DescID: 107, ColumnID: 2, IndexID: 1} │ │ ├── VALIDATED → ABSENT PrimaryIndex:{DescID: 107, IndexID: 1, ConstraintID: 1} │ │ └── PUBLIC → ABSENT IndexName:{DescID: 107, Name: t_pkey, IndexID: 1} - │ └── 12 Mutation operations + │ └── 11 Mutation operations │ ├── MarkDescriptorAsDropped {"DescriptorID":107} │ ├── RemoveTableComment {"TableID":107} - │ ├── LogEvent {"TargetStatus":1} │ ├── RemoveColumnDefaultExpression {"ColumnID":3,"TableID":107} │ ├── DrainDescriptorName {"Namespace":{"DatabaseID":104,"DescriptorID":107,"Name":"t","SchemaID":106}} │ ├── MakeDeleteOnlyColumnAbsent {"ColumnID":1,"TableID":107} @@ -72,8 +71,7 @@ Schema change plan for DROP TABLE ‹db›.‹sc›.‹t›; │ ├── DROPPED → ABSENT Table:{DescID: 107} │ ├── PUBLIC → ABSENT IndexData:{DescID: 107, IndexID: 1} │ └── PUBLIC → ABSENT TableData:{DescID: 107, ReferencedDescID: 104} - └── 5 Mutation operations - ├── LogEvent {"TargetStatus":1} + └── 4 Mutation operations ├── CreateGCJobForTable {"DatabaseID":104,"TableID":107} ├── CreateGCJobForIndex {"IndexID":1,"TableID":107} ├── RemoveJobStateFromDescriptor {"DescriptorID":107} diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column b/pkg/sql/schemachanger/testdata/explain_verbose/add_column index e2b00d4e7a86..4946c7ad0cb6 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column @@ -96,7 +96,7 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ └── • Precedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "temp index existence precedes index dependents" │ │ -│ └── • 11 Mutation operations +│ └── • 10 Mutation operations │ │ │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: @@ -104,23 +104,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ PgAttributeNum: 2 │ │ TableID: 106 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 2 -│ │ pgAttributeNum: 2 -│ │ tableId: 106 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT -│ │ ‹42› -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 2 -│ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -507,29 +490,11 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU │ │ TableID: 106 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT - │ │ ‹42› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 106 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT - │ │ ‹42› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 106 │ │ │ ├── • RefreshStats @@ -621,15 +586,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT NOT NULL DEFAU └── • 5 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT - │ ‹42› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 1 │ TableID: 106 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_1_of_7 index 5616e0aebb70..8c09d9584a1d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_1_of_7 @@ -121,14 +121,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -145,14 +137,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_2_of_7 index 693c1bc6a4a6..5e108a81a9ee 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_2_of_7 @@ -94,14 +94,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ TableID: 106 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 106 │ │ @@ -210,14 +202,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_3_of_7 index 919365db35cb..0dde7628226d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_3_of_7 @@ -94,14 +94,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ TableID: 106 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 106 │ │ @@ -210,14 +202,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_4_of_7 index 43cc850c7eab..43c513f449f0 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_4_of_7 @@ -94,14 +94,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ TableID: 106 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 106 │ │ @@ -210,14 +202,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_5_of_7 index 8643a0c19977..6b6f1479fa1d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_5_of_7 @@ -189,14 +189,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -220,14 +212,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_6_of_7 index b75d8821b99d..b96ca2a6078b 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_6_of_7 @@ -189,14 +189,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -220,14 +212,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_7_of_7 index 24f1351a1bc7..c1d6ef803be4 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column.rollback_7_of_7 @@ -189,14 +189,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -220,14 +212,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 NOT NULL DEFAULT ‹42› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq index 58d4409c61ff..91fcaf76749d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq @@ -96,7 +96,7 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ └── • Precedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "temp index existence precedes index dependents" │ │ -│ └── • 12 Mutation operations +│ └── • 11 Mutation operations │ │ │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: @@ -104,23 +104,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ PgAttributeNum: 2 │ │ TableID: 106 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 2 -│ │ pgAttributeNum: 2 -│ │ tableId: 106 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT -│ │ nextval(‹'db.public.sq1'›) -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 2 -│ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: l @@ -532,29 +515,11 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU │ │ TableID: 106 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT - │ │ nextval(‹'db.public.sq1'›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 106 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT - │ │ nextval(‹'db.public.sq1'›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 106 │ │ │ ├── • RefreshStats @@ -652,15 +617,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN l INT NOT NULL DEFAU └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT - │ nextval(‹'db.public.sq1'›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 1 │ TableID: 106 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_1_of_7 index 3fc83964cd04..ccaf218fa48d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_1_of_7 @@ -127,14 +127,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ - 107 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -151,14 +143,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_2_of_7 index 49792002a653..43132ed70bda 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_2_of_7 @@ -94,14 +94,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ TableID: 106 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 106 │ │ @@ -219,14 +211,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_3_of_7 index feb62a213815..839b57bfedf4 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_3_of_7 @@ -94,14 +94,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ TableID: 106 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 106 │ │ @@ -219,14 +211,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_4_of_7 index 52871a0f79b6..2bb6718dce47 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_4_of_7 @@ -94,14 +94,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ TableID: 106 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 106 │ │ @@ -219,14 +211,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_5_of_7 index 9c42d36f7165..f6541d35dd0f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_5_of_7 @@ -198,14 +198,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ - 107 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -229,14 +221,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_6_of_7 index cd85add48f93..8697a11d1aaa 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_6_of_7 @@ -198,14 +198,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ - 107 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -229,14 +221,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_7_of_7 index 8b6b2833cc9a..91a5c8ef4009 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_seq.rollback_7_of_7 @@ -198,14 +198,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ - 107 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -229,14 +221,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹l› INT8 NOT NULL DEFAULT nextval(‹'db.public.sq1'›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique index e14d93b22d54..d34683022a86 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique @@ -95,7 +95,7 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT UNIQUE DEFAULT │ │ └── • Precedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 106, IndexID: 3, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "temp index existence precedes index dependents" │ │ -│ └── • 11 Mutation operations +│ └── • 10 Mutation operations │ │ │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: @@ -103,23 +103,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT UNIQUE DEFAULT │ │ PgAttributeNum: 2 │ │ TableID: 106 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 2 -│ │ pgAttributeNum: 2 -│ │ tableId: 106 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, -│ │ now()) AS INT8) -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 2 -│ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -517,15 +500,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT UNIQUE DEFAULT │ │ │ TableID: 106 │ │ │ │ │ ├── • MakeValidatedPrimaryIndexPublic -│ │ │ EventBase: -│ │ │ Authorization: -│ │ │ UserName: root -│ │ │ Statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, -│ │ │ now()) AS INT8) -│ │ │ StatementTag: ALTER TABLE -│ │ │ TargetMetadata: -│ │ │ SourceElementID: 1 -│ │ │ SubWorkID: 1 │ │ │ IndexID: 2 │ │ │ TableID: 106 │ │ │ @@ -839,19 +813,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT UNIQUE DEFAULT │ │ └── • PreviousTransactionPrecedence dependency from VALIDATED PrimaryIndex:{DescID: 106, IndexID: 1, ConstraintID: 1} │ │ rule: "PrimaryIndex transitions to ABSENT uphold 2-version invariant: VALIDATED->WRITE_ONLY" │ │ - │ └── • 10 Mutation operations + │ └── • 9 Mutation operations │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ │ now()) AS INT8) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 106 │ │ │ ├── • RefreshStats @@ -861,33 +826,13 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT UNIQUE DEFAULT │ │ IndexID: 3 │ │ TableID: 106 │ │ - │ ├── • RefreshStats - │ │ TableID: 106 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ constraintId: 4 - │ │ indexId: 4 - │ │ isUnique: true - │ │ sourceIndexId: 2 - │ │ tableId: 106 - │ │ temporaryIndexId: 5 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ │ now()) AS INT8) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 4 │ │ TableID: 106 │ │ + │ ├── • RefreshStats + │ │ TableID: 106 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 5 │ │ TableID: 106 @@ -970,15 +915,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT UNIQUE DEFAULT └── • 8 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 1 │ TableID: 106 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_10_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_10_of_15 index f6a22c0a694c..5555c3b8e862 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_10_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_10_of_15 @@ -197,15 +197,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ TableID: 106 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ │ now()) AS INT8) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 106 │ │ @@ -394,15 +385,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -440,15 +422,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_11_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_11_of_15 index 45a290284b73..4f94b0287dfc 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_11_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_11_of_15 @@ -197,15 +197,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ TableID: 106 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ │ now()) AS INT8) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 106 │ │ @@ -394,15 +385,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -440,15 +422,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_12_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_12_of_15 index 9b4843ff64ef..75c7392e76b2 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_12_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_12_of_15 @@ -197,15 +197,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ TableID: 106 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ │ now()) AS INT8) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 106 │ │ @@ -394,15 +385,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -440,15 +422,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_13_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_13_of_15 index 360428f15475..c370c00ef807 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_13_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_13_of_15 @@ -149,7 +149,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 13 Mutation operations + │ └── • 12 Mutation operations │ │ │ ├── • SetIndexName │ │ IndexID: 1 @@ -183,38 +183,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ TableID: 106 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ │ now()) AS INT8) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 106 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ constraintId: 4 - │ │ indexId: 4 - │ │ isUnique: true - │ │ sourceIndexId: 2 - │ │ tableId: 106 - │ │ temporaryIndexId: 5 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ │ now()) AS INT8) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 106 @@ -424,15 +395,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -470,15 +432,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_14_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_14_of_15 index b3ac1f948357..76405a1e8679 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_14_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_14_of_15 @@ -149,7 +149,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 13 Mutation operations + │ └── • 12 Mutation operations │ │ │ ├── • SetIndexName │ │ IndexID: 1 @@ -183,38 +183,9 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ TableID: 106 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ │ now()) AS INT8) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 106 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ constraintId: 4 - │ │ indexId: 4 - │ │ isUnique: true - │ │ sourceIndexId: 2 - │ │ tableId: 106 - │ │ temporaryIndexId: 5 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ │ now()) AS INT8) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 106 @@ -424,15 +395,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -470,15 +432,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_15_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_15_of_15 index 288464145e5d..dc17214bd53b 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_15_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_15_of_15 @@ -149,7 +149,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 106, IndexID: 5, ConstraintID: 5, SourceIndexID: 2} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 13 Mutation operations + │ └── • 12 Mutation operations │ │ │ ├── • SetIndexName │ │ IndexID: 1 @@ -178,26 +178,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ IndexID: 3 │ │ TableID: 106 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ constraintId: 4 - │ │ indexId: 4 - │ │ isUnique: true - │ │ sourceIndexId: 2 - │ │ tableId: 106 - │ │ temporaryIndexId: 5 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ │ now()) AS INT8) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 106 @@ -212,15 +192,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ TableID: 106 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ │ now()) AS INT8) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 106 │ │ @@ -424,15 +395,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -470,15 +432,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_1_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_1_of_15 index d82b908baca7..1020731e31ca 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_1_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_1_of_15 @@ -129,15 +129,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -155,15 +146,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_2_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_2_of_15 index b9cc34c13bc1..0b721200f3f0 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_2_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_2_of_15 @@ -93,15 +93,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ TableID: 106 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ │ now()) AS INT8) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 106 │ │ @@ -221,15 +212,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_3_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_3_of_15 index 14c536b0fbb5..ff3c45e69439 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_3_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_3_of_15 @@ -93,15 +93,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ TableID: 106 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ │ now()) AS INT8) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 106 │ │ @@ -221,15 +212,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_4_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_4_of_15 index e9d6c1aea53d..efe80d2d373f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_4_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_4_of_15 @@ -93,15 +93,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ TableID: 106 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ │ now()) AS INT8) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 106 │ │ @@ -221,15 +212,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_5_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_5_of_15 index 86bcf6ffe16e..1531559efb80 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_5_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_5_of_15 @@ -197,15 +197,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -231,15 +222,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_6_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_6_of_15 index f16e944fbbb6..7c338a73bfdb 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_6_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_6_of_15 @@ -197,15 +197,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -231,15 +222,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_7_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_7_of_15 index 82f1a6be100e..e4476f6e1331 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_7_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_7_of_15 @@ -197,15 +197,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -231,15 +222,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_8_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_8_of_15 index 65102ac67f76..96290a821cd8 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_8_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_8_of_15 @@ -197,15 +197,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -231,15 +222,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_9_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_9_of_15 index 2aee1a65324d..35947d000752 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_9_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_default_unique.rollback_9_of_15 @@ -203,15 +203,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ TableID: 106 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ │ now()) AS INT8) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 106 │ │ @@ -369,15 +360,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 106 │ @@ -407,15 +389,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 UNIQUE DEFAULT CAST(date_part(‹'year'›, - │ now()) AS INT8) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default index d9c3b4cc8ace..375942bbb009 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default @@ -39,7 +39,7 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT; │ │ └── • Precedence dependency from DELETE_ONLY Column:{DescID: 106, ColumnID: 2} │ │ rule: "column existence precedes column dependents" │ │ -│ └── • 5 Mutation operations +│ └── • 4 Mutation operations │ │ │ ├── • MakeAbsentColumnDeleteOnly │ │ Column: @@ -47,22 +47,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT; │ │ PgAttributeNum: 2 │ │ TableID: 106 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 2 -│ │ pgAttributeNum: 2 -│ │ tableId: 106 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 2 -│ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -158,14 +142,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE db.public.tbl ADD COLUMN j INT; │ ├── • MakeWriteOnlyColumnPublic │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.‹public›.‹tbl› ADD COLUMN ‹j› INT8 - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RefreshStats diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default.rollback_1_of_1 b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default.rollback_1_of_1 index c07a286b62ec..7c8d7ee7848d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default.rollback_1_of_1 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/add_column_no_default.rollback_1_of_1 @@ -54,14 +54,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 1; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹db›.public.‹tbl› ADD COLUMN ‹j› INT8 - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid index b47c75567b0e..8be61f6e574f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid @@ -88,29 +88,12 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} │ │ rule: "column no longer public before dependents" │ │ -│ └── • 11 Mutation operations +│ └── • 10 Mutation operations │ │ │ ├── • MakePublicColumnWriteOnly │ │ ColumnID: 2 │ │ TableID: 104 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 2 -│ │ isHidden: true -│ │ pgAttributeNum: 2 -│ │ tableId: 104 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD PRIMARY KEY (‹a›) -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: crdb_internal_column_2_name_placeholder @@ -431,14 +414,6 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ │ TableID: 104 │ │ │ │ │ ├── • MakeValidatedPrimaryIndexPublic -│ │ │ EventBase: -│ │ │ Authorization: -│ │ │ UserName: root -│ │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD PRIMARY KEY (‹a›) -│ │ │ StatementTag: ALTER TABLE -│ │ │ TargetMetadata: -│ │ │ SourceElementID: 1 -│ │ │ SubWorkID: 1 │ │ │ IndexID: 2 │ │ │ TableID: 104 │ │ │ @@ -824,14 +799,6 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ └── • 9 Mutation operations │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ @@ -858,14 +825,6 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -1023,14 +982,6 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ TableID: 104 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ @@ -1054,14 +1005,6 @@ EXPLAIN (ddl, verbose) alter table t add primary key (a); │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_10_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_10_of_15 index 14aaf68460e4..3a092f354645 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_10_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_10_of_15 @@ -167,40 +167,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -329,14 +305,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_11_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_11_of_15 index c2b27ae78f00..bd193752422c 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_11_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_11_of_15 @@ -167,40 +167,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -329,14 +305,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_12_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_12_of_15 index af2481eb709f..4f0fcd1dd750 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_12_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_12_of_15 @@ -167,40 +167,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -329,14 +305,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_13_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_13_of_15 index 69ed2888ac62..1d67c06dd38e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_13_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_13_of_15 @@ -161,28 +161,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ @@ -248,14 +232,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -339,14 +315,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_14_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_14_of_15 index 569bcc39a6af..a261dcee676d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_14_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_14_of_15 @@ -161,28 +161,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ @@ -248,14 +232,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -339,14 +315,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_15_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_15_of_15 index e2f8a769dace..e0d63921629a 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_15_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_15_of_15 @@ -165,28 +165,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ @@ -248,14 +232,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -339,14 +315,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_1_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_1_of_15 index 7cac73febc4a..5783796e7d1d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_1_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_1_of_15 @@ -129,28 +129,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • MakeWriteOnlyColumnPublic │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RefreshStats │ TableID: 104 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ @@ -166,14 +150,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ TableID: 104 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 4 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_2_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_2_of_15 index aec8f70e512d..e4a0246b5409 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_2_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_2_of_15 @@ -112,40 +112,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_3_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_3_of_15 index 72510f9e3705..85e388a47a63 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_3_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_3_of_15 @@ -112,40 +112,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_4_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_4_of_15 index e2178d3f26c1..56da754ca6c9 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_4_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_4_of_15 @@ -112,40 +112,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_5_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_5_of_15 index 21aa35cd105d..e6301cf583af 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_5_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_5_of_15 @@ -103,14 +103,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -121,14 +113,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -201,14 +185,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_6_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_6_of_15 index 5ed665618d66..0c3419f38c22 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_6_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_6_of_15 @@ -103,14 +103,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -121,14 +113,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -201,14 +185,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_7_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_7_of_15 index 060ac289b3d2..ce3bd6f33dc9 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_7_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_7_of_15 @@ -107,28 +107,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -201,14 +185,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_8_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_8_of_15 index ac1c87b7f69a..bb861ac3e1c1 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_8_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_8_of_15 @@ -107,28 +107,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -201,14 +185,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_9_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_9_of_15 index 64bb3540de76..6348514c6922 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_9_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_add_primary_key_drop_rowid.rollback_9_of_15 @@ -166,40 +166,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -304,14 +280,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ADD PRIMARY KEY (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid index 8c07cc216997..f4eaf7b8f791 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid @@ -88,30 +88,12 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} │ │ rule: "column no longer public before dependents" │ │ -│ └── • 11 Mutation operations +│ └── • 10 Mutation operations │ │ │ ├── • MakePublicColumnWriteOnly │ │ ColumnID: 2 │ │ TableID: 104 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 2 -│ │ isHidden: true -│ │ pgAttributeNum: 2 -│ │ tableId: 104 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS -│ │ (‹a›) -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: crdb_internal_column_2_name_placeholder @@ -433,15 +415,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ │ TableID: 104 │ │ │ │ │ ├── • MakeValidatedPrimaryIndexPublic -│ │ │ EventBase: -│ │ │ Authorization: -│ │ │ UserName: root -│ │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS -│ │ │ (‹a›) -│ │ │ StatementTag: ALTER TABLE -│ │ │ TargetMetadata: -│ │ │ SourceElementID: 1 -│ │ │ SubWorkID: 1 │ │ │ IndexID: 2 │ │ │ TableID: 104 │ │ │ @@ -827,15 +800,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ └── • 9 Mutation operations │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS - │ │ (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ @@ -862,15 +826,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS - │ │ (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -1028,15 +983,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ TableID: 104 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS - │ (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ @@ -1060,15 +1006,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (a); │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS - │ (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_10_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_10_of_15 index 518ec2bdd5d6..ae5679e5df73 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_10_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_10_of_15 @@ -167,40 +167,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -329,14 +305,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_11_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_11_of_15 index a458c36542f7..fb17902e9cf5 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_11_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_11_of_15 @@ -167,40 +167,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -329,14 +305,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_12_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_12_of_15 index 9fd7d1e377e7..da8f4c37fbe3 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_12_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_12_of_15 @@ -167,40 +167,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -329,14 +305,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_13_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_13_of_15 index add2bd22bbbe..ed372c8b442c 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_13_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_13_of_15 @@ -161,28 +161,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ @@ -248,14 +232,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -339,14 +315,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_14_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_14_of_15 index a80d384909e1..14955231d79d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_14_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_14_of_15 @@ -161,28 +161,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ @@ -248,14 +232,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -339,14 +315,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_15_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_15_of_15 index c601fcdefdbe..f1a465c54915 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_15_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_15_of_15 @@ -165,28 +165,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ @@ -248,14 +232,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -339,14 +315,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_1_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_1_of_15 index 0b18e6097351..b637c3c645ba 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_1_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_1_of_15 @@ -129,28 +129,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • MakeWriteOnlyColumnPublic │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RefreshStats │ TableID: 104 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ @@ -166,14 +150,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ TableID: 104 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 4 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_2_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_2_of_15 index 16316f874c20..1a20f7a3c6eb 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_2_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_2_of_15 @@ -112,40 +112,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_3_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_3_of_15 index dc80eb880558..c613bed2a9ea 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_3_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_3_of_15 @@ -112,40 +112,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_4_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_4_of_15 index be7b03bd9a04..807495f233a0 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_4_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_4_of_15 @@ -112,40 +112,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_5_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_5_of_15 index fdbedb34505d..ad9280d266b3 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_5_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_5_of_15 @@ -103,14 +103,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -121,14 +113,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -201,14 +185,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_6_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_6_of_15 index 41e9350f7d40..7aa07e561d3e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_6_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_6_of_15 @@ -103,14 +103,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -121,14 +113,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -201,14 +185,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_7_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_7_of_15 index 9a7f8048e4d9..b65c5a73fd21 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_7_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_7_of_15 @@ -107,28 +107,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -201,14 +185,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_8_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_8_of_15 index 5e1e747292a4..12abbb4f0794 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_8_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_8_of_15 @@ -107,28 +107,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -201,14 +185,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_9_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_9_of_15 index e3c96eec3b85..f75fa842da30 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_9_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_drop_rowid.rollback_9_of_15 @@ -166,40 +166,16 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 104 │ │ @@ -304,14 +280,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹a›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla index 4f7697614e15..f5a131d27f9b 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla @@ -573,7 +573,7 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ └── • Precedence dependency from VALIDATED PrimaryIndex:{DescID: 104, IndexID: 1, ConstraintID: 1} │ │ rule: "index no longer public before dependents" │ │ - │ └── • 11 Mutation operations + │ └── • 10 Mutation operations │ │ │ ├── • MakePublicPrimaryIndexWriteOnly │ │ IndexID: 1 @@ -593,47 +593,18 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); │ │ IndexID: 3 │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ constraintId: 4 - │ │ indexId: 4 - │ │ isUnique: true - │ │ sourceIndexId: 1 - │ │ tableId: 104 - │ │ temporaryIndexId: 5 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS - │ │ (‹j›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 4 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 5 │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS - │ │ (‹j›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 104 │ │ @@ -748,15 +719,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j); └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS - │ (‹j›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 1 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_1_of_7 index 7542817adcda..077be6908aeb 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_1_of_7 @@ -144,14 +144,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ TableID: 104 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_2_of_7 index 1b5e9628f0f8..a9af43c230f5 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_2_of_7 @@ -125,14 +125,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_3_of_7 index 8f56d7c207a5..0d35699558e9 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_3_of_7 @@ -125,14 +125,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_4_of_7 index 80fe45c71c75..8518cdae0e6f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_4_of_7 @@ -125,14 +125,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_5_of_7 index 7ef61b063bce..7c2ea4def090 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_5_of_7 @@ -91,7 +91,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ └── • Precedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} │ │ rule: "index no longer public before index name" │ │ - │ └── • 8 Mutation operations + │ └── • 7 Mutation operations │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 3 @@ -105,25 +105,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ IndexID: 2 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ constraintId: 4 - │ │ indexId: 4 - │ │ isUnique: true - │ │ sourceIndexId: 1 - │ │ tableId: 104 - │ │ temporaryIndexId: 5 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 104 @@ -244,14 +225,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; └── • 10 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_6_of_7 index 8c5961e406c9..837a157db48c 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_6_of_7 @@ -91,7 +91,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ └── • Precedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} │ │ rule: "index no longer public before index name" │ │ - │ └── • 8 Mutation operations + │ └── • 7 Mutation operations │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 3 @@ -105,25 +105,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ IndexID: 2 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ constraintId: 4 - │ │ indexId: 4 - │ │ isUnique: true - │ │ sourceIndexId: 1 - │ │ tableId: 104 - │ │ temporaryIndexId: 5 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 104 @@ -244,14 +225,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; └── • 10 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_7_of_7 index a604760d3827..2a3b011133a4 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/alter_table_alter_primary_key_vanilla.rollback_7_of_7 @@ -91,7 +91,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ └── • Precedence dependency from DELETE_ONLY SecondaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 4, TemporaryIndexID: 5, SourceIndexID: 1} │ │ rule: "index no longer public before index name" │ │ - │ └── • 8 Mutation operations + │ └── • 7 Mutation operations │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 @@ -101,25 +101,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ IndexID: 3 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ constraintId: 4 - │ │ indexId: 4 - │ │ isUnique: true - │ │ sourceIndexId: 1 - │ │ tableId: 104 - │ │ temporaryIndexId: 5 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 104 @@ -244,14 +225,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; └── • 10 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/create_index b/pkg/sql/schemachanger/testdata/explain_verbose/create_index index fd36298eadf6..d49fd581915e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/create_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/create_index @@ -368,32 +368,15 @@ EXPLAIN (ddl, verbose) CREATE INDEX idx1 ON t (v) WHERE (v = 'a'); │ │ └── • skip PUBLIC → TRANSIENT_ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 7 Mutation operations - │ │ - │ ├── • RefreshStats - │ │ TableID: 106 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ sourceIndexId: 1 - │ │ tableId: 106 - │ │ temporaryIndexId: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: CREATE INDEX ‹idx1› ON ‹defaultdb›.‹public›.‹t› (‹v›) WHERE (‹v› = ‹'a'›) - │ │ StatementTag: CREATE INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 + │ └── • 6 Mutation operations │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 106 │ │ + │ ├── • RefreshStats + │ │ TableID: 106 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 3 │ │ TableID: 106 diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_5_of_7 index 7edcf0546796..fe2ccedc625b 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_5_of_7 @@ -59,7 +59,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 7 Mutation operations + │ └── • 6 Mutation operations │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 3 @@ -69,23 +69,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ IndexID: 3 │ │ TableID: 106 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ sourceIndexId: 1 - │ │ tableId: 106 - │ │ temporaryIndexId: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: CREATE INDEX ‹idx1› ON ‹defaultdb›.public.‹t› (‹v›) WHERE (‹v› = ‹'a'›) - │ │ StatementTag: CREATE INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 │ │ TableID: 106 diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_6_of_7 index 54dc2a758456..b9dc52ee5cc9 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_6_of_7 @@ -59,7 +59,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 7 Mutation operations + │ └── • 6 Mutation operations │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 3 @@ -69,23 +69,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ IndexID: 3 │ │ TableID: 106 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ sourceIndexId: 1 - │ │ tableId: 106 - │ │ temporaryIndexId: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: CREATE INDEX ‹idx1› ON ‹defaultdb›.public.‹t› (‹v›) WHERE (‹v› = ‹'a'›) - │ │ StatementTag: CREATE INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 │ │ TableID: 106 diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_7_of_7 index 44782bc676ea..ea40868d5726 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/create_index.rollback_7_of_7 @@ -59,24 +59,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 7 Mutation operations - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ sourceIndexId: 1 - │ │ tableId: 106 - │ │ temporaryIndexId: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: CREATE INDEX ‹idx1› ON ‹defaultdb›.public.‹t› (‹v›) WHERE (‹v› = ‹'a'›) - │ │ StatementTag: CREATE INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 + │ └── • 6 Mutation operations │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic index 863eb77a8f20..06f38576fe4c 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic @@ -66,28 +66,12 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 2} │ │ rule: "column no longer public before dependents" │ │ -│ └── • 9 Mutation operations +│ └── • 7 Mutation operations │ │ │ ├── • MakePublicColumnWriteOnly │ │ ColumnID: 2 │ │ TableID: 104 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 2 -│ │ pgAttributeNum: 2 -│ │ tableId: 104 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: crdb_internal_column_2_name_placeholder @@ -98,23 +82,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ PgAttributeNum: 2 │ │ TableID: 104 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ ColumnComment: -│ │ columnId: 2 -│ │ comment: j has a comment -│ │ pgAttributeNum: 2 -│ │ tableId: 104 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ ├── • MakeAbsentIndexBackfilling │ │ Index: │ │ ConstraintID: 2 @@ -431,14 +398,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 104 │ │ @@ -556,14 +515,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 1 │ TableID: 104 │ @@ -581,14 +532,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_1_of_7 index add52a5c222a..fd0877f904ca 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_1_of_7 @@ -80,7 +80,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ └── • skip PUBLIC → ABSENT operations │ rule: "skip index-column removal ops on index removal" │ - └── • 10 Mutation operations + └── • 9 Mutation operations │ ├── • SetColumnName │ ColumnID: 2 @@ -93,47 +93,14 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ PGAttributeNum: 2 │ TableID: 104 │ - ├── • LogEvent - │ Element: - │ ColumnComment: - │ columnId: 2 - │ comment: j has a comment - │ pgAttributeNum: 2 - │ tableId: 104 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 - │ TargetStatus: 2 - │ ├── • MakeWriteOnlyColumnPublic │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RefreshStats │ TableID: 104 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_2_of_7 index 7143b248c612..d29cf72cb398 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_2_of_7 @@ -71,7 +71,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 9 Mutation operations + │ └── • 8 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 @@ -84,51 +84,18 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ PGAttributeNum: 2 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ ColumnComment: - │ │ columnId: 2 - │ │ comment: j has a comment - │ │ pgAttributeNum: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 3 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_3_of_7 index 8735bc01c826..7e8153c559c1 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_3_of_7 @@ -71,7 +71,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 9 Mutation operations + │ └── • 8 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 @@ -84,51 +84,18 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ PGAttributeNum: 2 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ ColumnComment: - │ │ columnId: 2 - │ │ comment: j has a comment - │ │ pgAttributeNum: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 3 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_4_of_7 index 25b81d93d547..cf020f9c659d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_4_of_7 @@ -71,7 +71,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 9 Mutation operations + │ └── • 8 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 @@ -84,51 +84,18 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ PGAttributeNum: 2 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ ColumnComment: - │ │ columnId: 2 - │ │ comment: j has a comment - │ │ pgAttributeNum: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 3 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 2 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_5_of_7 index df128287ff74..321cf8d6c6bb 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_5_of_7 @@ -65,7 +65,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 9 Mutation operations + │ └── • 8 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 @@ -78,37 +78,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ PGAttributeNum: 2 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ ColumnComment: - │ │ columnId: 2 - │ │ comment: j has a comment - │ │ pgAttributeNum: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 3 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -169,14 +144,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_6_of_7 index 82b65e2bfdba..9c337d2939be 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_6_of_7 @@ -65,7 +65,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 9 Mutation operations + │ └── • 8 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 @@ -78,37 +78,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ PGAttributeNum: 2 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ ColumnComment: - │ │ columnId: 2 - │ │ comment: j has a comment - │ │ pgAttributeNum: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 3 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -169,14 +144,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_7_of_7 index 5ac8ddbcd8ad..c41d4d7ac173 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_basic.rollback_7_of_7 @@ -65,7 +65,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 9 Mutation operations + │ └── • 8 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 @@ -78,23 +78,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ PGAttributeNum: 2 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ ColumnComment: - │ │ columnId: 2 - │ │ comment: j has a comment - │ │ pgAttributeNum: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 │ │ TableID: 104 @@ -105,14 +88,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -169,14 +144,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 2 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index index 23bf02307fb9..82139141b3a5 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index @@ -79,28 +79,12 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ -│ └── • 11 Mutation operations +│ └── • 9 Mutation operations │ │ │ ├── • MakePublicColumnWriteOnly │ │ ColumnID: 2 │ │ TableID: 104 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 2 -│ │ pgAttributeNum: 2 -│ │ tableId: 104 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: crdb_internal_column_2_name_placeholder @@ -141,23 +125,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ColumnID: 3 │ │ TableID: 104 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 3 -│ │ isInaccessible: true -│ │ pgAttributeNum: 3 -│ │ tableId: 104 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ └── • SetColumnName │ ColumnID: 3 │ Name: crdb_internal_column_3_name_placeholder @@ -469,7 +436,7 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ └── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ rule: "index no longer public before dependents" │ │ - │ └── • 12 Mutation operations + │ └── • 11 Mutation operations │ │ │ ├── • MakeWriteOnlyColumnDeleteOnly │ │ ColumnID: 2 @@ -497,21 +464,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ IndexID: 4 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 │ │ TableID: 104 @@ -522,14 +474,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ @@ -614,14 +558,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly @@ -712,14 +648,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 1 │ TableID: 104 │ @@ -743,14 +671,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_1_of_7 index 757626b69bf7..c0b2e1203b61 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_1_of_7 @@ -108,7 +108,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ └── • skip PUBLIC → ABSENT operations │ rule: "skip index-column removal ops on index removal" │ - └── • 14 Mutation operations + └── • 13 Mutation operations │ ├── • SetColumnName │ ColumnID: 2 @@ -120,38 +120,15 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ Name: crdb_internal_idx_expr │ TableID: 104 │ - ├── • RefreshStats - │ TableID: 104 - │ - ├── • LogEvent - │ Element: - │ SecondaryIndex: - │ indexId: 2 - │ tableId: 104 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 - │ TargetStatus: 2 - │ ├── • MakeValidatedSecondaryIndexPublic │ IndexID: 2 │ TableID: 104 │ + ├── • RefreshStats + │ TableID: 104 + │ ├── • MakeWriteOnlyColumnPublic │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RefreshStats @@ -159,28 +136,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • MakeWriteOnlyColumnPublic │ ColumnID: 3 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RefreshStats │ TableID: 104 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_2_of_7 index 0bfe921189c9..56be590f7602 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_2_of_7 @@ -99,7 +99,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 13 Mutation operations + │ └── • 12 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 @@ -111,42 +111,19 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ Name: crdb_internal_idx_expr │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -154,28 +131,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_3_of_7 index 5973a8318d23..ce3e83b38a9e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_3_of_7 @@ -99,7 +99,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 13 Mutation operations + │ └── • 12 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 @@ -111,42 +111,19 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ Name: crdb_internal_idx_expr │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -154,28 +131,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_4_of_7 index ca4b53eef80f..76f29e897641 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_4_of_7 @@ -99,7 +99,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 13 Mutation operations + │ └── • 12 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 @@ -111,42 +111,19 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ Name: crdb_internal_idx_expr │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -154,28 +131,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_5_of_7 index 0ef838c373cc..159fe582825e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_5_of_7 @@ -93,7 +93,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 13 Mutation operations + │ └── • 12 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 @@ -105,42 +105,19 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ Name: crdb_internal_idx_expr │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -148,14 +125,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -216,14 +185,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_6_of_7 index d11781dd5689..5054d66db03f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_6_of_7 @@ -93,7 +93,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 13 Mutation operations + │ └── • 12 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 @@ -105,42 +105,19 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ Name: crdb_internal_idx_expr │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -148,14 +125,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -216,14 +185,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_7_of_7 index 3ef9b90d2ea3..c41a37299029 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_computed_index.rollback_7_of_7 @@ -93,7 +93,7 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 13 Mutation operations + │ └── • 12 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 @@ -105,28 +105,13 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ Name: crdb_internal_idx_expr │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 3 │ │ TableID: 104 @@ -137,14 +122,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -152,14 +129,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -216,14 +185,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_10_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_10_of_15 index a35fb214b1a6..6e9b0cd7cc84 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_10_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_10_of_15 @@ -197,35 +197,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 19 Mutation operations + │ └── • 18 Mutation operations │ │ │ ├── • SetIndexName │ │ IndexID: 1 │ │ Name: t_pkey │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -260,14 +245,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -275,28 +252,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ @@ -432,14 +393,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 10 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_11_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_11_of_15 index 41728115cb0e..e35609526b74 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_11_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_11_of_15 @@ -197,35 +197,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 19 Mutation operations + │ └── • 18 Mutation operations │ │ │ ├── • SetIndexName │ │ IndexID: 1 │ │ Name: t_pkey │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -260,14 +245,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -275,28 +252,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ @@ -432,14 +393,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 11 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_12_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_12_of_15 index 0d2a46fc59a3..48d33afa2086 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_12_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_12_of_15 @@ -197,35 +197,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 19 Mutation operations + │ └── • 18 Mutation operations │ │ │ ├── • SetIndexName │ │ IndexID: 1 │ │ Name: t_pkey │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -260,14 +245,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -275,28 +252,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ @@ -432,14 +393,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 12 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_13_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_13_of_15 index 8c2af8e473f0..47bce1c255dd 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_13_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_13_of_15 @@ -188,35 +188,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 20 Mutation operations + │ └── • 18 Mutation operations │ │ │ ├── • SetIndexName │ │ IndexID: 1 │ │ Name: t_pkey │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -246,14 +231,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -261,51 +238,15 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ constraintId: 4 - │ │ indexId: 5 - │ │ isUnique: true - │ │ sourceIndexId: 3 - │ │ tableId: 104 - │ │ temporaryIndexId: 6 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: CREATE UNIQUE INDEX ‹idx› ON ‹defaultdb›.public.‹t› (‹k›) - │ │ StatementTag: CREATE INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ StatementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 5 │ │ TableID: 104 @@ -462,14 +403,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 13 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_14_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_14_of_15 index 3631a22afe0d..f66c62f68f95 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_14_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_14_of_15 @@ -188,35 +188,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 20 Mutation operations + │ └── • 18 Mutation operations │ │ │ ├── • SetIndexName │ │ IndexID: 1 │ │ Name: t_pkey │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -246,14 +231,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -261,51 +238,15 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ constraintId: 4 - │ │ indexId: 5 - │ │ isUnique: true - │ │ sourceIndexId: 3 - │ │ tableId: 104 - │ │ temporaryIndexId: 6 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: CREATE UNIQUE INDEX ‹idx› ON ‹defaultdb›.public.‹t› (‹k›) - │ │ StatementTag: CREATE INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ StatementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 5 │ │ TableID: 104 @@ -462,14 +403,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 14 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_15_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_15_of_15 index dde0f8d2896d..de47ca727c21 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_15_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_15_of_15 @@ -188,35 +188,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 20 Mutation operations + │ └── • 18 Mutation operations │ │ │ ├── • SetIndexName │ │ IndexID: 1 │ │ Name: t_pkey │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -240,26 +225,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ IndexID: 4 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ constraintId: 4 - │ │ indexId: 5 - │ │ isUnique: true - │ │ sourceIndexId: 3 - │ │ tableId: 104 - │ │ temporaryIndexId: 6 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: CREATE UNIQUE INDEX ‹idx› ON ‹defaultdb›.public.‹t› (‹k›) - │ │ StatementTag: CREATE INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ StatementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 5 │ │ TableID: 104 @@ -275,14 +240,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -290,28 +247,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ @@ -462,14 +403,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 15 of 15; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_1_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_1_of_15 index 2d2b422aaf0f..c48bdcdcdf69 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_1_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_1_of_15 @@ -130,30 +130,15 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ - └── • 14 Mutation operations - │ - ├── • RefreshStats - │ TableID: 104 - │ - ├── • LogEvent - │ Element: - │ SecondaryIndex: - │ indexId: 2 - │ tableId: 104 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 - │ TargetStatus: 2 + └── • 13 Mutation operations │ ├── • MakeValidatedSecondaryIndexPublic │ IndexID: 2 │ TableID: 104 │ + ├── • RefreshStats + │ TableID: 104 + │ ├── • SetColumnName │ ColumnID: 2 │ Name: j @@ -170,14 +155,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • MakeWriteOnlyColumnPublic │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RefreshStats @@ -185,28 +162,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 15; │ ├── • MakeWriteOnlyColumnPublic │ ColumnID: 4 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RefreshStats │ TableID: 104 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_2_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_2_of_15 index 12dbae613f59..17bfcefdb70d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_2_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_2_of_15 @@ -118,30 +118,15 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 13 Mutation operations - │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 + │ └── • 12 Mutation operations │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -158,14 +143,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -173,28 +150,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_3_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_3_of_15 index bb3bbaa10837..2882509b6d73 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_3_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_3_of_15 @@ -118,30 +118,15 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 13 Mutation operations - │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 + │ └── • 12 Mutation operations │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -158,14 +143,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -173,28 +150,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_4_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_4_of_15 index f8c0f8587aac..ffa6a5eaa002 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_4_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_4_of_15 @@ -118,30 +118,15 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 13 Mutation operations - │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 + │ └── • 12 Mutation operations │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -153,14 +138,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ @@ -170,14 +147,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -185,14 +154,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_5_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_5_of_15 index 6aa70e472c84..3c265dd6eaec 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_5_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_5_of_15 @@ -109,30 +109,15 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 13 Mutation operations - │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 + │ └── • 12 Mutation operations │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -149,14 +134,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -164,14 +141,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -238,14 +207,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 15; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_6_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_6_of_15 index ecee9dcab77a..f42940d24d6a 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_6_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_6_of_15 @@ -109,30 +109,15 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 13 Mutation operations - │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 + │ └── • 12 Mutation operations │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -149,14 +134,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -164,14 +141,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -238,14 +207,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 15; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_7_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_7_of_15 index 7cb086d379ac..eb8c263bd4a6 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_7_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_7_of_15 @@ -109,30 +109,15 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 13 Mutation operations - │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 + │ └── • 12 Mutation operations │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -153,14 +138,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -168,14 +145,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -238,14 +207,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 15; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_8_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_8_of_15 index 6da528ff25a8..daba39d8b2e1 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_8_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_8_of_15 @@ -109,30 +109,15 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 13 Mutation operations - │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 + │ └── • 12 Mutation operations │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -153,14 +138,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -168,14 +145,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -238,14 +207,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 8 of 15; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_9_of_15 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_9_of_15 index f7c0e16abf86..6440a613af3d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_9_of_15 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.rollback_9_of_15 @@ -203,35 +203,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 19 Mutation operations + │ └── • 18 Mutation operations │ │ │ ├── • SetIndexName │ │ IndexID: 1 │ │ Name: t_pkey │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -262,14 +247,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -277,28 +254,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 1 │ │ TableID: 104 │ │ @@ -407,14 +368,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 9 of 15; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_1_of_2 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_1_of_2 index a4fd228e9e58..cb2e98bf4110 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_1_of_2 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_1_of_2 @@ -91,28 +91,12 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ -│ └── • 13 Mutation operations +│ └── • 11 Mutation operations │ │ │ ├── • MakePublicColumnWriteOnly │ │ ColumnID: 2 │ │ TableID: 104 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 2 -│ │ pgAttributeNum: 2 -│ │ tableId: 104 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: crdb_internal_column_2_name_placeholder @@ -165,23 +149,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ColumnID: 4 │ │ TableID: 104 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 4 -│ │ isInaccessible: true -│ │ pgAttributeNum: 4 -│ │ tableId: 104 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ └── • SetColumnName │ ColumnID: 4 │ Name: crdb_internal_column_4_name_placeholder @@ -526,7 +493,7 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ └── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ rule: "index no longer public before dependents" │ │ - │ └── • 12 Mutation operations + │ └── • 11 Mutation operations │ │ │ ├── • MakeWriteOnlyColumnDeleteOnly │ │ ColumnID: 2 @@ -554,21 +521,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ IndexID: 4 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 │ │ TableID: 104 @@ -579,14 +531,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ @@ -677,14 +621,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly @@ -778,14 +714,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 1 │ TableID: 104 │ @@ -809,14 +737,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_2_of_2 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_2_of_2 index c1e847c994aa..89037997493c 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_2_of_2 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_create_index_separate_statements.statement_2_of_2 @@ -313,14 +313,6 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ │ TableID: 104 │ │ │ │ │ ├── • MakeValidatedPrimaryIndexPublic -│ │ │ EventBase: -│ │ │ Authorization: -│ │ │ UserName: root -│ │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE -│ │ │ StatementTag: ALTER TABLE -│ │ │ TargetMetadata: -│ │ │ SourceElementID: 1 -│ │ │ SubWorkID: 1 │ │ │ IndexID: 3 │ │ │ TableID: 104 │ │ │ @@ -697,7 +689,7 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ └── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ rule: "index no longer public before dependents" │ │ - │ └── • 13 Mutation operations + │ └── • 11 Mutation operations │ │ │ ├── • MakeWriteOnlyColumnDeleteOnly │ │ ColumnID: 2 @@ -711,33 +703,13 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ IndexID: 4 │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ constraintId: 4 - │ │ indexId: 5 - │ │ isUnique: true - │ │ sourceIndexId: 3 - │ │ tableId: 104 - │ │ temporaryIndexId: 6 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: CREATE UNIQUE INDEX ‹idx› ON ‹defaultdb›.‹public›.‹t› (‹k›) - │ │ StatementTag: CREATE INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ StatementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 5 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 6 │ │ TableID: 104 @@ -746,21 +718,6 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ │ IndexID: 1 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 │ │ TableID: 104 @@ -940,14 +897,6 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); └── • 12 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 1 │ TableID: 104 │ @@ -977,26 +926,10 @@ EXPLAIN (ddl, verbose) CREATE UNIQUE INDEX idx ON t(k); │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 4 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • CreateGCJobForIndex diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index index 17261317b382..12eafcae02c0 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index @@ -85,28 +85,12 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 106, ColumnID: 3} │ │ rule: "column no longer public before dependents" │ │ -│ └── • 11 Mutation operations +│ └── • 10 Mutation operations │ │ │ ├── • MakePublicColumnWriteOnly │ │ ColumnID: 3 │ │ TableID: 106 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 3 -│ │ pgAttributeNum: 3 -│ │ tableId: 106 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹t›.‹public›.‹test› DROP COLUMN ‹pi› -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ ├── • SetColumnName │ │ ColumnID: 3 │ │ Name: crdb_internal_column_3_name_placeholder @@ -504,14 +488,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ │ TableID: 106 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹t›.‹public›.‹test› DROP COLUMN ‹pi› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 6 │ │ TableID: 106 │ │ @@ -654,14 +630,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹t›.‹public›.‹test› DROP COLUMN ‹pi› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 4 │ TableID: 106 │ @@ -679,14 +647,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t.test DROP pi; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 3 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹t›.‹public›.‹test› DROP COLUMN ‹pi› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_1_of_7 index 1ce16366942a..bfd42914be68 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_1_of_7 @@ -123,28 +123,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • MakeWriteOnlyColumnPublic │ ColumnID: 3 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹t›.public.‹test› DROP COLUMN ‹pi› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 106 │ ├── • RefreshStats │ TableID: 106 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹t›.public.‹test› DROP COLUMN ‹pi› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 4 │ TableID: 106 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_2_of_7 index 216556cc9216..f9b1ab50a892 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_2_of_7 @@ -112,28 +112,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹t›.public.‹test› DROP COLUMN ‹pi› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 106 │ │ │ ├── • RefreshStats │ │ TableID: 106 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹t›.public.‹test› DROP COLUMN ‹pi› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 106 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_3_of_7 index 08cd898ba85b..1346d442bed1 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_3_of_7 @@ -112,28 +112,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹t›.public.‹test› DROP COLUMN ‹pi› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 106 │ │ │ ├── • RefreshStats │ │ TableID: 106 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹t›.public.‹test› DROP COLUMN ‹pi› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 106 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_4_of_7 index d6392cfc1e1a..56529ec19d53 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_4_of_7 @@ -112,28 +112,12 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹t›.public.‹test› DROP COLUMN ‹pi› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 106 │ │ │ ├── • RefreshStats │ │ TableID: 106 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹t›.public.‹test› DROP COLUMN ‹pi› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 4 │ │ TableID: 106 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_5_of_7 index f19f5ac60f09..d922bfaafc8f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_5_of_7 @@ -100,14 +100,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹t›.public.‹test› DROP COLUMN ‹pi› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 106 │ │ │ ├── • RefreshStats @@ -180,14 +172,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹t›.public.‹test› DROP COLUMN ‹pi› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 4 │ TableID: 106 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_6_of_7 index 71f1de0a827e..994a08f4b170 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_6_of_7 @@ -100,14 +100,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹t›.public.‹test› DROP COLUMN ‹pi› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 106 │ │ │ ├── • RefreshStats @@ -180,14 +172,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹t›.public.‹test› DROP COLUMN ‹pi› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 4 │ TableID: 106 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_7_of_7 index a3df4e3b0fd2..78616ca2f770 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_unique_index.rollback_7_of_7 @@ -104,14 +104,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹t›.public.‹test› DROP COLUMN ‹pi› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 106 │ │ │ ├── • RefreshStats @@ -180,14 +172,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹t›.public.‹test› DROP COLUMN ‹pi› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 4 │ TableID: 106 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index index 67ce28e59624..08af2d4ac0e6 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index @@ -67,7 +67,7 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ -│ └── • 8 Mutation operations +│ └── • 7 Mutation operations │ │ │ ├── • MakePublicSecondaryIndexWriteOnly │ │ IndexID: 2 @@ -104,22 +104,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ ColumnID: 2 │ │ TableID: 104 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 2 -│ │ pgAttributeNum: 2 -│ │ tableId: 104 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ └── • SetColumnName │ ColumnID: 2 │ Name: crdb_internal_column_2_name_placeholder @@ -425,7 +409,7 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ └── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ rule: "index no longer public before dependents" │ │ - │ └── • 11 Mutation operations + │ └── • 10 Mutation operations │ │ │ ├── • MakeWriteOnlyColumnDeleteOnly │ │ ColumnID: 2 @@ -449,21 +433,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ IndexID: 4 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 │ │ TableID: 104 @@ -474,14 +443,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ @@ -633,14 +594,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 1 │ TableID: 104 │ @@ -664,14 +617,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_1_of_7 index a287260d93c6..c27982a2fb43 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_1_of_7 @@ -90,59 +90,28 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ └── • skip PUBLIC → ABSENT operations │ rule: "skip index-column removal ops on index removal" │ - └── • 11 Mutation operations + └── • 10 Mutation operations │ ├── • SetColumnName │ ColumnID: 2 │ Name: j │ TableID: 104 │ - ├── • RefreshStats - │ TableID: 104 - │ - ├── • LogEvent - │ Element: - │ SecondaryIndex: - │ indexId: 2 - │ tableId: 104 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 - │ TargetStatus: 2 - │ ├── • MakeValidatedSecondaryIndexPublic │ IndexID: 2 │ TableID: 104 │ + ├── • RefreshStats + │ TableID: 104 + │ ├── • MakeWriteOnlyColumnPublic │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RefreshStats │ TableID: 104 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_2_of_7 index b234877f836c..a89893867074 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_2_of_7 @@ -81,63 +81,32 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 10 Mutation operations + │ └── • 9 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_3_of_7 index ae5a8c39e0d2..c60bba6855fb 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_3_of_7 @@ -81,63 +81,32 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 10 Mutation operations + │ └── • 9 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_4_of_7 index aaa575870bdb..679857cc4d4d 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_4_of_7 @@ -81,63 +81,32 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 10 Mutation operations + │ └── • 9 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_5_of_7 index db9bbcc8cc17..e5f7a8858f24 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_5_of_7 @@ -75,49 +75,26 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 10 Mutation operations + │ └── • 9 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -178,14 +155,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_6_of_7 index 45119e457a9c..26b1f2ddaf1e 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_6_of_7 @@ -75,49 +75,26 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 10 Mutation operations + │ └── • 9 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 4 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -178,14 +155,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_7_of_7 index a7f16a8bb06b..5c1371538d2f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_column_with_index.rollback_7_of_7 @@ -75,35 +75,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 10 Mutation operations + │ └── • 9 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 3 │ │ TableID: 104 @@ -114,14 +99,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -178,14 +155,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index index d09f55234ecf..867f6b0441e6 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_hash_sharded_index @@ -46,7 +46,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ └── • Precedence dependency from VALIDATED CheckConstraint:{DescID: 104, IndexID: 0, ConstraintID: 2} │ │ rule: "constraint no longer public before dependents" │ │ -│ └── • 6 Mutation operations +│ └── • 5 Mutation operations │ │ │ ├── • MakePublicSecondaryIndexWriteOnly │ │ IndexID: 2 @@ -65,23 +65,6 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ ColumnID: 3 │ │ TableID: 104 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 3 -│ │ isHidden: true -│ │ pgAttributeNum: 3 -│ │ tableId: 104 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE -│ │ StatementTag: DROP INDEX -│ │ TargetMetadata: -│ │ SourceElementID: 2 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ └── • SetColumnName │ ColumnID: 3 │ Name: crdb_internal_column_3_name_placeholder @@ -136,7 +119,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ - 104 │ JobID: 1 │ NonCancelable: true -│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 5 MutationType ops pending +│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops pending │ Statements: │ - statement: DROP INDEX idx CASCADE │ redactedstatement: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE @@ -178,7 +161,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ └── • Precedence dependency from ABSENT ConstraintWithoutIndexName:{DescID: 104, Name: check_crdb_internal_j_shard_16, ConstraintID: 2} │ │ rule: "dependents removed before constraint" │ │ - │ └── • 7 Mutation operations + │ └── • 6 Mutation operations │ │ │ ├── • MakeWriteOnlyColumnDeleteOnly │ │ ColumnID: 3 @@ -188,28 +171,6 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ ConstraintID: 2 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ isCreatedExplicitly: true - │ │ sharding: - │ │ columnNames: - │ │ - j - │ │ isSharded: true - │ │ name: crdb_internal_j_shard_16 - │ │ shardBuckets: 16 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE - │ │ StatementTag: DROP INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 │ │ TableID: 104 @@ -294,14 +255,6 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 3 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE - │ StatementTag: DROP INDEX - │ TargetMetadata: - │ SourceElementID: 2 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index index 8f4339cc78ab..d893f1862cc0 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_partial_expression_index @@ -34,7 +34,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ -│ └── • 4 Mutation operations +│ └── • 3 Mutation operations │ │ │ ├── • MakePublicSecondaryIndexWriteOnly │ │ IndexID: 2 @@ -44,23 +44,6 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ ColumnID: 3 │ │ TableID: 104 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 3 -│ │ isInaccessible: true -│ │ pgAttributeNum: 3 -│ │ tableId: 104 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE -│ │ StatementTag: DROP INDEX -│ │ TargetMetadata: -│ │ SourceElementID: 2 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ └── • SetColumnName │ ColumnID: 3 │ Name: crdb_internal_column_3_name_placeholder @@ -106,7 +89,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ - 104 │ JobID: 1 │ NonCancelable: true -│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops pending +│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 3 MutationType ops pending │ Statements: │ - statement: DROP INDEX idx CASCADE │ redactedstatement: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE @@ -139,28 +122,12 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ └── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ rule: "index no longer public before dependents" │ │ - │ └── • 6 Mutation operations + │ └── • 5 Mutation operations │ │ │ ├── • MakeWriteOnlyColumnDeleteOnly │ │ ColumnID: 3 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ isCreatedExplicitly: true - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE - │ │ StatementTag: DROP INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 │ │ TableID: 104 @@ -256,14 +223,6 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 3 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE - │ StatementTag: DROP INDEX - │ TargetMetadata: - │ SourceElementID: 2 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index index f27ff5c2f981..a8beaa62ec27 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_vanilla_index @@ -62,7 +62,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ - 104 │ JobID: 1 │ NonCancelable: true -│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 3 MutationType ops pending +│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 2 MutationType ops pending │ Statements: │ - statement: DROP INDEX idx CASCADE │ redactedstatement: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE @@ -89,23 +89,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ └── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ rule: "index no longer public before dependents" │ │ - │ └── • 5 Mutation operations - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ isCreatedExplicitly: true - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: DROP INDEX ‹defaultdb›.‹public›.‹t›@‹idx› CASCADE - │ │ StatementTag: DROP INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 + │ └── • 4 Mutation operations │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_with_materialized_view_dep b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_with_materialized_view_dep index 297f2fe744eb..1ec0625c138b 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_with_materialized_view_dep +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_index_with_materialized_view_dep @@ -385,50 +385,18 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 1 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP INDEX ‹defaultdb›.‹public›.‹v2›@‹idx› CASCADE -│ │ StatementTag: DROP INDEX -│ │ TargetMetadata: -│ │ SourceElementID: 2 -│ │ SubWorkID: 1 │ │ TableID: 106 │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 4294967295 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP INDEX ‹defaultdb›.‹public›.‹v2›@‹idx› CASCADE -│ │ StatementTag: DROP INDEX -│ │ TargetMetadata: -│ │ SourceElementID: 2 -│ │ SubWorkID: 1 │ │ TableID: 106 │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 4294967294 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP INDEX ‹defaultdb›.‹public›.‹v2›@‹idx› CASCADE -│ │ StatementTag: DROP INDEX -│ │ TargetMetadata: -│ │ SourceElementID: 2 -│ │ SubWorkID: 1 │ │ TableID: 106 │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 2 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP INDEX ‹defaultdb›.‹public›.‹v2›@‹idx› CASCADE -│ │ StatementTag: DROP INDEX -│ │ TargetMetadata: -│ │ SourceElementID: 2 -│ │ SubWorkID: 1 │ │ TableID: 106 │ │ │ ├── • SetJobStateOnDescriptor @@ -447,7 +415,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ - 106 │ JobID: 1 │ NonCancelable: true -│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 6 MutationType ops pending +│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 2 with 4 MutationType ops pending │ Statements: │ - statement: DROP INDEX idx CASCADE │ redactedstatement: DROP INDEX ‹defaultdb›.‹public›.‹v2›@‹idx› CASCADE @@ -498,29 +466,7 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ └── • SameStagePrecedence dependency from ABSENT View:{DescID: 106} │ │ rule: "table removed right before garbage collection" │ │ - │ └── • 8 Mutation operations - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ View: - │ │ forwardReferences: - │ │ - columnIds: - │ │ - 2 - │ │ indexId: 2 - │ │ toId: 105 - │ │ isMaterialized: true - │ │ usesRelationIds: - │ │ - 105 - │ │ viewId: 106 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: DROP INDEX ‹defaultdb›.‹public›.‹v2›@‹idx› CASCADE - │ │ StatementTag: DROP INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 2 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 + │ └── • 6 Mutation operations │ │ │ ├── • CreateGCJobForTable │ │ DatabaseID: 100 @@ -528,22 +474,6 @@ EXPLAIN (ddl, verbose) DROP INDEX idx CASCADE; │ │ Statement: DROP INDEX defaultdb.public.v2@idx CASCADE │ │ TableID: 106 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ isCreatedExplicitly: true - │ │ tableId: 105 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: DROP INDEX ‹defaultdb›.‹public›.‹v2›@‹idx› CASCADE - │ │ StatementTag: DROP INDEX - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 │ │ TableID: 105 diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_1_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_1_of_7 index dd62dac77a2a..716c43d49e66 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_1_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_1_of_7 @@ -151,35 +151,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ └── • PreviousTransactionPrecedence dependency from DELETE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: DELETE_ONLY->ABSENT" │ - └── • 17 Mutation operations + └── • 16 Mutation operations │ ├── • SetColumnName │ ColumnID: 3 │ Name: k │ TableID: 104 │ - ├── • RefreshStats - │ TableID: 104 - │ - ├── • LogEvent - │ Element: - │ SecondaryIndex: - │ indexId: 2 - │ tableId: 104 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 - │ TargetStatus: 2 - │ ├── • MakeValidatedSecondaryIndexPublic │ IndexID: 2 │ TableID: 104 │ + ├── • RefreshStats + │ TableID: 104 + │ ├── • SetColumnName │ ColumnID: 2 │ Name: j @@ -196,42 +181,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • MakeWriteOnlyColumnPublic │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RefreshStats │ TableID: 104 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ ├── • MakeWriteOnlyColumnPublic │ ColumnID: 3 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹k› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ StatementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RefreshStats @@ -239,14 +199,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7; │ ├── • MakeWriteOnlyColumnPublic │ ColumnID: 4 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RefreshStats diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_2_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_2_of_7 index 3a243a2e43ee..74d8710d8a9a 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_2_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_2_of_7 @@ -142,35 +142,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 16 Mutation operations + │ └── • 15 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 3 │ │ Name: k │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -187,42 +172,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹k› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ StatementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -230,14 +190,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_3_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_3_of_7 index c7c372c36ca6..98f47243d89c 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_3_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_3_of_7 @@ -142,35 +142,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 16 Mutation operations + │ └── • 15 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 3 │ │ Name: k │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -187,42 +172,17 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹k› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ StatementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -230,14 +190,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_4_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_4_of_7 index 2c4977f841e0..4d2f40959917 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_4_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_4_of_7 @@ -142,35 +142,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 16 Mutation operations + │ └── • 15 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 3 │ │ Name: k │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -182,14 +167,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ TableID: 104 │ │ │ ├── • MakeIndexAbsent - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ @@ -199,14 +176,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -214,15 +183,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹k› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ StatementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -230,14 +190,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_5_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_5_of_7 index 070766dadaed..09ca4b13c823 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_5_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_5_of_7 @@ -136,35 +136,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 16 Mutation operations + │ └── • 15 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 3 │ │ Name: k │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -181,14 +166,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -200,15 +177,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹k› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ StatementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -216,14 +184,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -280,14 +240,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_6_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_6_of_7 index 4465633054bf..8c1b25e8815f 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_6_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_6_of_7 @@ -136,35 +136,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 16 Mutation operations + │ └── • 15 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 3 │ │ Name: k │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -181,14 +166,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -200,15 +177,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹k› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ StatementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -216,14 +184,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -280,14 +240,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_7_of_7 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_7_of_7 index 7198934af1f4..fccf0a55ab71 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_7_of_7 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.rollback_7_of_7 @@ -136,35 +136,20 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ └── • PreviousTransactionPrecedence dependency from WRITE_ONLY TemporaryIndex:{DescID: 104, IndexID: 4, ConstraintID: 3, SourceIndexID: 1} │ │ rule: "TemporaryIndex transitions to ABSENT uphold 2-version invariant: WRITE_ONLY->DELETE_ONLY" │ │ - │ └── • 16 Mutation operations + │ └── • 15 Mutation operations │ │ │ ├── • SetColumnName │ │ ColumnID: 3 │ │ Name: k │ │ TableID: 104 │ │ - │ ├── • RefreshStats - │ │ TableID: 104 - │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 2 - │ │ │ ├── • MakeValidatedSecondaryIndexPublic │ │ IndexID: 2 │ │ TableID: 104 │ │ + │ ├── • RefreshStats + │ │ TableID: 104 + │ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: j @@ -185,14 +170,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 2 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -200,15 +177,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 3 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹k› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ StatementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -216,14 +184,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; │ │ │ ├── • MakeWriteOnlyColumnPublic │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • RefreshStats @@ -280,14 +240,6 @@ EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7; └── • 6 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.public.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 3 │ TableID: 104 │ diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_1_of_2 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_1_of_2 index a4fd228e9e58..cb2e98bf4110 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_1_of_2 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_1_of_2 @@ -91,28 +91,12 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ └── • PreviousTransactionPrecedence dependency from PUBLIC SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ rule: "SecondaryIndex transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED" │ │ -│ └── • 13 Mutation operations +│ └── • 11 Mutation operations │ │ │ ├── • MakePublicColumnWriteOnly │ │ ColumnID: 2 │ │ TableID: 104 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 2 -│ │ pgAttributeNum: 2 -│ │ tableId: 104 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ ├── • SetColumnName │ │ ColumnID: 2 │ │ Name: crdb_internal_column_2_name_placeholder @@ -165,23 +149,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ ColumnID: 4 │ │ TableID: 104 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 4 -│ │ isInaccessible: true -│ │ pgAttributeNum: 4 -│ │ tableId: 104 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ └── • SetColumnName │ ColumnID: 4 │ Name: crdb_internal_column_4_name_placeholder @@ -526,7 +493,7 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ └── • Precedence dependency from VALIDATED SecondaryIndex:{DescID: 104, IndexID: 2, ConstraintID: 0} │ │ rule: "index no longer public before dependents" │ │ - │ └── • 12 Mutation operations + │ └── • 11 Mutation operations │ │ │ ├── • MakeWriteOnlyColumnDeleteOnly │ │ ColumnID: 2 @@ -554,21 +521,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ IndexID: 4 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 │ │ TableID: 104 @@ -579,14 +531,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ @@ -677,14 +621,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly @@ -778,14 +714,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; └── • 7 Mutation operations │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 1 │ TableID: 104 │ @@ -809,14 +737,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN j CASCADE; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_2_of_2 b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_2_of_2 index 25340ef361c2..4fca101d948b 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_2_of_2 +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_multiple_columns_separate_statements.statement_2_of_2 @@ -28,29 +28,12 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ └── • Precedence dependency from WRITE_ONLY Column:{DescID: 104, ColumnID: 3} │ │ rule: "column no longer public before dependents" │ │ -│ └── • 3 Mutation operations +│ └── • 2 Mutation operations │ │ │ ├── • MakePublicColumnWriteOnly │ │ ColumnID: 3 │ │ TableID: 104 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ Column: -│ │ columnId: 3 -│ │ pgAttributeNum: 3 -│ │ tableId: 104 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹k› CASCADE -│ │ StatementTag: ALTER TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ StatementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ └── • SetColumnName │ ColumnID: 3 │ Name: crdb_internal_column_3_name_placeholder @@ -410,7 +393,7 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index-column removal ops on index removal" │ │ - │ └── • 14 Mutation operations + │ └── • 13 Mutation operations │ │ │ ├── • MakeWriteOnlyColumnDeleteOnly │ │ ColumnID: 3 @@ -448,21 +431,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ IndexID: 4 │ │ TableID: 104 │ │ - │ ├── • LogEvent - │ │ Element: - │ │ SecondaryIndex: - │ │ indexId: 2 - │ │ tableId: 104 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 - │ │ TargetStatus: 1 - │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly │ │ IndexID: 2 │ │ TableID: 104 @@ -473,14 +441,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ TableID: 104 │ │ │ ├── • MakeValidatedPrimaryIndexPublic - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ IndexID: 3 │ │ TableID: 104 │ │ @@ -571,14 +531,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 4 - │ │ EventBase: - │ │ Authorization: - │ │ UserName: root - │ │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ │ StatementTag: ALTER TABLE - │ │ TargetMetadata: - │ │ SourceElementID: 1 - │ │ SubWorkID: 1 │ │ TableID: 104 │ │ │ ├── • MakeWriteOnlyIndexDeleteOnly @@ -741,14 +693,6 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ TableID: 104 │ ├── • MakeIndexAbsent - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ IndexID: 1 │ TableID: 104 │ @@ -772,27 +716,10 @@ EXPLAIN (ddl, verbose) ALTER TABLE t DROP COLUMN k CASCADE; │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 2 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹j› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • MakeDeleteOnlyColumnAbsent │ ColumnID: 3 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› DROP COLUMN ‹k› CASCADE - │ StatementTag: ALTER TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ StatementID: 1 - │ SubWorkID: 1 │ TableID: 104 │ ├── • RemoveJobStateFromDescriptor diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_schema b/pkg/sql/schemachanger/testdata/explain_verbose/drop_schema index 75e3628f0534..55545d228d8a 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_schema +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_schema @@ -104,7 +104,7 @@ EXPLAIN (ddl, verbose) DROP SCHEMA db.sc; │ - 106 │ JobID: 1 │ NonCancelable: true -│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 2 MutationType ops pending +│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 1 MutationType op pending │ Statements: │ - statement: DROP SCHEMA db.sc │ redactedstatement: DROP SCHEMA ‹db›.‹sc› @@ -122,21 +122,7 @@ EXPLAIN (ddl, verbose) DROP SCHEMA db.sc; │ └── • PreviousTransactionPrecedence dependency from DROPPED Schema:{DescID: 106} │ rule: "descriptor DROPPED in transaction before removal" │ - └── • 5 Mutation operations - │ - ├── • LogEvent - │ Element: - │ Schema: - │ schemaId: 106 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: DROP SCHEMA ‹db›.‹sc› - │ StatementTag: DROP SCHEMA - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 - │ TargetStatus: 1 + └── • 4 Mutation operations │ ├── • DeleteDescriptor │ DescriptorID: 106 diff --git a/pkg/sql/schemachanger/testdata/explain_verbose/drop_table b/pkg/sql/schemachanger/testdata/explain_verbose/drop_table index 0e6c470fcd4d..8972826c6925 100644 --- a/pkg/sql/schemachanger/testdata/explain_verbose/drop_table +++ b/pkg/sql/schemachanger/testdata/explain_verbose/drop_table @@ -399,7 +399,7 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ │ └── • skip PUBLIC → ABSENT operations │ │ rule: "skip index dependents removal ops on relation drop" │ │ -│ └── • 12 Mutation operations +│ └── • 11 Mutation operations │ │ │ ├── • MarkDescriptorAsDropped │ │ DescriptorID: 107 @@ -407,21 +407,6 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ ├── • RemoveTableComment │ │ TableID: 107 │ │ -│ ├── • LogEvent -│ │ Element: -│ │ TableComment: -│ │ comment: t has a comment -│ │ tableId: 107 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP TABLE ‹db›.‹sc›.‹t› -│ │ StatementTag: DROP TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 -│ │ TargetStatus: 1 -│ │ │ ├── • RemoveColumnDefaultExpression │ │ ColumnID: 3 │ │ TableID: 107 @@ -435,62 +420,22 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 1 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP TABLE ‹db›.‹sc›.‹t› -│ │ StatementTag: DROP TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 │ │ TableID: 107 │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 2 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP TABLE ‹db›.‹sc›.‹t› -│ │ StatementTag: DROP TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 │ │ TableID: 107 │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 4294967295 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP TABLE ‹db›.‹sc›.‹t› -│ │ StatementTag: DROP TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 │ │ TableID: 107 │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 4294967294 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP TABLE ‹db›.‹sc›.‹t› -│ │ StatementTag: DROP TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 │ │ TableID: 107 │ │ │ ├── • MakeDeleteOnlyColumnAbsent │ │ ColumnID: 3 -│ │ EventBase: -│ │ Authorization: -│ │ UserName: root -│ │ Statement: DROP TABLE ‹db›.‹sc›.‹t› -│ │ StatementTag: DROP TABLE -│ │ TargetMetadata: -│ │ SourceElementID: 1 -│ │ SubWorkID: 1 │ │ TableID: 107 │ │ │ ├── • SetJobStateOnDescriptor @@ -504,7 +449,7 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ - 107 │ JobID: 1 │ NonCancelable: true -│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 3 MutationType ops pending +│ RunningStatus: PostCommitNonRevertiblePhase stage 1 of 1 with 2 MutationType ops pending │ Statements: │ - statement: DROP TABLE db.sc.t │ redactedstatement: DROP TABLE ‹db›.‹sc›.‹t› @@ -537,21 +482,7 @@ EXPLAIN (ddl, verbose) DROP TABLE db.sc.t; │ └── • SameStagePrecedence dependency from ABSENT Table:{DescID: 107} │ rule: "table removed right before garbage collection" │ - └── • 5 Mutation operations - │ - ├── • LogEvent - │ Element: - │ Table: - │ tableId: 107 - │ EventBase: - │ Authorization: - │ UserName: root - │ Statement: DROP TABLE ‹db›.‹sc›.‹t› - │ StatementTag: DROP TABLE - │ TargetMetadata: - │ SourceElementID: 1 - │ SubWorkID: 1 - │ TargetStatus: 1 + └── • 4 Mutation operations │ ├── • CreateGCJobForTable │ DatabaseID: 104