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

sql: SHOW PARTITIONS FROM TABLE doesn't work across databases #40448

Closed
solongordon opened this issue Sep 3, 2019 · 1 comment · Fixed by #40450
Closed

sql: SHOW PARTITIONS FROM TABLE doesn't work across databases #40448

solongordon opened this issue Sep 3, 2019 · 1 comment · Fixed by #40450
Assignees
Labels
A-partitioning C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-ux-surprise Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.

Comments

@solongordon
Copy link
Contributor

SHOW PARTITIONS FROM TABLE doesn't appear to work unless the table's database is the currently used database.

root@127.0.0.1:61370/movr> create database d;
CREATE DATABASE

root@127.0.0.1:61370/movr> create table d.t (x int primary key) partition by list (x) (partition p values
in (1));
CREATE TABLE

root@127.0.0.1:61370/movr> show partitions from table d.t;
  database_name | table_name | partition_name | parent_partition | column_names | index_name | partition_value | zone_config
+---------------+------------+----------------+------------------+--------------+------------+-----------------+-------------+
(0 rows)

root@127.0.0.1:61370/movr> use d;
SET

root@127.0.0.1:61370/d> show partitions from table d.t;
  database_name | table_name | partition_name | parent_partition | column_names | index_name | partition_value | zone_config
+---------------+------------+----------------+------------------+--------------+------------+-----------------+-------------+
  d             | t          | p              | NULL             | x            | t@primary  | (1)             | NULL
(1 row)
@solongordon solongordon added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-ux-surprise Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption. A-partitioning labels Sep 3, 2019
@awoods187
Copy link
Contributor

good find! we should fix this for 19.2 to make sure it's usable for customers

rohany added a commit to rohany/cockroach that referenced this issue Sep 4, 2019
show partitions did not work correctly when the database the object
was within was not the current database. This PR updates show partitions
to fix this and adds regression tests.

Fixes cockroachdb#40448.

Release note: None
rohany added a commit to rohany/cockroach that referenced this issue Sep 5, 2019
…tabase

show partitions and show ranges did not work correctly when the database
the object was within was not the current database. This PR updates show
partitions and show ranges to fix this and adds regression tests.

Fixes cockroachdb#40448.

Release note: None
craig bot pushed a commit that referenced this issue Sep 10, 2019
40450: sql: Fixing show partitions and show ranges to work on not current database r=rohany a=rohany

show partitions and show ranges did not work correctly when the database
the object was within was not the current database. This PR updates show
partitions and show ranges to fix this and adds regression tests.

Fixes #40448.

Release note: None

Co-authored-by: Rohan Yadav <rohany@alumni.cmu.edu>
@craig craig bot closed this as completed in 7af579c Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-partitioning C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. S-3-ux-surprise Issue leaves users wondering whether CRDB is behaving properly. Likely to hurt reputation/adoption.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants