{"action":"created","issue":{"url":"https://api.github.com/repos/jdbi/jdbi/issues/66","labels_url":"https://api.github.com/repos/jdbi/jdbi/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/jdbi/jdbi/issues/66/comments","events_url":"https://api.github.com/repos/jdbi/jdbi/issues/66/events","html_url":"https://github.com/jdbi/jdbi/issues/66","id":14960547,"number":66,"title":"ClasspathStatementLocator.locate Doesn't Always Detect SQL Comments","user":{"login":"gwittel","id":484093,"avatar_url":"https://avatars.githubusercontent.com/u/484093?v=3","gravatar_id":"","url":"https://api.github.com/users/gwittel","html_url":"https://github.com/gwittel","followers_url":"https://api.github.com/users/gwittel/followers","following_url":"https://api.github.com/users/gwittel/following{/other_user}","gists_url":"https://api.github.com/users/gwittel/gists{/gist_id}","starred_url":"https://api.github.com/users/gwittel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwittel/subscriptions","organizations_url":"https://api.github.com/users/gwittel/orgs","repos_url":"https://api.github.com/users/gwittel/repos","events_url":"https://api.github.com/users/gwittel/events{/privacy}","received_events_url":"https://api.github.com/users/gwittel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2013-05-30T20:34:20Z","updated_at":"2015-03-03T07:11:59Z","closed_at":null,"body":"In cases where a comment line starts with whitespace, `ClasspathStatementLocator.locate` via  won't filter these out due to `isWhitespace` only checking the starting characters.\r\n\r\nAdditionally, any line ending in a SQL comment (e.g. `SELECT ... -- something\\n`) will also not get filtered correctly, breaking the remaining part of the SQL script due to the wrapping of newlines.\r\n\r\nPossible changes:\r\n1) Document handling of whitespace and comments in SQL files when `createScript` is used.\r\n2) Allow whitespace before comments in `isWhitespace`\r\n3) Handle SQL lines ending with a comment\r\n4) Remove stripping of newlines"},"comment":{"url":"https://api.github.com/repos/jdbi/jdbi/issues/comments/76897731","html_url":"https://github.com/jdbi/jdbi/issues/66#issuecomment-76897731","issue_url":"https://api.github.com/repos/jdbi/jdbi/issues/66","id":76897731,"user":{"login":"mthorsson","id":1029722,"avatar_url":"https://avatars.githubusercontent.com/u/1029722?v=3","gravatar_id":"","url":"https://api.github.com/users/mthorsson","html_url":"https://github.com/mthorsson","followers_url":"https://api.github.com/users/mthorsson/followers","following_url":"https://api.github.com/users/mthorsson/following{/other_user}","gists_url":"https://api.github.com/users/mthorsson/gists{/gist_id}","starred_url":"https://api.github.com/users/mthorsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mthorsson/subscriptions","organizations_url":"https://api.github.com/users/mthorsson/orgs","repos_url":"https://api.github.com/users/mthorsson/repos","events_url":"https://api.github.com/users/mthorsson/events{/privacy}","received_events_url":"https://api.github.com/users/mthorsson/received_events","type":"User","site_admin":false},"created_at":"2015-03-03T07:11:59Z","updated_at":"2015-03-03T07:11:59Z","body":"Yepp, can confirm number 3. It's not super-easy to fix unfortunately. The code should support things like this:\r\n\r\n `col VARCHAR(32) NOT NULL DEFAULT '--'` \r\n\r\nso you can't just search for \"--\" and strip the rest of the line.\r\n\r\n"}}