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

Bug Report: Strict semantic analysis does not handle unsharded queries correctly #16067

Closed
dbussink opened this issue Jun 5, 2024 · 0 comments · Fixed by #16068
Closed

Bug Report: Strict semantic analysis does not handle unsharded queries correctly #16067

dbussink opened this issue Jun 5, 2024 · 0 comments · Fixed by #16068
Labels
Needs Triage This issue needs to be correctly labelled and triaged Type: Bug

Comments

@dbussink
Copy link
Contributor

dbussink commented Jun 5, 2024

Overview of the Issue

schemadiff uses the vtgate semantic analysis to understand views and to retrieve dependencies in views like table and column references, so it can ensure that diffing is safe and correct.

The semantic analysis however doesn't always take into account correctly if a view is on an unsharded database. This means that a query that works on an unsharded database still throws an error during semantic analysis and schemadiff fails to handle it.

Reproduction Steps

When using a view which uses OVER, this can be triggered.

create view v as SELECT year, country, product, profit, ROW_NUMBER() OVER(PARTITION BY country) AS row_num1, ROW_NUMBER() OVER(PARTITION BY country ORDER BY year, product) AS row_num2 FROM sales;

When loading this into schemadiff, it errors with a VT12001: unsupported: OVER CLAUSE with sharded keyspace even though the provided schema is not sharded.

Binary Version

Since #13444

Operating System and Environment details

-

Log Fragments

No response

@dbussink dbussink added Type: Bug Needs Triage This issue needs to be correctly labelled and triaged labels Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Triage This issue needs to be correctly labelled and triaged Type: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant