{"action":"created","issue":{"url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4321","labels_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4321/labels{/name}","comments_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4321/comments","events_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4321/events","html_url":"https://github.com/jOOQ/jOOQ/issues/4321","id":82001554,"number":4321,"title":"Invalid SQL generated when using nullable data types for Derby ","user":{"login":"msteiger","id":1820007,"avatar_url":"https://avatars.githubusercontent.com/u/1820007?v=3","gravatar_id":"","url":"https://api.github.com/users/msteiger","html_url":"https://github.com/msteiger","followers_url":"https://api.github.com/users/msteiger/followers","following_url":"https://api.github.com/users/msteiger/following{/other_user}","gists_url":"https://api.github.com/users/msteiger/gists{/gist_id}","starred_url":"https://api.github.com/users/msteiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msteiger/subscriptions","organizations_url":"https://api.github.com/users/msteiger/orgs","repos_url":"https://api.github.com/users/msteiger/repos","events_url":"https://api.github.com/users/msteiger/events{/privacy}","received_events_url":"https://api.github.com/users/msteiger/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/C:%20Functionality","name":"C: Functionality","color":"0000aa"},{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/P:%20High","name":"P: High","color":"ff6666"},{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/R:%20Fixed","name":"R: Fixed","color":"55ff55"},{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/T:%20Defect","name":"T: Defect","color":"cccccc"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/jOOQ/jOOQ/milestones/111","html_url":"https://github.com/jOOQ/jOOQ/milestones/Version%203.7.0","labels_url":"https://api.github.com/repos/jOOQ/jOOQ/milestones/111/labels","id":900413,"number":111,"title":"Version 3.7.0","description":"","creator":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars.githubusercontent.com/u/734593?v=3","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"open_issues":282,"closed_issues":63,"state":"open","created_at":"2014-12-11T12:56:14Z","updated_at":"2015-05-30T07:24:53Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-05-28T16:00:37Z","updated_at":"2015-05-30T07:26:26Z","closed_at":"2015-05-30T07:08:26Z","body":"I'm getting invalid SQL for the following snippet:\r\n\r\n```java\r\nString url = \"jdbc:derby:memory://localhost:1527/servers;create=true\";\r\ntry (Connection conn = DriverManager.getConnection(url)) {\r\n    DSL.using(conn)\r\n        .createTable(\"t\")\r\n        .column(\"n\", SQLDataType.VARCHAR)\r\n        .execute();\r\n}\r\n```\r\n\r\nThe generated SQL statement is\r\n```sql\r\ncreate table \"t\"(\"n\" varchar null)\r\n```\r\n\r\nApache Derby doesn't accept the `null` part of it:\r\n\r\n    ERROR 42X01: Syntax error: Encountered \"null\" at line 1, column 37.\r\n\r\nIt does work with `VARCHAR.nullable(false)` though:\r\n\r\n```sql\r\ncreate table \"t\"(\"n\" varchar(32672) not null)\r\n```\r\n\r\nAlso, the same snippet works fine when using H2 instead of Derby:\r\n```sql\r\nString url = \"jdbc:h2:mem:test\";\r\n```\r\n\r\nI'm using jOOQ at version 3.6.1 and Derby v10.11.1.1.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jOOQ/jOOQ/issues/comments/107001840","html_url":"https://github.com/jOOQ/jOOQ/issues/4321#issuecomment-107001840","issue_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4321","id":107001840,"user":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars.githubusercontent.com/u/734593?v=3","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"created_at":"2015-05-30T07:26:26Z","updated_at":"2015-05-30T07:26:26Z","body":"Sure, no worries. Just noticed that we've currently deactivated integration tests for Derby DDL statements, as we hadn't fully supported them yet. We'll see that more fixes can make it into 3.6.2 (e.g. #4324)"}}