{"action":"opened","issue":{"url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4481","labels_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4481/labels{/name}","comments_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4481/comments","events_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/4481/events","html_url":"https://github.com/jOOQ/jOOQ/issues/4481","id":102091218,"number":4481,"title":"Missing parentheses when DSL.dateDiff(d1, d2) renders \"d1 - d2\"","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},"labels":[{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/C:%20DB:%20CUBRID","name":"C: DB: CUBRID","color":"0000aa"},{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/C:%20DB:%20Oracle","name":"C: DB: Oracle","color":"0000aa"},{"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/C:%20DB:%20PostgreSQL","name":"C: DB: PostgreSQL","color":"0000aa"},{"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/T:%20Defect","name":"T: Defect","color":"cccccc"}],"state":"open","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":284,"closed_issues":160,"state":"open","created_at":"2014-12-11T12:56:14Z","updated_at":"2015-08-20T08:38:40Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-08-20T08:38:40Z","updated_at":"2015-08-20T08:38:40Z","closed_at":null,"body":"For the following function:\r\n\r\n```java\r\nDSL.dateDiff(d1, d2)\r\n```\r\n\r\n... jOOQ currently generates the following SQL:\r\n\r\n```sql\r\nd1 - d2\r\n```\r\n\r\nThis is incorrect whenthe expression is nested in the context of an arithmetic expression, such as:\r\n\r\n```java\r\nDSL.dateDiff(d1, d2).mul(3)\r\n```\r\n\r\n... which currently generates\r\n\r\n```sql\r\nd1 - d2 * 3\r\n```\r\n\r\ninstead of\r\n\r\n```sql\r\n(d1 - d2) * 3\r\n```"}}