-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: refactor unimplemented statements into one file pkg/sql/unimplem…
…ented.go Moved files with unimplemented stubs into just 1 file unimplemented.go. These unimplemented stubs work in DSC only and we will not implement them on the legacy schema changer. Fixes: #45671 Release note: none
- Loading branch information
Bergin Dedej
committed
Dec 19, 2024
1 parent
b181396
commit 613db3e
Showing
8 changed files
with
56 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright 2024 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the CockroachDB Software License | ||
// included in the /LICENSE file. | ||
|
||
package sql | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode" | ||
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" | ||
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree" | ||
) | ||
|
||
// The below methods are ordered in alphabetical order. They represent statements | ||
// which are UNIMPLEMENTED for the legacy schema changer. | ||
|
||
func (p *planner) AlterPolicy(ctx context.Context, n *tree.AlterPolicy) (planNode, error) { | ||
return nil, pgerror.New(pgcode.FeatureNotSupported, | ||
"ALTER POLICY is only implemented in the declarative schema changer") | ||
} | ||
|
||
func (p *planner) CommentOnType(ctx context.Context, n *tree.CommentOnType) (planNode, error) { | ||
return nil, pgerror.New(pgcode.FeatureNotSupported, | ||
"COMMENT ON TYPE is only implemented in the declarative schema changer") | ||
} | ||
|
||
func (p *planner) CreatePolicy(ctx context.Context, n *tree.CreatePolicy) (planNode, error) { | ||
return nil, pgerror.New(pgcode.FeatureNotSupported, | ||
"CREATE POLICY is only implemented in the declarative schema changer") | ||
} | ||
|
||
func (p *planner) DropOwnedBy(ctx context.Context) (planNode, error) { | ||
if err := checkSchemaChangeEnabled( | ||
ctx, | ||
p.ExecCfg(), | ||
"DROP OWNED BY", | ||
); err != nil { | ||
return nil, err | ||
} | ||
|
||
return nil, pgerror.New(pgcode.FeatureNotSupported, | ||
"DROP OWNED BY is only implemented in the declarative schema changer") | ||
} | ||
|
||
func (p *planner) DropPolicy(ctx context.Context, n *tree.DropPolicy) (planNode, error) { | ||
return nil, pgerror.New(pgcode.FeatureNotSupported, | ||
"DROP POLICY is only implemented in the declarative schema changer") | ||
} | ||
|
||
func (p *planner) DropTrigger(_ context.Context, _ *tree.DropTrigger) (planNode, error) { | ||
return nil, pgerror.New(pgcode.FeatureNotSupported, | ||
"DROP TRIGGER is only implemented in the declarative schema changer") | ||
} |