{"action":"opened","issue":{"url":"https://api.github.com/repos/JSQLParser/JSqlParser/issues/279","repository_url":"https://api.github.com/repos/JSQLParser/JSqlParser","labels_url":"https://api.github.com/repos/JSQLParser/JSqlParser/issues/279/labels{/name}","comments_url":"https://api.github.com/repos/JSQLParser/JSqlParser/issues/279/comments","events_url":"https://api.github.com/repos/JSQLParser/JSqlParser/issues/279/events","html_url":"https://github.com/JSQLParser/JSqlParser/issues/279","id":158607891,"number":279,"title":"Issue parsing Merge","user":{"login":"mnadeem","id":476145,"avatar_url":"https://avatars.githubusercontent.com/u/476145?v=3","gravatar_id":"","url":"https://api.github.com/users/mnadeem","html_url":"https://github.com/mnadeem","followers_url":"https://api.github.com/users/mnadeem/followers","following_url":"https://api.github.com/users/mnadeem/following{/other_user}","gists_url":"https://api.github.com/users/mnadeem/gists{/gist_id}","starred_url":"https://api.github.com/users/mnadeem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnadeem/subscriptions","organizations_url":"https://api.github.com/users/mnadeem/orgs","repos_url":"https://api.github.com/users/mnadeem/repos","events_url":"https://api.github.com/users/mnadeem/events{/privacy}","received_events_url":"https://api.github.com/users/mnadeem/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-06T06:20:05Z","updated_at":"2016-06-06T06:20:05Z","closed_at":null,"body":"The following test fails, \r\n\r\nprivate static final String MERGE_USING_TABLE = \"MERGE INTO employees e \" +\r\n\t\" USING hr_records h \" +\r\n    \" ON (e.id = h.emp_id)\"+\r\n    \" WHEN MATCHED THEN\"+\r\n    \" UPDATE SET e.address = h.address\"+\r\n    \" WHEN NOT MATCHED THEN\"+\r\n    \" INSERT (id, address)\"+\r\n    \" VALUES (h.emp_id, h.address);\";\r\n\r\n\t@Test\r\n\tpublic void test() throws JSQLParserException {\r\n\t\t\r\n\t\tStatement statement = CCJSqlParserUtil.parse(MERGE_USING_TABLE);\r\n\t\t\r\n\t\tMerge mergeStatement = (Merge) statement;\r\n\t\t\r\n\t}\r\n\r\n\r\nIf we change the SQL, i.e, put hr_records within parenthesis then it works, ideally parenthesis should be required only for subqueries, further if we put parantheis, the sql would seize to execute. appreciate if grammer can be changed accordingly. \r\n\r\nprivate static final String MERGE_USING_TABLE = \"MERGE INTO employees e \" +\r\n\t\" USING (hr_records) h \" +\r\n    \" ON (e.id = h.emp_id)\"+\r\n    \" WHEN MATCHED THEN\"+\r\n    \" UPDATE SET e.address = h.address\"+\r\n    \" WHEN NOT MATCHED THEN\"+\r\n    \" INSERT (id, address)\"+\r\n    \" VALUES (h.emp_id, h.address);\";"}}
{"actor":{"display_login":"mnadeem"}}