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

check schema and table before create it #3716

Merged
merged 4 commits into from
Dec 19, 2017
Merged

check schema and table before create it #3716

merged 4 commits into from
Dec 19, 2017

Conversation

antergone
Copy link
Contributor

Fix #3715


// Check table exists
var tableExist bool
tableRows, err := db.Query("SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME = ?", table)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be dbTable? I'm not well versed in mysql but it seems like this could match any table with the correct name from any database since it's not being scoped.

@jefferai jefferai added this to the 0.9.1 milestone Dec 19, 2017
@jefferai
Copy link
Member

Thanks!

@jefferai jefferai merged commit ccf10f6 into hashicorp:master Dec 19, 2017
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.

2 participants