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 FULL FIELDS does not work when keyspace/database name is included #6464

Closed
artemvovk opened this issue Jul 22, 2020 · 1 comment
Closed
Assignees

Comments

@artemvovk
Copy link

Overview of the Issue

When executing SHOW FULL FIELDS command that includes database/keyspace name, Vitess seems to look treat the keyspace.table as the table name, which leads to the command failing. The same query runs successfully on a raw MySQL instance.

Reproduction Steps

Steps to reproduce this issue, example:

  1. Deploy the following vschema:

    { "a": {
      "sharded": false,
      "vindexes": {
        "hash": {
          "type": "hash"
        },
      "tables": {
        "table1": {
          "column_vindexes": [
            {
              "column": "user_id",
              "name": "hash"
            }
          ]
        }
      } }, 
      "b": {
      "sharded": false,
      "vindexes": {
        "hash": {
          "type": "hash"
        },
      "tables": {
        "table2": {
          "column_vindexes": [
            {
              "column": "user_id",
              "name": "hash"
            }
          ]
        }
      } }, 
    }
  2. Deploy the following schema:

    create database `a`;
    create table `a`.`table1`(user_id bigint, name varchar(128), primary key(user_id));
    create database `b`;
    create table `b`.`table2`(user_id bigint, name varchar(128), primary key(user_id));
  3. Run

SHOW FULL FIELDS FROM `a`.`table1`;
  1. View error
Mysql2::Error: vtgate: http://9be878f72d30:8080/: target: a.-.master, used tablet: test-101 (vttablet-db-test): vttablet: rpc error: code = NotFound desc = Table 'a.table1' doesn't exist (errno 1146) (sqlstate 42S02) (CallerID: userData1): Sql: "SHOW FULL FIELDS FROM `a`.`table1`", BindVars: {}: SHOW FULL FIELDS FROM `a`.`table1`

Binary version

Example:

Version: b6c7ffcbd (Git branch 'master') built on Tue Jul 14 02:09:57 UTC 2020 by root@f3fe282ca2eb using go1.13.9 linux/amd64

Operating system and Environment details

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

  • Operating system (output of cat /etc/os-release): MacOS - Docker
  • Kernel version (output of uname -sr): Linux 4.19.76-linuxkit
  • Architecture (output of uname -m): x86_64

Log Fragments

Include appropriate log fragments. If the log is longer than a few dozen lines, please
include the URL to the gist of the log instead of posting it in the issue.

VtTablet logs:

Execute	172.24.0.16:54050:/queryservice.Query/Execute(gRPC)	gRPC	'userData1'	'artemavovk'	2020-07-21 20:38:37.180407	2020-07-21 20:38:37.181651	0.001244	OtherRead	"SHOW FULL FIELDS FROM `a`.`table1`"	map[]	1	"SHOW FULL FIELDS FROM `a`.`table1`"	mysql	0.000839	0.000015	0	0	"Table 'a.table1' doesn't exist (errno 1146) (sqlstate 42S02) (CallerID: userData1): Sql: \"SHOW FULL FIELDS FROM `a`.`table1`\", BindVars: {}"	

VtGate logs:

Execute	172.24.0.1:34518	artemavovk	'userData1'	'artemavovk'	2020-07-21 20:34:49.301841	2020-07-21 20:34:49.347320	0.045406	0.000000	0.045302	0.000000	SHOW	"SHOW FULL FIELDS FROM `a`.`table1`"	map[]	1	0	"target: c.-.master, used tablet: test-201 (vttablet-c): vttablet: rpc error: code = NotFound desc = Table 'a.table1' doesn't exist (errno 1146) (sqlstate 42S02) (CallerID: userData1): Sql: \"SHOW FULL FIELDS FROM `a`.`table1`\", BindVars: {}"	"c"	""	"MASTER"	
@harshit-gangal harshit-gangal self-assigned this Nov 4, 2020
@harshit-gangal
Copy link
Member

Supported via #6825

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

2 participants