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

DDLDatabase fails with MySQL TINYINT(1) type columns #7020

Closed
anuraaga opened this issue Jan 10, 2018 · 2 comments
Closed

DDLDatabase fails with MySQL TINYINT(1) type columns #7020

anuraaga opened this issue Jan 10, 2018 · 2 comments

Comments

@anuraaga
Copy link

anuraaga commented Jan 10, 2018

Parser doesn't seem to recognize TINYINT(1) (boolean)

JOOQ 3.10.3

org.jooq.impl.ParserException: C42000_NO_SUBCLASS: Expected tokens: [AUTOINCREMENT, AUTO_INCREMENT, CHECK, DEFAULT, GENERATED, NOT NULL, NULL, PRIMARY KEY, UNIQUE]: plink_frequencies BLOB NOT NULL,
  is_test TINYINT[*](1) DEFAULT '0' NOT NULL,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT N
        at org.jooq.impl.ParserImpl$ParserContext.unexpectedToken(ParserImpl.java:5791)
        at org.jooq.impl.ParserImpl.parseQuery(ParserImpl.java:547)
        at org.jooq.impl.ParserImpl.parse(ParserImpl.java:345)
        at org.jooq.impl.ParserImpl.parse(ParserImpl.java:337)
        at org.jooq.util.ddl.DDLDatabase.create0(DDLDatabase.java:124)
        at org.jooq.util.AbstractDatabase.create(AbstractDatabase.java:237)
        at org.jooq.util.AbstractDatabase.create(AbstractDatabase.java:226)
        at org.jooq.util.AbstractDatabase.getDialect(AbstractDatabase.java:208)
        at org.jooq.util.AbstractGenerator.logDatabaseParameters(AbstractGenerator.java:131)
        at org.jooq.util.JavaGenerator.generate(JavaGenerator.java:271)
        at org.jooq.util.GenerationTool.run(GenerationTool.java:642)
        at org.jooq.util.GenerationTool.generate(GenerationTool.java:203)
        at org.jooq.util.GenerationTool.main(GenerationTool.java:175)
@lukaseder
Copy link
Member

Thanks for reporting. Indeed, those integer lengths can be parsed, and safely ignored as they have no meaning in MySQL (other than hinting at a display length, and indicating the intent of the developer to use a type as a boolean).

lukaseder added a commit that referenced this issue Jan 10, 2018
@lukaseder
Copy link
Member

This is now fixed for jOOQ 3.11 and will be merged to 3.10.4 next week (#7030)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants