-
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: add unimplemented support for drop type
This PR adds unimplemented support for the DROP TYPE command, as well as adding some missing help/annotations for the CREATE TYPE command. Release note: None
- Loading branch information
Showing
13 changed files
with
178 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ drop_stmt ::= | |
| drop_table_stmt | ||
| drop_view_stmt | ||
| drop_sequence_stmt | ||
| drop_type_stmt | ||
| drop_role_stmt |
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 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 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,41 @@ | ||
// Copyright 2020 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 sql | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree" | ||
"github.com/cockroachdb/cockroach/pkg/util/errorutil/unimplemented" | ||
"github.com/cockroachdb/errors" | ||
) | ||
|
||
type dropTypeNode struct { | ||
n *tree.DropType | ||
} | ||
|
||
// Use to satisfy the linter. | ||
var _ planNode = &dropTypeNode{n: nil} | ||
|
||
func (p *planner) DropType(ctx context.Context, n *tree.DropType) (planNode, error) { | ||
return nil, unimplemented.NewWithIssue(27793, "DROP TYPE") | ||
} | ||
|
||
func (n *dropTypeNode) startExec(params runParams) error { | ||
return errors.AssertionFailedf( | ||
"should not be calling startExec on DROP TYPE node", | ||
) | ||
} | ||
|
||
func (n *dropTypeNode) Next(params runParams) (bool, error) { return false, nil } | ||
func (n *dropTypeNode) Values() tree.Datums { return tree.Datums{} } | ||
func (n *dropTypeNode) Close(ctx context.Context) {} | ||
func (n *dropTypeNode) ReadingOwnWrites() {} |
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
statement error pq: unimplemented: CREATE TYPE | ||
CREATE TYPE mytype AS ENUM ('val1', 'val2') | ||
|
||
statement error pq: unimplemented: DROP TYPE | ||
DROP TYPE mytype | ||
|
||
statement error pq: unimplemented: DROP TYPE | ||
DROP TYPE IF EXISTS mytype |
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 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 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 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 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 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
Oops, something went wrong.