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

Remove trailing commas from CREATE TABLE statements #22

Merged
merged 1 commit into from
Jun 4, 2021
Merged

Remove trailing commas from CREATE TABLE statements #22

merged 1 commit into from
Jun 4, 2021

Conversation

daemonsy
Copy link
Contributor

@daemonsy daemonsy commented Jun 4, 2021

What's up?

Was having problems running the schema.sql file in MySQL 5.7.32. It was blowing up because of the trailing commas.

Did some research on whether trailing commas are allowed in CREATE TABLE. The results didn't seem conclusive. Some RDBMS implementations deem it harmless and won't error on it.

Wanted to check the SQL language spec next but since this file has some statement without trailing commas, I thought it's probably not intentional and it's easier to just remove it.

@daemonsy daemonsy changed the title Remove trailing commas from create_table statements Remove trailing commas from CREATE TABLE statements Jun 4, 2021
@jessepeterson
Copy link
Member

jessepeterson commented Jun 4, 2021

Yes, this is a bug on my part. SQL syntax can't have trailing commas on the last items. With MySQL at least. Also, fwiw, we're only supporting MySQL >= 8 feature set (>= 8.0.19 CHECK statements are present, among some other things). But if 5.x works for you, great!

@jessepeterson jessepeterson merged commit 39b1b36 into micromdm:main Jun 4, 2021
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