Skip to content

Commit 9fa4a6b

Browse files
craig[bot]rafiss
andcommitted
Merge #145567
145567: scbuildstmt: remove fallback for DROP DATABASE with MR system database r=rafiss a=rafiss This fallback was only needed before we implemeted the region liveness changes. Epic: None Release note: None Co-authored-by: Rafi Shamim <[email protected]>
2 parents da95cf7 + 4b84398 commit 9fa4a6b

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

pkg/bench/rttanalysis/testdata/benchmark_expectations

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ exp,benchmark
3535
14,"Discard/DISCARD_ALL,_1_tables_in_1_db"
3636
19,"Discard/DISCARD_ALL,_2_tables_in_2_dbs"
3737
0,"Discard/DISCARD_ALL,_no_tables"
38-
17,DropDatabase/drop_database_0_tables
39-
18,DropDatabase/drop_database_1_table
40-
18,DropDatabase/drop_database_2_tables
41-
18,DropDatabase/drop_database_3_tables
38+
15,DropDatabase/drop_database_0_tables
39+
16,DropDatabase/drop_database_1_table
40+
16,DropDatabase/drop_database_2_tables
41+
16,DropDatabase/drop_database_3_tables
4242
29-30,DropRole/drop_1_role
4343
37,DropRole/drop_2_roles
4444
45-49,DropRole/drop_3_roles

pkg/sql/schemachanger/scbuild/internal/scbuildstmt/drop_database.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,16 @@
66
package scbuildstmt
77

88
import (
9-
"github.com/cockroachdb/cockroach/pkg/keys"
109
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode"
1110
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror"
1211
"github.com/cockroachdb/cockroach/pkg/sql/privilege"
13-
"github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scerrors"
1412
"github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scpb"
1513
"github.com/cockroachdb/cockroach/pkg/sql/sem/catid"
1614
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree"
1715
)
1816

1917
// DropDatabase implements DROP DATABASE.
2018
func DropDatabase(b BuildCtx, n *tree.DropDatabase) {
21-
fallBackIfMRSystemDatabase(b, n)
22-
2319
elts := b.ResolveDatabase(n.Name, ResolveParams{
2420
IsExistenceOptional: n.IfExists,
2521
RequiredPrivilege: privilege.DROP,
@@ -67,11 +63,3 @@ func DropDatabase(b BuildCtx, n *tree.DropDatabase) {
6763
panic(pgerror.DangerousStatementf(
6864
"DROP DATABASE on non-empty database without explicit CASCADE"))
6965
}
70-
71-
func fallBackIfMRSystemDatabase(b BuildCtx, t *tree.DropDatabase) {
72-
// TODO(jeffswenson): delete once region_livess is implemented (#107966)
73-
_, _, dbRegionConfig := scpb.FindDatabaseRegionConfig(b.QueryByID(keys.SystemDatabaseID))
74-
if dbRegionConfig != nil {
75-
panic(scerrors.NotImplementedErrorf(t, "drop database not implemented when the system database is multi-region"))
76-
}
77-
}

0 commit comments

Comments
 (0)