8000 sql: v20.2 - information_schema.tables index on table_name only includes tables in the current search_path · Issue #55437 · cockroachdb/cockroach · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
sql: v20.2 - information_schema.tables index on table_name only includes tables in the current search_path #55437
Closed
@alex-berger

Description

@alex-berger

Describe the problem

This bug affects CockroachDB version v20.2.0-beta.*.

When querying information_schema.tables for a specific table which resides in a custom schema (not in public) the
string equality operator (=) does not work as expected on the table_name column. As a workaround one can use the
like operator with a wildcard (%...%) pattern which seems to work as expected.

To Reproduce

Spin up a CockroachDB cluster e.g. using docker run --rm -it -p 26257:26257 cockroachdb/cockroach:latest-v20.2 start-single-node --insecure and apply the following SQL statements.

create schema nx;

create table nx.yy(a int);

select * from information_schema.tables where table_schema = 'nx' and table_name = 'yy'; 
--> unexpected empty result !!!

select * from information_schema.tables where table_name = 'yy'; 
--> unexpected empty result !!!

select * from information_schema.tables where table_schema = 'nx' and table_name like '%yy%' and length(table_name) = length('yy'); 
--> expected result with one row

Environment:

  • CockroachDB version v20.2.0-beta.*

Metadata

Metadata

Assignees

Labels

A-sql-vtablesVirtual tables - pg_catalog, information_schema etcC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.O-communityOriginated from the communityX-blathers-triagedblathers was able to find an ownerrelease-blockerIndicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0