{"action":"closed","issue":{"url":"https://api.github.com/repos/ygrek/sqlgg/issues/45","repository_url":"https://api.github.com/repos/ygrek/sqlgg","labels_url":"https://api.github.com/repos/ygrek/sqlgg/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/ygrek/sqlgg/issues/45/comments","events_url":"https://api.github.com/repos/ygrek/sqlgg/issues/45/events","html_url":"https://github.com/ygrek/sqlgg/issues/45","id":314540497,"number":45,"title":"same param used more than once not handled properly","user":{"login":"cyberhuman","id":979624,"avatar_url":"https://avatars2.githubusercontent.com/u/979624?v=4","gravatar_id":"","url":"https://api.github.com/users/cyberhuman","html_url":"https://github.com/cyberhuman","followers_url":"https://api.github.com/users/cyberhuman/followers","following_url":"https://api.github.com/users/cyberhuman/following{/other_user}","gists_url":"https://api.github.com/users/cyberhuman/gists{/gist_id}","starred_url":"https://api.github.com/users/cyberhuman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyberhuman/subscriptions","organizations_url":"https://api.github.com/users/cyberhuman/orgs","repos_url":"https://api.github.com/users/cyberhuman/repos","events_url":"https://api.github.com/users/cyberhuman/events{/privacy}","received_events_url":"https://api.github.com/users/cyberhuman/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-16T08:03:24Z","updated_at":"2018-04-17T21:59:18Z","closed_at":"2018-04-17T21:59:18Z","author_association":"CONTRIBUTOR","body":"```\r\nCREATE TABLE IF NOT EXISTS `test` (\r\n  `id` INTEGER UNSIGNED PRIMARY KEY AUTO_INCREMENT,\r\n  `nullable` TIMESTAMP NULL\r\n);\r\n\r\n-- @create\r\nINSERT INTO `test` (`nullable`) VALUES (\r\n  `nullable` = CASE @nullable WHEN 0 THEN NULL ELSE @nullable END\r\n);\r\n```\r\nsqlgg generates the following code from the above SQL:\r\n```\r\n  let create db ~nullable ~nullable =\r\n    let set_params stmt =\r\n      let p = T.start_params stmt 2 in\r\n      T.set_param_Int 0 nullable;\r\n      T.set_param_Datetime 1 nullable;\r\n      T.finish_params p\r\n```\r\nNotice 1) the `~nullable` label is duplicated and 2) the parameter types are different."}}
{"actor":{"display_login":"ygrek"}}