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

create database is not behaving normally #2529

Closed
cloudcarver opened this issue May 15, 2022 · 2 comments
Closed

create database is not behaving normally #2529

cloudcarver opened this issue May 15, 2022 · 2 comments
Labels
help wanted Issues that need help from contributors type/bug Something isn't working

Comments

@cloudcarver
Copy link
Contributor

Describe the bug

  1. Drop database is not working.
  2. A table in a database should be invisible to the other database.

To Reproduce

psql -h localhost -p 4566
  1. create a database
mike=> create database test;
  1. switch to the new database
mike=> \c test
test=>
  1. drop database (bug 1: this database is dropped. but we can still use this database)
test=> drop database test;
DROP_DATABASE
test=> drop database test;
ERROR: Catalog error: database not found: test
  1. create a datababse
test=> \c mike
psql (14.2, server 0.0.0)
You are now connected to database "mike" as user "mike".
mike=> create table t ();
  1. switch to the database already dropped. (bug 1: we've already dropped this database before, but we can still switch to it)
mike=>\c test
psql (14.2, server 0.0.0)
You are now connected to database "test" as user "mike".
test=> 
  1. show tables. (bug 2: table t is created in database mike, but it is visible in database test)
test=> show tables;
 Name 
------
 t
(1 row)

Expected behavior

  1. Tables should be invisible to the other database
  2. Dropped database should be dropped.

Additional context
Add any other context about the problem here.

@cloudcarver cloudcarver added type/bug Something isn't working bug bash labels May 15, 2022
@likzn
Copy link
Contributor

likzn commented May 15, 2022

Is below code the reason of it? Because we all use mock connection now so the operations are all in the same database.
https://github.com/singularity-data/risingwave/blob/fb519e5d47c4a6481cd91f49454dd403847104dd/src/utils/pgwire/src/pg_protocol.rs#L114-L126

@cloudcarver
Copy link
Contributor Author

Is below code the reason of it? Because we all use mock connection now so the operations are all in the same database.

https://github.com/singularity-data/risingwave/blob/fb519e5d47c4a6481cd91f49454dd403847104dd/src/utils/pgwire/src/pg_protocol.rs#L114-L126

oh, make sense. This explains everything :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues that need help from contributors type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants