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

schemadiff: CanonicalStatementString(), utilize sqlparser.CanonicalString() #10142

Merged

Conversation

shlomi-noach
Copy link
Contributor

@shlomi-noach shlomi-noach commented Apr 26, 2022

Description

#10068 introduced sqlparser.CanonicalString() which prints out statements in a canonical aka "standard" format: capitals for SQL keywords, fully qualified names etc.

In this PR schemadiff supports the new format by exposing a CanonicalStatementString() for all diff entities.
Declarative migrations now use the canonical query over the default query format.

All unit tests now validate both default query format and canonical query format.
endtoend tests switched to using the canonical format.

Related Issue(s)

#10068

Checklist

  • "Backport me!" label has been added if this change should be backported
  • Tests were added or are not required
  • Documentation was added or is not required

…ring()

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
@shlomi-noach shlomi-noach added Type: Enhancement Logical improvement (somewhere between a bug and feature) Component: Query Serving release notes none labels Apr 26, 2022
@shlomi-noach shlomi-noach requested review from dbussink, vmg and a team April 26, 2022 16:43
@shlomi-noach
Copy link
Contributor Author

Getting a legit failure from schemadiff_vrepl:

2022-04-26T16:52:25.9487634Z     --- FAIL: TestSchemaChange/enum (0.04s)
2022-04-26T16:52:25.9488116Z         --- FAIL: TestSchemaChange/enum/validate_diff (0.02s)

Looking into it. Tests are the best.

@shlomi-noach
Copy link
Contributor Author

depends on fixing #10143

@shlomi-noach shlomi-noach marked this pull request as draft April 26, 2022 17:08
@shlomi-noach
Copy link
Contributor Author

converted to draft while tests are failing.

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
@shlomi-noach
Copy link
Contributor Author

merged main having merged #10143

@shlomi-noach shlomi-noach marked this pull request as ready for review April 27, 2022 13:46
@shlomi-noach
Copy link
Contributor Author

Going to merge this PR with Cluster (20) failing, as this is a known flake.

@shlomi-noach shlomi-noach merged commit 9392e03 into vitessio:main Apr 27, 2022
@shlomi-noach shlomi-noach deleted the schemadiff-canonical-statement-string branch April 27, 2022 14:34
@shlomi-noach
Copy link
Contributor Author

Tracking issue: #10203

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants