Closed hand-crdb closed 1 year ago
We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!
Describe the problem
After executing extensive DDL from a file via the \i command in
cockroach sql
, theUSE
statement does not work.I reproduced this on both my laptop (Mac) and GCE.
To Reproduce
Set up laptop 3-node insecure cluster per doc at https://www.cockroachlabs.com/docs/stable/start-a-local-cluster.html
Establish a session with client
$ cockroach sql --insecure
USE
thedefaultdb
database.USE
it.I can create the above database and create a table within it, but I cannot set it to be my current database via
USE
. I can reference the table in the database with a qualified name.A different session connecting to the same database server at this same time CAN successfully set both
defaultdb
andsth
to be the current database, viaUSE
. Just the session on which I did all the DDL seems to be affected.Expected behavior
The
USE
statement should let me change the current database.Additional data / screenshots
The DDL I executed via the .sql file is private. I can provide it offline.
I can also provide client shell logs (both from MacOS and from GCP).
I also captured debug.zip on both MacOS and GCP.
The session parameters are all defaults except for the database:
Environment:
cockroach sql
Additional context What was the impact?
I could not fully use the session after
USE
stopped working. I had to qualify table references with the database name. This was not a big deal in itself but it may point to a more serious issue. I don't know whether this is a client issue or a server issue.Jira issue: CRDB-9039