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

vtexplain: properly use sqlparser.String to quote reserved table names #4681

Merged

Conversation

demmer
Copy link
Member

@demmer demmer commented Feb 27, 2019

Description

Fix for vtexplain not working with keyword names for tables such as action.

Details

Previously, vtexplain would return an error such as:
E0226 21:19:04.420743 30715 engine.go:157] Engine.Open: failed to load table action: Row count exceeded 0 (errno 10001) (sqlstate HY000) during query: select * from `action` where 1 != 1

The problem was that the schema engine escaped tables when looking up the field signature, but vtexplain didn't do the same.

The fix is simply to consistently use sqlparser.String when getting the name of a table.

@demmer demmer requested a review from sougou as a code owner February 27, 2019 06:21
@demmer demmer force-pushed the vtexplain-support-escaped-table-names branch from 57540c5 to 69f128d Compare February 27, 2019 06:21
@demmer demmer requested a review from acharis February 27, 2019 06:22
@acharis
Copy link
Contributor

acharis commented Feb 27, 2019

thank you

@demmer
Copy link
Member Author

demmer commented Feb 27, 2019

@sougou review plz.

@sougou sougou merged commit f5638ab into vitessio:master Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants