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

"".crdb_internal.create_schema_statements only shows schemas from defaultdb #109770

Open
chrisseto opened this issue Aug 30, 2023 · 0 comments
Open
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@chrisseto
Copy link
Contributor

chrisseto commented Aug 30, 2023

Describe the problem

Appending "". to crdb_internal.create_schema_statements should cause it to show schemas across all databases. I would expect it to return an additional row for the public schema in the movr database. Instead, it only returns defaultdb.public when executed from the movr database.

demo@127.0.0.1:26257/movr> SELECT * FROM "".crdb_internal.create_schema_statements;
  database_id | database_name | schema_name | descriptor_id |   create_statement
--------------+---------------+-------------+---------------+-----------------------
          100 | defaultdb     | public      |           101 | CREATE SCHEMA public
(1 row)


Time: 11ms total (execution 11ms / network 0ms)

demo@127.0.0.1:26257/movr> SELECT * FROM crdb_internal.create_schema_statements;
  database_id | database_name | schema_name | descriptor_id |   create_statement
--------------+---------------+-------------+---------------+-----------------------
          104 | movr          | public      |           105 | CREATE SCHEMA public
(1 row)


Time: 4ms total (execution 4ms / network 1ms)

Additional schemas created within the movr database do not appear.
Additional schemas created within the defaultdb database do appear.

To Reproduce

  1. Run cockroach demo
  2. Execute SELECT * FROM "".crdb_internal.create_schema_statements
  3. Observe the returned rows

Environment:

  • CockroachDB version: v22.2.5, v23.2.0-alpha
  • Server OS: MacOS
  • Client app:cockroach sql

Jira issue: CRDB-31095

@chrisseto chrisseto added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
Development

No branches or pull requests

1 participant