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

Fix where clause in information schema with correct database name #6599

Closed
harshit-gangal opened this issue Aug 20, 2020 · 6 comments
Closed
Milestone

Comments

@harshit-gangal
Copy link
Member

Overview of the Issue

The query sent down from VTGate to Vttablet does not replace the where clause of the information schema queries for table_schema = 'keyspace' to table_schema = 'databasename'

Reproduction Steps

Steps to reproduce this issue, example:

  1. Deploy the following vschema:

    {
      "sharded": false,
      "tables": {
      }
    }
  2. Run

mysql> SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'commerce' AND TABLE_NAME LIKE '%' HAVING TABLE_TYPE IN ('TABLE','VIEW',null,null,null) ORDER BY TABLE_TYPE, TABLE_SCHEMA, TABLE_NAME;
Empty set (0.02 sec)

mysql> SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'commerce' AND COLUMN_NAME LIKE '%' ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
Empty set (0.00 sec)

Both the query returns empty result test

Binary version

master

Operating system and Environment details

Sprint boot application with mysql 8.0

@harshit-gangal harshit-gangal added this to the v8.0 milestone Aug 20, 2020
@harshit-gangal
Copy link
Member Author

Support added via #6638

@yborovikov
Copy link

@harshit-gangal this is a (very) breaking change.

@harshit-gangal
Copy link
Member Author

@yborovikov can you explain why this is breaking change? Previously the query did not give any result. Now it is handled.

@yborovikov
Copy link

sure: previously a query like SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'vt_commerce'; returned a result. now it doesn't.

@harshit-gangal
Copy link
Member Author

Yes, this has changes in vtgate and vttablet. We will make this feature available in two step because now it depends on upgrade order of Vitess cluster.

@yborovikov
Copy link

not sure how any sequencing of vitess upgrades can not break the customers that use queries like ... FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'vt_SOMENAMESPACE';.

current client code has to prefix the namespace with vt_ - and the change rendered these queries broken. neither we can not prefix the namespace - since it won't work with current installations of vitess.

the change itself is reasonable - customers shouldn't be aware of internal (to vitess and mysql) re/naming conventions.

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