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

Statements ignored by the parser do not implement QueryPartInternal #8908

Closed
lukaseder opened this issue Jul 8, 2019 · 1 comment
Closed

Comments

@lukaseder
Copy link
Member

When the parser encounters a statement that it ignores (e.g. the new CREATE EXTENSION statement support from #8324), it produces a proxy that currently doesn't implement QueryPartInternal. All QueryPart instances are expected to also implement QueryPartInternal by all of jOOQ's internals. Currently, we can get this kind of ClassCastException:

java.lang.ClassCastException: class com.sun.proxy.$Proxy11 cannot be cast to class org.jooq.QueryPartInternal (com.sun.proxy.$Proxy11 and org.jooq.QueryPartInternal are in unnamed module of loader 'app')
	at org.jooq.impl.AbstractContext.visit0(AbstractContext.java:410)
	at org.jooq.impl.AbstractContext.visit(AbstractContext.java:218)
	at org.jooq.impl.DefaultDSLContext.renderInlined(DefaultDSLContext.java:720)
	at org.jooq.impl.AbstractQueryPart.equals(AbstractQueryPart.java:161)
	at org.junit.Assert.isEquals(Assert.java:131)
	at org.junit.Assert.equalsRegardingNull(Assert.java:127)
	at org.junit.Assert.assertEquals(Assert.java:111)
	at org.jooq.test.util.BaseTest.assertEquals(BaseTest.java:89)
	at org.jooq.impl.AbstractParserTest.assertQueryEquals(AbstractParserTest.java:210)
	at org.jooq.impl.ParserDDLStatementTest.testCreateExtension(ParserDDLStatementTest.java:91)

This is probably mostly a unit / integration test issue, but it should still be handled correctly.

@lukaseder
Copy link
Member Author

lukaseder commented Jul 8, 2019

This fix depends on a new jOOR feature: jOOQ/jOOR#83. We'll upgrade the dependency to 0.9.12: #8909

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

1 participant