{"action":"created","issue":{"url":"https://api.github.com/repos/go-sql-driver/mysql/issues/358","labels_url":"https://api.github.com/repos/go-sql-driver/mysql/issues/358/labels{/name}","comments_url":"https://api.github.com/repos/go-sql-driver/mysql/issues/358/comments","events_url":"https://api.github.com/repos/go-sql-driver/mysql/issues/358/events","html_url":"https://github.com/go-sql-driver/mysql/issues/358","id":96927715,"number":358,"title":"Exec: should ErrPktTooLarge be returned for interpolated params instead of db.ErrSkip?","user":{"login":"twmb","id":1283109,"avatar_url":"https://avatars.githubusercontent.com/u/1283109?v=3","gravatar_id":"","url":"https://api.github.com/users/twmb","html_url":"https://github.com/twmb","followers_url":"https://api.github.com/users/twmb/followers","following_url":"https://api.github.com/users/twmb/following{/other_user}","gists_url":"https://api.github.com/users/twmb/gists{/gist_id}","starred_url":"https://api.github.com/users/twmb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twmb/subscriptions","organizations_url":"https://api.github.com/users/twmb/orgs","repos_url":"https://api.github.com/users/twmb/repos","events_url":"https://api.github.com/users/twmb/events{/privacy}","received_events_url":"https://api.github.com/users/twmb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-23T23:39:24Z","updated_at":"2015-07-23T23:50:52Z","closed_at":null,"body":"When using a very large interpolated statement, interpolateParams returns db.ErrSkip when the interpolated statement exceeds maxPacketAllowed.  Inside database/sql, if ErrSkip is returned, Exec falls back to the prepare/execute cycle and returns any resultant error. Prepared statements have a limit of 65535 statements. Any error other than ErrSkip is returned immediately and no further prepare/execute is attempted.\r\n\r\nI use interpolateParams to get statements larger than 65535 statements _and_ to avoid the prepare/execute cycle. Returning ErrPktTooLarge allows users to either trim their packet size (drop the number of params to be interpolated) or to increase the max_allowed_packet inside mysql.\r\n\r\nThe current behavior _is_ reasonable and acceptable because of the prepare/execute fallback. ErrPktTooLarge is also, in my opinion, reasonable and allows programs to self adjust or fix what they are doing.\r\n\r\nCan it be an option to return ErrPktTooLarge?"},"comment":{"url":"https://api.github.com/repos/go-sql-driver/mysql/issues/comments/124271500","html_url":"https://github.com/go-sql-driver/mysql/issues/358#issuecomment-124271500","issue_url":"https://api.github.com/repos/go-sql-driver/mysql/issues/358","id":124271500,"user":{"login":"twmb","id":1283109,"avatar_url":"https://avatars.githubusercontent.com/u/1283109?v=3","gravatar_id":"","url":"https://api.github.com/users/twmb","html_url":"https://github.com/twmb","followers_url":"https://api.github.com/users/twmb/followers","following_url":"https://api.github.com/users/twmb/following{/other_user}","gists_url":"https://api.github.com/users/twmb/gists{/gist_id}","starred_url":"https://api.github.com/users/twmb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twmb/subscriptions","organizations_url":"https://api.github.com/users/twmb/orgs","repos_url":"https://api.github.com/users/twmb/repos","events_url":"https://api.github.com/users/twmb/events{/privacy}","received_events_url":"https://api.github.com/users/twmb/received_events","type":"User","site_admin":false},"created_at":"2015-07-23T23:50:51Z","updated_at":"2015-07-23T23:50:51Z","body":"Alternatively, expose a function that we can pass our statement and arguments to to get what interpolateParams returns. If Exec fails, we can manually check."}}