Skip to content

Add failing tests#1

Open
billoneil wants to merge 1 commit into
masterfrom
parser-bugs
Open

Add failing tests#1
billoneil wants to merge 1 commit into
masterfrom
parser-bugs

Conversation

@billoneil

Copy link
Copy Markdown
Owner

No description provided.

connection = null;
@Test
public void testDropForeignKeyParses() {
String sql = "ALTER TABLE `address` DROP FOREIGN KEY `fk_address_city`;";

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

The parser checks for KEY but not FOREIGN KEY

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

org.jooq.impl.ParserException: Unexpected token or missing query delimiter: [1:36] ALTER TABLE `address` DROP FOREIGN [*]KEY `fk_address_city`;
	at org.jooq.impl.ParserContext.exception(ParserImpl.java:8511)
	at org.jooq.impl.ParserContext.done(ParserImpl.java:8631)
	at org.jooq.impl.ParserImpl.parse(ParserImpl.java:453)
	at org.jooq.impl.ParserImpl.parse(ParserImpl.java:432)
	at org.jooq.mcve.test.MCVETest.testDropForeignKeyParses(MCVETest.java:51)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)

" film_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,\n" +
" title VARCHAR(255) NOT NULL,\n" +
" description TEXT DEFAULT NULL,\n" +
" release_year YEAR DEFAULT NULL,\n" +

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

The parser doesn't like YEAR

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

org.jooq.impl.ParserException: Unknown data type: [5:16] ...,
  description TEXT DEFAULT NULL,
  release_year [*]YEAR DEFAULT NULL,
  language_id TINYINT UNSIGNED NOT NULL,
  original_language_...
	at org.jooq.impl.ParserContext.exception(ParserImpl.java:8511)
	at org.jooq.impl.ParserImpl.parseDataTypePrefix(ParserImpl.java:7260)
	at org.jooq.impl.ParserImpl.parseDataType(ParserImpl.java:7023)
	at org.jooq.impl.ParserImpl.parseCreateTable(ParserImpl.java:2296)
	at org.jooq.impl.ParserImpl.parseCreate(ParserImpl.java:1834)
	at org.jooq.impl.ParserImpl.parseQuery(ParserImpl.java:674)
	at org.jooq.impl.ParserImpl.parse(ParserImpl.java:445)
	at org.jooq.impl.ParserImpl.parse(ParserImpl.java:432)
	at org.jooq.mcve.test.MCVETest.testYearDataType(MCVETest.java:79)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)

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.

1 participant