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 CREATE TABLE incorrectly shows an opclass for non-inverted prefix columns of trigram index #86614

Closed
mgartner opened this issue Aug 22, 2022 · 0 comments · Fixed by #87206
Assignees
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. O-qa T-sql-queries SQL Queries Team
Projects

Comments

@mgartner
Copy link
Collaborator

mgartner commented Aug 22, 2022

Notice how the first column in the secondary index has an opclass below. That is incorrect.

defaultdb> CREATE TABLE t (a INT, s STRING, INVERTED INDEX (a, s gist_trgm_ops));
CREATE TABLE

defaultdb> SHOW CREATE TABLE t;
  table_name |                         create_statement
-------------+--------------------------------------------------------------------
  t          | CREATE TABLE public.t (
             |     a INT8 NULL,
             |     s STRING NULL,
             |     rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(),
             |     CONSTRAINT t_pkey PRIMARY KEY (rowid ASC),
             |     INVERTED INDEX t_a_s_idx (a gin_trgm_ops ASC, s gin_trgm_ops)
             | )
(1 row)

Related to #84512.

Jira issue: CRDB-18839

@mgartner mgartner added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Aug 22, 2022
@mgartner mgartner added this to Triage in SQL Queries via automation Aug 22, 2022
@blathers-crl blathers-crl bot added the T-sql-queries SQL Queries Team label Aug 22, 2022
@mgartner mgartner added the O-qa label Aug 23, 2022
@mgartner mgartner changed the title sql: SHOW CREATE TABLE incorrect shows an opclass for non-inverted prefix columns of trigram index sql: SHOW CREATE TABLE incorrectly shows an opclass for non-inverted prefix columns of trigram index Aug 23, 2022
@rytaft rytaft moved this from Triage to Up Next in SQL Queries Aug 23, 2022
@mgartner mgartner moved this from Up Next to Active in SQL Queries Aug 31, 2022
mgartner added a commit to mgartner/cockroach that referenced this issue Aug 31, 2022
Fixes cockroachdb#86614

Release justification: This is a minor bug fix for a new feature.

Release note: None
mgartner added a commit to mgartner/cockroach that referenced this issue Sep 1, 2022
Fixes cockroachdb#86614

Release justification: This is a minor bug fix for a new feature.

Release note: None
craig bot pushed a commit that referenced this issue Sep 13, 2022
87206: sql: minor fixes for opclasses in trigram indexes r=mgartner a=mgartner

#### sql: err when an opclass is provided for a non-inverted index column

Fixes #84512

Release justification: This is a minor fix for new features.

Release note: None

#### sql: do not show opclasses for non-inverted index columns

Fixes #86614

Release justification: This is a minor bug fix for a new feature.

Release note: None


Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com>
@craig craig bot closed this as completed in 756db9e Sep 13, 2022
SQL Queries automation moved this from Active to Done Sep 13, 2022
blathers-crl bot pushed a commit that referenced this issue Sep 13, 2022
Fixes #86614

Release justification: This is a minor bug fix for a new feature.

Release note: None
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. O-qa T-sql-queries SQL Queries Team
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant