{"action":"created","issue":{"url":"https://api.github.com/repos/sidorares/node-mysql2/issues/881","repository_url":"https://api.github.com/repos/sidorares/node-mysql2","labels_url":"https://api.github.com/repos/sidorares/node-mysql2/issues/881/labels{/name}","comments_url":"https://api.github.com/repos/sidorares/node-mysql2/issues/881/comments","events_url":"https://api.github.com/repos/sidorares/node-mysql2/issues/881/events","html_url":"https://github.com/sidorares/node-mysql2/issues/881","id":381391778,"node_id":"MDU6SXNzdWUzODEzOTE3Nzg=","number":881,"title":"The debug option stopped working in 1.6.2","user":{"login":"dougwilson","id":67512,"node_id":"MDQ6VXNlcjY3NTEy","avatar_url":"https://avatars3.githubusercontent.com/u/67512?v=4","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2018-11-16T00:03:56Z","updated_at":"2018-11-16T01:29:01Z","closed_at":null,"author_association":"COLLABORATOR","body":"It seems like version 1.6.2 broke the `debug: true` option from working. I was able to dissect it to the following change: https://github.com/sidorares/node-mysql2/commit/e0077c0892fa27fe4bd39334be4a29dfe1592d18\r\n\r\nThe commit adds `'use strict'` to [lib/connection.js](https://github.com/sidorares/node-mysql2/blob/e0077c0892fa27fe4bd39334be4a29dfe1592d18/lib/connection.js) but there is a debug log in there that uses [arguments.callee](https://github.com/sidorares/node-mysql2/blob/e0077c0892fa27fe4bd39334be4a29dfe1592d18/lib/connection.js#L471) which is an error under strict mode.\r\n\r\nI'm not sure what the appropriate fix would be. A quick fix would be just to remove `'use strict'`, but not sure if there should be additional refactoring to just make it work under strict mode."},"comment":{"url":"https://api.github.com/repos/sidorares/node-mysql2/issues/comments/439250479","html_url":"https://github.com/sidorares/node-mysql2/issues/881#issuecomment-439250479","issue_url":"https://api.github.com/repos/sidorares/node-mysql2/issues/881","id":439250479,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTI1MDQ3OQ==","user":{"login":"dougwilson","id":67512,"node_id":"MDQ6VXNlcjY3NTEy","avatar_url":"https://avatars3.githubusercontent.com/u/67512?v=4","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"created_at":"2018-11-16T01:29:01Z","updated_at":"2018-11-16T01:29:01Z","author_association":"COLLABORATOR","body":"It can still be broken when run under the `vm` module (inside a context in which the globals refer to the parent context's globals, as then `Error.prepareStackTrace` doesn't take affect within the VM context), where the `arguments.callee` doesn't break. The stack stuff I don't think can ever be as robust as `arguments.callee` is. I'm not saying to actually keep using `arguments.callee`, but perhaps just something adds the command name to the command so the debug logging can just echo that vs needing to look at stack to know which the command name is?"}}
{"actor":{"display_login":"dougwilson"}}