Skip to content

Fix for issue with information_schema queries with both table name and schema name predicates#8087

Merged
systay merged 4 commits intovitessio:masterfrom
planetscale:sysschema-fix
May 10, 2021
Merged

Fix for issue with information_schema queries with both table name and schema name predicates#8087
systay merged 4 commits intovitessio:masterfrom
planetscale:sysschema-fix

Conversation

@harshit-gangal
Copy link
Copy Markdown
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.

2 participants