Skip to content

Commit

Permalink
tree,parser: fix round-tripping of StorageParameter
Browse files Browse the repository at this point in the history
Previously, storage parameters could not round trip the
parse-format-parse steps if the parameter key was a reserved keyword.

This was because the Name type was used for keys, which ends up
double-quoting the name. For storage parameters, we want single quotes,
as they are just string literals, so we can use a normal string type.

Release note: None
  • Loading branch information
rafiss committed May 24, 2024
1 parent d146ecf commit 2006510
Show file tree
Hide file tree
Showing 27 changed files with 110 additions and 93 deletions.
3 changes: 2 additions & 1 deletion pkg/sql/alter_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"context"
gojson "encoding/json"
"fmt"
"slices"
"sort"
"time"

Expand Down Expand Up @@ -2236,7 +2237,7 @@ func isSetOrResetSchemaLocked(n *tree.AlterTable) bool {
return true
}
case *tree.AlterTableResetStorageParams:
if cmd.Params.Contains("schema_locked") {
if slices.Contains(cmd.Params, "schema_locked") {
return true
}
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/sql/parser/sql.y
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ func (u *sqlSymUnion) storageParams() []tree.StorageParam {
}
return nil
}
func (u *sqlSymUnion) storageParamKeys() []tree.Name {
if params, ok := u.val.([]tree.Name); ok {
func (u *sqlSymUnion) storageParamKeys() []string {
if params, ok := u.val.([]string); ok {
return params
}
return nil
Expand Down Expand Up @@ -1365,7 +1365,7 @@ func (u *sqlSymUnion) showFingerprintOptions() *tree.ShowFingerprintOptions {
%type <*tree.CopyOptions> opt_with_copy_options copy_options copy_options_list copy_generic_options copy_generic_options_list
%type <str> import_format
%type <str> storage_parameter_key
%type <tree.NameList> storage_parameter_key_list
%type <[]string> storage_parameter_key_list
%type <tree.StorageParam> storage_parameter
%type <[]tree.StorageParam> storage_parameter_list opt_table_with opt_with_storage_parameter_list

Expand Down Expand Up @@ -9882,17 +9882,17 @@ storage_parameter_key:
storage_parameter_key_list:
storage_parameter_key
{
$$.val = []tree.Name{tree.Name($1)}
$$.val = []string{$1}
}
| storage_parameter_key_list ',' storage_parameter_key
{
$$.val = append($1.storageParamKeys(), tree.Name($3))
$$.val = append($1.storageParamKeys(), $3)
}

storage_parameter:
storage_parameter_key '=' var_value
{
$$.val = tree.StorageParam{Key: tree.Name($1), Value: $3.expr()}
$$.val = tree.StorageParam{Key: $1, Value: $3.expr()}
}

storage_parameter_list:
Expand Down
48 changes: 28 additions & 20 deletions pkg/sql/parser/testdata/alter_table
Original file line number Diff line number Diff line change
Expand Up @@ -1135,42 +1135,50 @@ ALTER TABLE _ EXPERIMENTAL_AUDIT SET OFF -- identifiers removed
parse
ALTER TABLE t SET (fillfactor = 100, autovacuum_enabled = false)
----
ALTER TABLE t SET (fillfactor = 100, autovacuum_enabled = false)
ALTER TABLE t SET (fillfactor = (100), autovacuum_enabled = (false)) -- fully parenthesized
ALTER TABLE t SET (fillfactor = _, autovacuum_enabled = _) -- literals removed
ALTER TABLE _ SET (_ = 100, _ = false) -- identifiers removed
ALTER TABLE t SET ('fillfactor' = 100, 'autovacuum_enabled' = false) -- normalized!
ALTER TABLE t SET ('fillfactor' = (100), 'autovacuum_enabled' = (false)) -- fully parenthesized
ALTER TABLE t SET ('fillfactor' = _, 'autovacuum_enabled' = _) -- literals removed
ALTER TABLE _ SET ('fillfactor' = 100, 'autovacuum_enabled' = false) -- identifiers removed

parse
ALTER TABLE t RESET (fillfactor)
----
ALTER TABLE t RESET (fillfactor)
ALTER TABLE t RESET (fillfactor) -- fully parenthesized
ALTER TABLE t RESET (fillfactor) -- literals removed
ALTER TABLE _ RESET (_) -- identifiers removed
ALTER TABLE t RESET ('fillfactor') -- normalized!
ALTER TABLE t RESET ('fillfactor') -- fully parenthesized
ALTER TABLE t RESET ('fillfactor') -- literals removed
ALTER TABLE _ RESET ('fillfactor') -- identifiers removed

parse
ALTER TABLE t RESET (fillfactor, autovacuum_enabled)
----
ALTER TABLE t RESET (fillfactor, autovacuum_enabled)
ALTER TABLE t RESET (fillfactor, autovacuum_enabled) -- fully parenthesized
ALTER TABLE t RESET (fillfactor, autovacuum_enabled) -- literals removed
ALTER TABLE _ RESET (_, _) -- identifiers removed
ALTER TABLE t RESET ('fillfactor', 'autovacuum_enabled') -- normalized!
ALTER TABLE t RESET ('fillfactor', 'autovacuum_enabled') -- fully parenthesized
ALTER TABLE t RESET ('fillfactor', 'autovacuum_enabled') -- literals removed
ALTER TABLE _ RESET ('fillfactor', 'autovacuum_enabled') -- identifiers removed

parse
ALTER TABLE t SET (exclude_data_from_backup = true)
ALTER TABLE t RESET (fillfactor, autovacuum_enabled, 'string')
----
ALTER TABLE t RESET ('fillfactor', 'autovacuum_enabled', 'string') -- normalized!
ALTER TABLE t RESET ('fillfactor', 'autovacuum_enabled', 'string') -- fully parenthesized
ALTER TABLE t RESET ('fillfactor', 'autovacuum_enabled', 'string') -- literals removed
ALTER TABLE _ RESET ('fillfactor', 'autovacuum_enabled', 'string') -- identifiers removed

parse
ALTER TABLE t SET (exclude_data_from_backup = true)
ALTER TABLE t SET (exclude_data_from_backup = (true)) -- fully parenthesized
ALTER TABLE t SET (exclude_data_from_backup = _) -- literals removed
ALTER TABLE _ SET (_ = true) -- identifiers removed
----
ALTER TABLE t SET ('exclude_data_from_backup' = true) -- normalized!
ALTER TABLE t SET ('exclude_data_from_backup' = (true)) -- fully parenthesized
ALTER TABLE t SET ('exclude_data_from_backup' = _) -- literals removed
ALTER TABLE _ SET ('exclude_data_from_backup' = true) -- identifiers removed

parse
ALTER TABLE t RESET (exclude_data_from_backup)
----
ALTER TABLE t RESET (exclude_data_from_backup)
ALTER TABLE t RESET (exclude_data_from_backup) -- fully parenthesized
ALTER TABLE t RESET (exclude_data_from_backup) -- literals removed
ALTER TABLE _ RESET (_) -- identifiers removed
ALTER TABLE t RESET ('exclude_data_from_backup') -- normalized!
ALTER TABLE t RESET ('exclude_data_from_backup') -- fully parenthesized
ALTER TABLE t RESET ('exclude_data_from_backup') -- literals removed
ALTER TABLE _ RESET ('exclude_data_from_backup') -- identifiers removed

error
ALTER PARTITION p OF TABLE tbl@idx CONFIGURE ZONE USING num_replicas = 1
Expand Down
24 changes: 12 additions & 12 deletions pkg/sql/parser/testdata/create_index
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ CREATE UNIQUE INVERTED INDEX _ ON _ (_) -- identifiers removed
parse
CREATE INDEX a ON b (c) WITH (fillfactor = 100, y_bounds = 50)
----
CREATE INDEX a ON b (c) WITH (fillfactor = 100, y_bounds = 50)
CREATE INDEX a ON b (c) WITH (fillfactor = (100), y_bounds = (50)) -- fully parenthesized
CREATE INDEX a ON b (c) WITH (fillfactor = _, y_bounds = _) -- literals removed
CREATE INDEX _ ON _ (_) WITH (_ = 100, _ = 50) -- identifiers removed
CREATE INDEX a ON b (c) WITH ('fillfactor' = 100, 'y_bounds' = 50) -- normalized!
CREATE INDEX a ON b (c) WITH ('fillfactor' = (100), 'y_bounds' = (50)) -- fully parenthesized
CREATE INDEX a ON b (c) WITH ('fillfactor' = _, 'y_bounds' = _) -- literals removed
CREATE INDEX _ ON _ (_) WITH ('fillfactor' = 100, 'y_bounds' = 50) -- identifiers removed

parse
CREATE INDEX ON a ((a + b))
Expand Down Expand Up @@ -416,10 +416,10 @@ CREATE INDEX ON _ ((ARRAY[_, _])) STORING (_, _) NOT VISIBLE -- identifiers remo
parse
CREATE INDEX a ON b (c) WITH (fillfactor = 100, y_bounds = 50) NOT VISIBLE
----
CREATE INDEX a ON b (c) WITH (fillfactor = 100, y_bounds = 50) NOT VISIBLE
CREATE INDEX a ON b (c) WITH (fillfactor = (100), y_bounds = (50)) NOT VISIBLE -- fully parenthesized
CREATE INDEX a ON b (c) WITH (fillfactor = _, y_bounds = _) NOT VISIBLE -- literals removed
CREATE INDEX _ ON _ (_) WITH (_ = 100, _ = 50) NOT VISIBLE -- identifiers removed
CREATE INDEX a ON b (c) WITH ('fillfactor' = 100, 'y_bounds' = 50) NOT VISIBLE -- normalized!
CREATE INDEX a ON b (c) WITH ('fillfactor' = (100), 'y_bounds' = (50)) NOT VISIBLE -- fully parenthesized
CREATE INDEX a ON b (c) WITH ('fillfactor' = _, 'y_bounds' = _) NOT VISIBLE -- literals removed
CREATE INDEX _ ON _ (_) WITH ('fillfactor' = 100, 'y_bounds' = 50) NOT VISIBLE -- identifiers removed

parse
CREATE UNIQUE INDEX idx ON a (((lower(a) || ' ') || lower(b))) NOT VISIBLE
Expand All @@ -440,10 +440,10 @@ CREATE INVERTED INDEX IF NOT EXISTS _ ON _ (_) WHERE _ > 3 -- identifiers remove
parse
CREATE INDEX geom_idx_2 ON some_spatial_table USING GIST(geom) WITH (s2_max_cells = 20, s2_max_level = 12, s2_level_mod = 3) NOT VISIBLE
----
CREATE INVERTED INDEX geom_idx_2 ON some_spatial_table (geom) WITH (s2_max_cells = 20, s2_max_level = 12, s2_level_mod = 3) NOT VISIBLE -- normalized!
CREATE INVERTED INDEX geom_idx_2 ON some_spatial_table (geom) WITH (s2_max_cells = (20), s2_max_level = (12), s2_level_mod = (3)) NOT VISIBLE -- fully parenthesized
CREATE INVERTED INDEX geom_idx_2 ON some_spatial_table (geom) WITH (s2_max_cells = _, s2_max_level = _, s2_level_mod = _) NOT VISIBLE -- literals removed
CREATE INVERTED INDEX _ ON _ (_) WITH (_ = 20, _ = 12, _ = 3) NOT VISIBLE -- identifiers removed
CREATE INVERTED INDEX geom_idx_2 ON some_spatial_table (geom) WITH ('s2_max_cells' = 20, 's2_max_level' = 12, 's2_level_mod' = 3) NOT VISIBLE -- normalized!
CREATE INVERTED INDEX geom_idx_2 ON some_spatial_table (geom) WITH ('s2_max_cells' = (20), 's2_max_level' = (12), 's2_level_mod' = (3)) NOT VISIBLE -- fully parenthesized
CREATE INVERTED INDEX geom_idx_2 ON some_spatial_table (geom) WITH ('s2_max_cells' = _, 's2_max_level' = _, 's2_level_mod' = _) NOT VISIBLE -- literals removed
CREATE INVERTED INDEX _ ON _ (_) WITH ('s2_max_cells' = 20, 's2_max_level' = 12, 's2_level_mod' = 3) NOT VISIBLE -- identifiers removed

parse
CREATE UNIQUE INDEX IF NOT EXISTS a ON b (c) WHERE d > 3 NOT VISIBLE
Expand Down
24 changes: 16 additions & 8 deletions pkg/sql/parser/testdata/create_table
Original file line number Diff line number Diff line change
Expand Up @@ -2065,10 +2065,18 @@ CREATE TABLE IF NOT EXISTS _ (_, _ FAMILY _) AS SELECT * FROM _ -- identifiers r
parse
CREATE TABLE a WITH (fillfactor=100) AS SELECT * FROM b
----
CREATE TABLE a WITH (fillfactor = 100) AS SELECT * FROM b -- normalized!
CREATE TABLE a WITH (fillfactor = (100)) AS SELECT (*) FROM b -- fully parenthesized
CREATE TABLE a WITH (fillfactor = _) AS SELECT * FROM b -- literals removed
CREATE TABLE _ WITH (_ = 100) AS SELECT * FROM _ -- identifiers removed
CREATE TABLE a WITH ('fillfactor' = 100) AS SELECT * FROM b -- normalized!
CREATE TABLE a WITH ('fillfactor' = (100)) AS SELECT (*) FROM b -- fully parenthesized
CREATE TABLE a WITH ('fillfactor' = _) AS SELECT * FROM b -- literals removed
CREATE TABLE _ WITH ('fillfactor' = 100) AS SELECT * FROM _ -- identifiers removed

parse
CREATE TABLE tbl (a INT) WITH ( 'string' = 'val' )
----
CREATE TABLE tbl (a INT8) WITH ('string' = 'val') -- normalized!
CREATE TABLE tbl (a INT8) WITH ('string' = ('val')) -- fully parenthesized
CREATE TABLE tbl (a INT8) WITH ('string' = '_') -- literals removed
CREATE TABLE _ (_ INT8) WITH ('string' = 'val') -- identifiers removed

error
CREATE TABLE test (
Expand Down Expand Up @@ -2215,10 +2223,10 @@ CREATE TABLE _ (_ INT4) LOCALITY REGIONAL BY ROW AS _ -- identifiers removed
parse
CREATE TABLE a (b INT) WITH (fillfactor=100)
----
CREATE TABLE a (b INT8) WITH (fillfactor = 100) -- normalized!
CREATE TABLE a (b INT8) WITH (fillfactor = (100)) -- fully parenthesized
CREATE TABLE a (b INT8) WITH (fillfactor = _) -- literals removed
CREATE TABLE _ (_ INT8) WITH (_ = 100) -- identifiers removed
CREATE TABLE a (b INT8) WITH ('fillfactor' = 100) -- normalized!
CREATE TABLE a (b INT8) WITH ('fillfactor' = (100)) -- fully parenthesized
CREATE TABLE a (b INT8) WITH ('fillfactor' = _) -- literals removed
CREATE TABLE _ (_ INT8) WITH ('fillfactor' = 100) -- identifiers removed

parse
CREATE TABLE arr_t (i STRING DEFAULT (('{' || 'a' || '}')::STRING[])[1]::STRING)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT NOT NULL);
/* test */
EXPLAIN (DDL) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count=3);
----
Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH (bucket_count = ‹3›);
Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH ('bucket_count' = ‹3›);
├── StatementPhase
│ └── Stage 1 of 1 in StatementPhase
│ ├── 9 elements transitioning toward PUBLIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT NOT NULL);
/* test */
EXPLAIN (DDL, SHAPE) ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count=3);
----
Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH (bucket_count = ‹3›);
Schema change plan for ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH ('bucket_count' = ‹3›);
├── execute 2 system table mutations transactions
├── backfill using primary index t_pkey- in relation t
│ └── into t_pkey+ (j, crdb_internal_j_shard_3+; i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ write *eventpb.AlterTable to event log:
mutationId: 1
sql:
descriptorId: 104
statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH (bucket_count = ‹3›)
statement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH ('bucket_count' = ‹3›)
tag: ALTER TABLE
user: root
tableName: defaultdb.public.t
Expand Down Expand Up @@ -157,8 +157,8 @@ upsert descriptor #104
+ name: t
+ relevantStatements:
+ - statement:
+ redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH (bucket_count = ‹3›)
+ statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count = 3)
+ redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH ('bucket_count' = ‹3›)
+ statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH ('bucket_count' = 3)
+ statementTag: ALTER TABLE
+ revertible: true
+ targetRanks: <redacted>
Expand Down Expand Up @@ -268,7 +268,7 @@ upsert descriptor #104
- version: "1"
+ version: "2"
persist all catalog changes to storage
create job #1 (non-cancelable: false): "ALTER TABLE defaultdb.public.t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count = 3)"
create job #1 (non-cancelable: false): "ALTER TABLE defaultdb.public.t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH ('bucket_count' = 3)"
descriptor IDs: [104]
# end PreCommitPhase
commit transaction #1
Expand Down Expand Up @@ -711,7 +711,7 @@ begin transaction #18
## PostCommitPhase stage 16 of 16 with 4 MutationType ops
upsert descriptor #104
...
statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count = 3)
statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH ('bucket_count' = 3)
statementTag: ALTER TABLE
- revertible: true
targetRanks: <redacted>
Expand Down Expand Up @@ -963,8 +963,8 @@ upsert descriptor #104
- name: t
- relevantStatements:
- - statement:
- redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH (bucket_count = ‹3›)
- statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count = 3)
- redactedStatement: ALTER TABLE ‹defaultdb›.‹public›.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH ('bucket_count' = ‹3›)
- statement: ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH ('bucket_count' = 3)
- statementTag: ALTER TABLE
- targetRanks: <redacted>
- targets: <redacted>
Expand Down Expand Up @@ -1023,7 +1023,7 @@ upsert descriptor #104
- version: "13"
+ version: "14"
persist all catalog changes to storage
create job #2 (non-cancelable: true): "GC for ALTER TABLE defaultdb.public.t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count = 3)"
create job #2 (non-cancelable: true): "GC for ALTER TABLE defaultdb.public.t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH ('bucket_count' = 3)"
descriptor IDs: [104]
update progress of schema change job #1: "all stages completed"
set schema change job #1 to non-cancellable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT NOT NULL);
ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count=3);
EXPLAIN (DDL) rollback at post-commit stage 10 of 16;
----
Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH (bucket_count = ‹3›);
Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH ('bucket_count' = ‹3›);
└── PostCommitNonRevertiblePhase
├── Stage 1 of 3 in PostCommitNonRevertiblePhase
│ ├── 2 elements transitioning toward PUBLIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT NOT NULL);
ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count=3);
EXPLAIN (DDL) rollback at post-commit stage 11 of 16;
----
Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH (bucket_count = ‹3›);
Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH ('bucket_count' = ‹3›);
└── PostCommitNonRevertiblePhase
├── Stage 1 of 3 in PostCommitNonRevertiblePhase
│ ├── 2 elements transitioning toward PUBLIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT NOT NULL);
ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count=3);
EXPLAIN (DDL) rollback at post-commit stage 12 of 16;
----
Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH (bucket_count = ‹3›);
Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH ('bucket_count' = ‹3›);
└── PostCommitNonRevertiblePhase
├── Stage 1 of 3 in PostCommitNonRevertiblePhase
│ ├── 2 elements transitioning toward PUBLIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT NOT NULL);
ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count=3);
EXPLAIN (DDL) rollback at post-commit stage 13 of 16;
----
Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH (bucket_count = ‹3›);
Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH ('bucket_count' = ‹3›);
└── PostCommitNonRevertiblePhase
├── Stage 1 of 3 in PostCommitNonRevertiblePhase
│ ├── 2 elements transitioning toward PUBLIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT NOT NULL);
ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count=3);
EXPLAIN (DDL) rollback at post-commit stage 14 of 16;
----
Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH (bucket_count = ‹3›);
Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH ('bucket_count' = ‹3›);
└── PostCommitNonRevertiblePhase
├── Stage 1 of 3 in PostCommitNonRevertiblePhase
│ ├── 2 elements transitioning toward PUBLIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CREATE TABLE t (i INT PRIMARY KEY, j INT NOT NULL);
ALTER TABLE t ALTER PRIMARY KEY USING COLUMNS (j) USING HASH WITH (bucket_count=3);
EXPLAIN (DDL) rollback at post-commit stage 15 of 16;
----
Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH (bucket_count = ‹3›);
Schema change plan for rolling back ALTER TABLE ‹defaultdb›.public.‹t› ALTER PRIMARY KEY USING COLUMNS (‹j›) USING HASH WITH ('bucket_count' = ‹3›);
└── PostCommitNonRevertiblePhase
├── Stage 1 of 3 in PostCommitNonRevertiblePhase
│ ├── 2 elements transitioning toward PUBLIC
Expand Down
Loading

0 comments on commit 2006510

Please sign in to comment.