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

Add support for SHOW DATABASES LIKE #6315

Closed
ajm188 opened this issue Jun 15, 2020 · 2 comments
Closed

Add support for SHOW DATABASES LIKE #6315

ajm188 opened this issue Jun 15, 2020 · 2 comments

Comments

@ajm188
Copy link
Contributor

ajm188 commented Jun 15, 2020

Overview of the Issue

When connected to a vtgate, running SHOW DATABASES shows all keyspaces the vtgate knows about. However when using SHOW DATABASES LIKE '%some_pattern%' the pattern is ignored completely, and the vtgate shows all keyspaces.

Reproduction Steps

Steps to reproduce this issue, example:

  1. Create two keyspaces foo and bar
  2. Run SHOW DATABASES LIKE 'foo'
  3. View:
+----------------+
| Databases      |
+----------------+
| bar            |
| foo            |
+----------------+

Binary version

amason@workspace:~% vtgate --version
Version: 7200712c6 (Git branch 'HEAD') built on Wed May 13 09:48:15 PDT 2020 by amason@workspace using go1.14.2 linux/amd64

Operating system and Environment details

OS, Architecture, and any other information you can provide
about the environment.

amason@workspace:~% cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.6 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.6 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
amason@workspace:~% uname -r
4.4.0-1105-aws
amason@workspace:~% uname -m
x86_64
@klkyy2020
Copy link
Contributor

database in vitess means keyspace
show database command is same as show vitess_keyspace
maybe we can add a table named keyspace in _vt database in mysql, and change show databases like 'foo' to select * from _vt.keyspace where Database like 'foo';

@harshit-gangal
Copy link
Member

Closed via #6750

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants