Skip to content
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

[YSQL] Cannot DROP multiple tables or any database objects in one statements. #880

Open
nocaway opened this issue Feb 20, 2019 · 3 comments
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue

Comments

@nocaway
Copy link
Contributor

nocaway commented Feb 20, 2019

Jira Link: DB-1901
Test case:
$ CREATE TABLE tab1(i int);
$ CREATE TABLE tab2(i int);
$ DROP TABLE tab1, tab2;

After both tables are dropped, YSQL reported that data is corrupted.
F20190219 23:59:39 smgr.c:312] NEIL: SMgrRelation hashtable corrupted
@ 0x7f16b4d5e064 yb::LogFatalHandlerSink::send(int, char const*, char const*, int, tm const*, char const*, unsigned long) (src/yb/util/logging.cc:474)
@ 0x7f16b17703e5
@ 0x7f16b176dad9
@ 0x7f16b176dd10
@ 0x7f16b4e45f65 YBCLogImpl (src/yb/util/ybc_util.cc:133)
@ 0x8bacac smgrclose (postgres/src/backend/storage/smgr/smgr.c:312)
@ 0x5c44d9 smgrDoPendingDeletes (postgres/src/backend/catalog/storage.c:365)
@ 0x5556ab CommitTransaction (postgres/src/backend/access/transam/xact.c:2133)
@ 0x556330 YBCCommitTransactionAndUpdateBlockState (postgres/src/backend/access/transam/xact.c:2776)
@ 0x5563f7 CommitTransactionCommand (postgres/src/backend/access/transam/xact.c:2813)
@ 0x8c0241 finish_xact_command (postgres/src/backend/tcop/postgres.c:2456)
@ 0x8bddd9 exec_simple_query (postgres/src/backend/tcop/postgres.c:1128)
@ 0x8c2633 PostgresMain (postgres/src/backend/tcop/postgres.c:4114)
@ 0x81e1b6 BackendRun (postgres/src/backend/postmaster/postmaster.c:4438)
@ 0x81d88a BackendStartup (postgres/src/backend/postmaster/postmaster.c:4104)
@ 0x819ac2 ServerLoop (postgres/src/backend/postmaster/postmaster.c:1769)
@ 0x81900b PostmasterMain (postgres/src/backend/postmaster/postmaster.c:1367)
@ 0x750f3d PostgresServerProcessMain (postgres/src/backend/main/main.c:234)
@ 0x75128b
@ 0x7f16b3d72824 __libc_start_main (csu/libc-start.c:289)
@ 0x485e68 (unknown) (sysdeps/x86_64/start.S:118)
@ 0xffffffffffffffff

@nocaway nocaway added the kind/bug This issue is a bug label Feb 20, 2019
yugabyte-ci pushed a commit that referenced this issue Feb 28, 2019
Summary:
- Enabled pg_depend
- Fixed DROP VIEW (it was previously throwing an error)
- Correctly throw an error when we try to DROP a table that another object depends on (like a VIEW).
- Fixes DROP TABLE statement with multiple tables (ENG 4708 - #880)
- Drop the indexes of a table when we drop the table.

Test Plan: Run PgRegress tests

Reviewers: robert, mihnea

Reviewed By: mihnea

Subscribers: kannan, yql

Differential Revision: https://phabricator.dev.yugabyte.com/D6212
@nocaway nocaway changed the title [YSQL] Cannot DROP multiple tables in one statements. [YSQL] Cannot DROP multiple tables or any database objects in one statements. Apr 4, 2019
nspiegelberg added a commit that referenced this issue Aug 9, 2019
Summary:
#852 added support for pg_depend, which allows us to handle dependencies between multiple
commands.  This means we can now enable DROP TABLE for multiple entries.  This is needed to support
pgbench.

Test Plan:
./yb_build.sh --java-test org.yb.pgsql.TestPgRegressTable
./yb_build.sh --java-test org.yb.pgsql.TestPgRegressTypesString

Reviewers: bogdan, neil

Reviewed By: neil

Subscribers: jason, mikhail, neha, yql

Differential Revision: https://phabricator.dev.yugabyte.com/D7025
@jaki
Copy link
Contributor

jaki commented Sep 17, 2019

Should be closed by commit 2d76c83.

@jaki
Copy link
Contributor

jaki commented Jun 4, 2021

This is only done for DROP TABLE but not others like DROP INDEX, DROP SEQUENCE, DROP VIEW, etc. I'll reopen this, but I think that separate issues should be created for each kind of object. Note that the code still references this issue in the error message for DROP multiple object other than table.

@jaki jaki reopened this Jun 4, 2021
@m-iancu m-iancu added this to YQL-beta Nov 30, 2021
@m-iancu m-iancu assigned m-iancu and unassigned mbautin and m-iancu Mar 7, 2022
@m-iancu m-iancu added the area/ysql Yugabyte SQL (YSQL) label Mar 7, 2022
@yugabyte-ci yugabyte-ci added the priority/medium Medium priority issue label Jun 9, 2022
@yugabyte-ci yugabyte-ci added kind/enhancement This is an enhancement of an existing feature and removed kind/bug This issue is a bug labels Oct 5, 2022
@SebastianJames55
Copy link

I came here from yugabyte cloud shell when I tried to drop multiple sequences.
drop multiple sequences failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Projects
Status: No status
Development

No branches or pull requests

6 participants