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 for issue with information_schema queries with both table name and schema name predicates #8087

Merged
merged 4 commits into from
May 10, 2021

Conversation

harshit-gangal
Copy link
Member

Description

Related Issue(s)

If the information_schema query contains a table and schema both and schema is actual db name different from keyspace name, then the query fails.

mysql> use commerce;
Database changed
mysql> select CONSTRAINT_NAME, TABLE_NAME from information_schema.table_constraints where constraint_schema = 'vt_commerce' and table_name = 't';
ERROR 1105 (HY000): keyspace vt_commerce not found in vschema

Checklist

  • Tests were added or are not required
  • Documentation was added or is not required

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
… of information_schema query

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
@systay systay merged commit ea1c62b into vitessio:master May 10, 2021
@systay systay deleted the sysschema-fix branch May 10, 2021 06:00
systay pushed a commit to planetscale/vitess that referenced this pull request May 11, 2021
Backport of vitessio#8087

This is a combination of 4 commits.

* add e2e test for system schema
* add unit test for system schema issue
* redirect to default route if not able to resolve the keyspace in case of information_schema query
* update test with new error message

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#8087

This is a combination of 4 commits.

* add e2e test for system schema
* add unit test for system schema issue
* redirect to default route if not able to resolve the keyspace in case of information_schema query
* update test with new error message

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

Signed-off-by: Andres Taylor <andres@planetscale.com>
@systay systay changed the title System schema query predicate fix Fix for issue with information_schema queries with both table name and schema name predicates May 25, 2021
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.

None yet

2 participants