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

#371 - handle SERIAL datatype properly #379

Merged
merged 2 commits into from
Jul 12, 2016
Merged

#371 - handle SERIAL datatype properly #379

merged 2 commits into from
Jul 12, 2016

Conversation

osheroff
Copy link
Collaborator

@zendesk/rules

Ben Osheroff added 2 commits July 9, 2016 23:08
SERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE

because brevity is important, I guess.
@dadah89
Copy link
Contributor

dadah89 commented Jul 12, 2016

SERIAL is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.

SERIAL DEFAULT VALUE in the definition of an integer column is an alias for NOT NULL AUTO_INCREMENT UNIQUE.

I see NOT NULL matches the nullability definition, but from column_options the only think we seem to care is primary_key?

@osheroff
Copy link
Collaborator Author

that's correct. but I think we roughly match the mysql parser by accepting all column options (and then ignoring the ones we don't care about).

@@ -17,6 +17,9 @@ ANTLR_IMPORTS=src/main/antlr4/imports
ANTLR_DIR=target/generated-sources/src/main/antlr4/com/zendesk/maxwell/schema/ddl
ANTLR_OUTPUT=$(ANTLR_DIR)/mysqlBaseListener.java $(ANTLR_DIR)/mysqlLexer.java $(ANTLR_DIR)/mysqlListener.java $(ANTLR_DIR)/mysqlParser.java

$(ANTLR_IMPORTS)/mysql_literal_tokens.g4: $(ANTLR_IMPORTS)/generate_tokens.rb
Copy link
Contributor

Choose a reason for hiding this comment

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

this step was executed manually before this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah

@dadah89
Copy link
Contributor

dadah89 commented Jul 12, 2016

lgtm 👍

@osheroff osheroff merged commit 100428b into master Jul 12, 2016
@osheroff osheroff deleted the gh_371 branch December 2, 2020 16:52
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