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

SHOW CREATE ALL TYPES doesn't work with comment on #126005

Closed
Dedej-Bergin opened this issue Jun 21, 2024 · 1 comment · Fixed by #128084
Closed

SHOW CREATE ALL TYPES doesn't work with comment on #126005

Dedej-Bergin opened this issue Jun 21, 2024 · 1 comment · Fixed by #128084
Assignees
Labels
branch-master Failures and bugs on the master branch. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@Dedej-Bergin
Copy link
Contributor

Dedej-Bergin commented Jun 21, 2024

To Reproduce

[email protected]:26257/demoapp/movr> create type roaches AS ENUM('papa_roach','mama_roach','baby_roach');                                                                                                                                            
CREATE TYPE

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

[email protected]:26257/demoapp/movr> show create all types;                                                                                                                                                                                          
                                 create_statement
----------------------------------------------------------------------------------
  CREATE TYPE public.roaches AS ENUM ('papa_roach', 'mama_roach', 'baby_roach');
(1 row)

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

[email protected]:26257/demoapp/movr> comment on type roaches is 'test comment';                                                                                                                                                                      
COMMENT ON TYPE

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

[email protected]:26257/demoapp/movr> show create all types;                                                                                                                                                                                          
                                 create_statement
----------------------------------------------------------------------------------
  CREATE TYPE public.roaches AS ENUM ('papa_roach', 'mama_roach', 'baby_roach');
(1 row)

// comment on should be visible but it's not

Expected behavior

show create all tables;  // This is what we want our type output to look like  
CREATE TABLE public.roach_table (
      legs INT8 NULL,
      rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(),
      CONSTRAINT roach_table_pkey PRIMARY KEY (rowid ASC)
  );
  COMMENT ON TABLE public.roach_table IS 'test-comment';

Jira issue: CRDB-39720

Jira issue: CRDB-40713

@Dedej-Bergin Dedej-Bergin added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Jun 21, 2024
@Dedej-Bergin Dedej-Bergin self-assigned this Jun 21, 2024
Copy link

blathers-crl bot commented Jun 21, 2024

Hi @Dedej-Bergin, please add branch-* labels to identify which branch(es) this C-bug affects.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@Dedej-Bergin Dedej-Bergin added the branch-master Failures and bugs on the master branch. label Jul 15, 2024
Dedej-Bergin added a commit to Dedej-Bergin/cockroach that referenced this issue Aug 1, 2024
There was a bug where comments did not show up in the
output of the show create all types command.
The issue was that we did not have any
code to get the comment and add it to the
create type descriptor. I added these changes and
also did a bit of cleanup/removed duplicate code
in the process.

Fixes: cockroachdb#126005

Release note (bug fix): SHOW CREATE ALL TYPES now shows
corresponding type comments in it's output.
Dedej-Bergin added a commit to Dedej-Bergin/cockroach that referenced this issue Aug 12, 2024
There was a bug where comments did not show up in the
output of the show create all types command.
The issue was that we did not have any
code to get the comment and add it to the
create type descriptor. I added these changes and
also did a bit of cleanup/removed duplicate code
in the process.

Fixes: cockroachdb#126005

Release note (bug fix): SHOW CREATE ALL TYPES now shows
corresponding type comments in it's output.
craig bot pushed a commit that referenced this issue Aug 12, 2024
128084: sql: SHOW CREATE ALL TYPES doesn't work with comment on r=Dedej-Bergin a=Dedej-Bergin

There was a bug where comments did not show up in the output of the show create all types command.
The issue was that we did not have any
code to get the comment and add it to the
create type descriptor. I added these changes and
also did a bit of cleanup/removed duplicate code
in the process.

Fixes: #126005

Release note (bug fix): SHOW CREATE ALL TYPES now shows corresponding type comments in it's output.

128715: telemetry: remove expectation of no force-custom counter r=mgartner,kyle-a-wong a=dhartunian

This test flakes in cases where we run a query and expect the `sql.plan.type.force-custom` to not get incremented. This can't be guaranteed as this is the default counter and it occasionally gets bumped by background operations.

There's no easy way to prevent these from happening so these cases are removed from this suite.

Resolves: #128523, #128640
Epic: None

Release note: None

Co-authored-by: Bergin Dedej <[email protected]>
Co-authored-by: David Hartunian <[email protected]>
@craig craig bot closed this as completed in 175a9db Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-master Failures and bugs on the master branch. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant