-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: SHOW TABLES marks a dropped table with a " (dropped)" suffix #10063
Conversation
hm, how do we feel about |
I wonder if we should just change desc.Name in-place when we flip the Deleted bit, so all the paths read the same thing |
I'm not familiar with what you're talking about. What's broken here? |
in addition to |
I'd recommend linking this with #9966. |
LGTM this looks to me like a quick fix for something that has come up many times. Whether or not the table should appear in information schema is a valid question; I'd say leave it alone there, since we probably shouldn't be massaging names like we're doing in the |
|
||
// Check that SHOW TABLES marks a deleted table with the " (deleted)" | ||
// suffix. | ||
rows, err := t.db.Query(`SHOW TABLES FROM test`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defer rows.Close()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -401,7 +401,8 @@ func TestLeaseManagerPublishVersionChanged(testingT *testing.T) { | |||
t.expectLeases(descID, "/3/1") | |||
} | |||
|
|||
// Test that we fail to lease a table that was marked for deletion. | |||
// Test that we fail to lease a table that was marked for deletion. This also | |||
// tests that SHOW TABLES marks a deleted table with the " (deleted)" suffix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be more natural for this to be a test on SHOW TABLES
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Moved to drop_test.go as way for us to test a variety of operations while a table is being dropped.
131deae
to
973b2f8
Compare
0094377
to
8651da9
Compare
Change the error message when a DROP TABLE tried to drop a table that has already been dropped. Added tests for error messages observed with CREATE and DROP commands while a table is being dropped. fixes cockroachdb#9318
8651da9
to
781687b
Compare
Any thoughts on this PR? |
Still LGTM as far as I'm concerned. Review status: 0 of 9 files reviewed at latest revision, 3 unresolved discussions, all commit checks successful. pkg/sql/drop_test.go, line 502 at r2 (raw file):
can't this be a string? Comments from Reviewable |
781687b
to
cbb636d
Compare
The dropped versus deleted incompatibility was driving me crazy! Review status: 0 of 9 files reviewed at latest revision, 3 unresolved discussions, some commit checks pending. pkg/sql/drop_test.go, line 502 at r2 (raw file):
|
Review status: 0 of 9 files reviewed at latest revision, 3 unresolved discussions, all commit checks successful. pkg/sql/drop_test.go, line 502 at r2 (raw file):
|
Reviewed 9 of 9 files at r3. pkg/sql/drop_test.go, line 470 at r3 (raw file):
FYI: this can be written as pkg/sql/show.go, line 668 at r3 (raw file):
NYC but a function called Comments from Reviewable |
…nation raft: fix correctness bug in CommittedEntries pagination
fixes #9318
Added another commit that renames table deleted to table dropped for #9493
This change is