Skip to content

Fix information_schema query with system schema in table_schema filter#7430

Merged
harshit-gangal merged 6 commits intovitessio:masterfrom
planetscale:systemschema-fix
Feb 3, 2021
Merged

Fix information_schema query with system schema in table_schema filter#7430
harshit-gangal merged 6 commits intovitessio:masterfrom
planetscale:systemschema-fix

Conversation

@harshit-gangal
Copy link
Copy Markdown
Member

Description

Related Issue(s)

Checklist

  • Should this PR be backported?
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

Impacted Areas in Vitess

Components that this PR will affect:

  • Query Serving
  • VReplication
  • Cluster Management
  • Build/CI
  • VTAdmin

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
…ault route if it is a system schema

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
… from bv if tablet will replace it

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
@harshit-gangal harshit-gangal marked this pull request as ready for review February 2, 2021 11:07
@harshit-gangal harshit-gangal added this to the v10.0 milestone Feb 2, 2021
Copy link
Copy Markdown
Collaborator

@systay systay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'm just missing an end to end test that tests the query we set out to fix in the first place:

mysql> SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'performance_schema' AND table_name = 'foo';

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
@harshit-gangal
Copy link
Copy Markdown
Member Author

Looks good. I'm just missing an end to end test that tests the query we set out to fix in the first place:

mysql> SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'performance_schema' AND table_name = 'foo';

addressed.

@harshit-gangal harshit-gangal merged commit 68cda5e into vitessio:master Feb 3, 2021
@harshit-gangal harshit-gangal deleted the systemschema-fix branch February 3, 2021 07:09
systay pushed a commit to planetscale/vitess that referenced this pull request May 11, 2021
Backport of vitessio#7430
This is a combination of 6 commits.

* added system schema in where clause plan test
* added executor unit test
* added logic to check table_schema of where clause and redirect to default route if it is a system schema
* added e2e test
* set the bindvars for the normalized predicates and remove schema name from bv if tablet will replace it
* added e2e test having table_schema and table_name in where clause

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
rafael pushed a commit to tinyspeck/vitess that referenced this pull request May 11, 2021
Backport of vitessio#7430
This is a combination of 6 commits.

* added system schema in where clause plan test
* added executor unit test
* added logic to check table_schema of where clause and redirect to default route if it is a system schema
* added e2e test
* set the bindvars for the normalized predicates and remove schema name from bv if tablet will replace it
* added e2e test having table_schema and table_name in where clause

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>

Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Querying information_schema does not work for combination of table_schema and table_name filter.

2 participants