{"action":"closed","issue":{"url":"https://api.github.com/repos/sidorares/node-mysql2/issues/113","labels_url":"https://api.github.com/repos/sidorares/node-mysql2/issues/113/labels{/name}","comments_url":"https://api.github.com/repos/sidorares/node-mysql2/issues/113/comments","events_url":"https://api.github.com/repos/sidorares/node-mysql2/issues/113/events","html_url":"https://github.com/sidorares/node-mysql2/issues/113","id":38977227,"number":113,"title":"Unhandled exception in Packet.readLengthCodedNumber","user":{"login":"matthew-dean-hp","id":8125943,"avatar_url":"https://avatars.githubusercontent.com/u/8125943?v=3","gravatar_id":"","url":"https://api.github.com/users/matthew-dean-hp","html_url":"https://github.com/matthew-dean-hp","followers_url":"https://api.github.com/users/matthew-dean-hp/followers","following_url":"https://api.github.com/users/matthew-dean-hp/following{/other_user}","gists_url":"https://api.github.com/users/matthew-dean-hp/gists{/gist_id}","starred_url":"https://api.github.com/users/matthew-dean-hp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthew-dean-hp/subscriptions","organizations_url":"https://api.github.com/users/matthew-dean-hp/orgs","repos_url":"https://api.github.com/users/matthew-dean-hp/repos","events_url":"https://api.github.com/users/matthew-dean-hp/events{/privacy}","received_events_url":"https://api.github.com/users/matthew-dean-hp/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/sidorares/node-mysql2/milestones/2","html_url":"https://github.com/sidorares/node-mysql2/milestones/0.15.2","labels_url":"https://api.github.com/repos/sidorares/node-mysql2/milestones/2/labels","id":927855,"number":2,"title":"0.15.2","description":"","creator":{"login":"sidorares","id":173025,"avatar_url":"https://avatars.githubusercontent.com/u/173025?v=3","gravatar_id":"","url":"https://api.github.com/users/sidorares","html_url":"https://github.com/sidorares","followers_url":"https://api.github.com/users/sidorares/followers","following_url":"https://api.github.com/users/sidorares/following{/other_user}","gists_url":"https://api.github.com/users/sidorares/gists{/gist_id}","starred_url":"https://api.github.com/users/sidorares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sidorares/subscriptions","organizations_url":"https://api.github.com/users/sidorares/orgs","repos_url":"https://api.github.com/users/sidorares/repos","events_url":"https://api.github.com/users/sidorares/events{/privacy}","received_events_url":"https://api.github.com/users/sidorares/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":5,"state":"open","created_at":"2015-01-08T22:55:16Z","updated_at":"2015-03-11T00:07:03Z","due_on":null,"closed_at":null},"comments":37,"created_at":"2014-07-29T10:44:35Z","updated_at":"2015-03-11T00:07:03Z","closed_at":"2015-03-11T00:07:03Z","body":"This issue was first reported for node-mysql (see http://github.com/felixge/node-mysql/issues/867 for the exact setup) but is also present in this library. Basically when connected to two nodes of a galera cluster if I repeatedly call a stored procedure that returns multiple result sets an unhandled exception sometimes occurs.\r\n\r\nThe debug output for a test case is as follows:\r\n\r\n~~~\r\nAdd command: Connection\r\n ==> Connection#handshakeInit(0,,102)\r\n <== Connection#handshakeInit(1,,73)\r\n ==> Connection#handshakeResult(2,maybeOK,7)\r\nAdd command: query\r\nAdd command: Connection\r\n <== query#start(0,,62)\r\n ==> Connection#handshakeInit(0,,102)\r\n <== Connection#handshakeInit(1,,73)\r\n ==> Connection#handshakeResult(2,maybeOK,7)\r\nAdd command: query\r\nAdd command: Connection\r\n <== query#start(0,,62)\r\n ==> Connection#handshakeInit(0,,102)\r\n <== Connection#handshakeInit(1,,73)\r\n ==> Connection#handshakeResult(2,maybeOK,7)\r\nAdd command: query\r\nAdd command: Connection\r\n <== query#start(0,,62)\r\n ==> query#resultsetHeader(1,,1)\r\n ==> query#readField(2,,52)\r\n ==> query#readField(3,,56)\r\n ==> query#fieldsEOF(4,EOF,5)\r\n ==> query#row(5,,39)\r\n ==> query#row(6,EOF,5)\r\n ==> query#resultsetHeader(7,maybeOK,7)\r\n ==> Connection#handshakeInit(0,,102)\r\n <== Connection#handshakeInit(1,,73)\r\n ==> Connection#handshakeResult(2,maybeOK,7)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: Connection\r\n ==> query#resultsetHeader(1,,1)\r\n ==> query#readField(2,,52)\r\n ==> query#readField(3,,56)\r\n ==> query#fieldsEOF(4,EOF,5)\r\n ==> query#row(5,,39)\r\n ==> query#row(6,EOF,5)\r\n ==> query#resultsetHeader(7,maybeOK,7)\r\n ==> Connection#handshakeInit(0,,102)\r\n <== Connection#handshakeInit(1,,73)\r\n ==> query#resultsetHeader(1,maybeOK,7)\r\n ==> Connection#handshakeResult(2,maybeOK,7)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: Connection\r\n ==> query#resultsetHeader(1,,1)\r\n ==> query#readField(2,,52)\r\n ==> query#readField(3,,56)\r\n ==> query#fieldsEOF(4,EOF,5)\r\n ==> query#row(5,,39)\r\n ==> query#row(6,EOF,5)\r\n ==> query#resultsetHeader(7,maybeOK,7)\r\n ==> Connection#handshakeInit(0,,102)\r\n <== Connection#handshakeInit(1,,73)\r\n ==> Connection#handshakeResult(2,maybeOK,7)\r\nAdd command: query\r\nAdd command: Connection\r\n <== query#start(0,,62)\r\n ==> Connection#handshakeInit(0,,102)\r\n <== Connection#handshakeInit(1,,73)\r\n ==> Connection#handshakeResult(2,maybeOK,7)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: Connection\r\n ==> query#resultsetHeader(1,,1)\r\n ==> query#readField(2,,52)\r\n ==> query#readField(3,,56)\r\n ==> query#fieldsEOF(4,EOF,5)\r\n ==> query#row(5,,39)\r\n ==> query#row(6,EOF,5)\r\n ==> query#resultsetHeader(7,maybeOK,7)\r\n ==> Connection#handshakeInit(0,,102)\r\n <== Connection#handshakeInit(1,,73)\r\n ==> query#resultsetHeader(1,,1)\r\n ==> query#readField(2,,52)\r\n ==> query#readField(3,,56)\r\n ==> query#fieldsEOF(4,EOF,5)\r\n ==> query#row(5,,39)\r\n ==> query#row(6,EOF,5)\r\n ==> query#resultsetHeader(7,maybeOK,7)\r\n ==> Connection#handshakeResult(2,maybeOK,7)\r\nAdd command: query\r\nAdd command: Connection\r\n <== query#start(0,,62)\r\n ==> query#resultsetHeader(1,,1)\r\n ==> query#readField(2,,52)\r\n ==> query#readField(3,,56)\r\n ==> query#fieldsEOF(4,EOF,5)\r\n ==> query#row(5,,39)\r\n ==> query#row(6,EOF,5)\r\n ==> query#resultsetHeader(7,maybeOK,7)\r\n ==> Connection#handshakeInit(0,,102)\r\n <== Connection#handshakeInit(1,,73)\r\n ==> query#resultsetHeader(1,,1)\r\n ==> query#readField(2,,52)\r\n ==> query#readField(3,,56)\r\n ==> query#fieldsEOF(4,EOF,5)\r\n ==> query#row(5,,39)\r\n ==> query#row(6,EOF,5)\r\n ==> query#resultsetHeader(7,maybeOK,7)\r\n ==> query#resultsetHeader(1,,1)\r\n ==> query#readField(2,,52)\r\n ==> query#readField(3,,56)\r\n ==> query#fieldsEOF(4,EOF,5)\r\n ==> query#row(5,,40)\r\n ==> query#row(6,EOF,5)\r\n ==> query#resultsetHeader(7,maybeOK,7)\r\n ==> query#resultsetHeader(1,,1)\r\n ==> query#readField(2,,52)\r\n ==> query#readField(3,,56)\r\n ==> query#fieldsEOF(4,EOF,5)\r\n ==> query#row(5,,40)\r\n ==> query#row(6,EOF,5)\r\n ==> query#resultsetHeader(7,maybeOK,7)\r\n ==> Connection#handshakeResult(2,maybeOK,7)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: Connection\r\n ==> query#resultsetHeader(1,,1)\r\n ==> query#readField(2,,52)\r\n ==> query#readField(3,,56)\r\n ==> query#fieldsEOF(4,EOF,5)\r\n ==> query#row(5,,40)\r\n ==> query#row(6,EOF,5)\r\n ==> query#resultsetHeader(7,maybeOK,7)\r\n ==> query#resultsetHeader(1,,1)\r\n ==> query#readField(2,,52)\r\n ==> query#readField(3,,56)\r\n ==> query#fieldsEOF(4,EOF,5)\r\n ==> query#row(5,,40)\r\n ==> query#row(6,EOF,5)\r\n ==> query#resultsetHeader(7,maybeOK,7)\r\n ==> Connection#handshakeInit(0,,102)\r\n <== Connection#handshakeInit(1,,73)\r\n ==> Connection#handshakeResult(2,maybeOK,7)\r\nAdd command: query\r\nAdd command: Connection\r\n <== query#start(0,,62)\r\n ==> Connection#handshakeInit(0,,102)\r\n <== Connection#handshakeInit(1,,73)\r\n ==> Connection#handshakeResult(2,maybeOK,7)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: Connection\r\n ==> query#resultsetHeader(1,,1)\r\n ==> query#readField(2,,52)\r\n ==> query#readField(3,,56)\r\n ==> query#fieldsEOF(4,EOF,5)\r\n ==> query#row(5,,40)\r\n ==> query#row(6,EOF,5)\r\n ==> query#resultsetHeader(7,maybeOK,7)\r\n ==> query#resultsetHeader(1,maybeOK,7)\r\n ==> query#resultsetHeader(1,,1)\r\n ==> query#readField(2,,52)\r\n ==> query#readField(3,,56)\r\n ==> query#fieldsEOF(4,EOF,5)\r\n ==> query#row(5,,40)\r\n ==> query#row(6,EOF,5)\r\n ==> query#resultsetHeader(7,maybeOK,7)\r\n ==> query#resultsetHeader(1,maybeOK,7)\r\n ==> Connection#handshakeInit(0,,102)\r\n <== Connection#handshakeInit(1,,73)\r\n ==> query#resultsetHeader(1,,1)\r\n ==> query#readField(2,,52)\r\n ==> query#readField(3,,56)\r\n ==> query#fieldsEOF(4,EOF,5)\r\n ==> query#row(5,,40)\r\n ==> query#row(6,EOF,5)\r\n ==> query#resultsetHeader(7,maybeOK,7)\r\n ==> Connection#handshakeResult(2,maybeOK,7)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: query\r\n <== query#start(0,,62)\r\nAdd command: Connection\r\n ==> query#resultsetHeader(1,,40)\r\n ==> query#readField(2,,40)\r\n ==> query#readField(3,EOF,5)\r\nTrace\r\n    at Packet.readLengthCodedNumber (c:\\Users\\deanmat\\galeraTest\\node_modules\\mysql2\\lib\\packets\\packet.js:135:12)\r\n    at Packet.readLengthCodedString (c:\\Users\\deanmat\\galeraTest\\node_modules\\mysql2\\lib\\packets\\packet.js:264:18)\r\n    at new ColumnDefinition (c:\\Users\\deanmat\\galeraTest\\node_modules\\mysql2\\lib\\packets\\column_definition.js:6:26)\r\n    at Query.readField (c:\\Users\\deanmat\\galeraTest\\node_modules\\mysql2\\lib\\commands\\query.js:92:17)\r\n    at Query.Command.execute (c:\\Users\\deanmat\\galeraTest\\node_modules\\mysql2\\lib\\commands\\command.js:34:20)\r\n    at PoolConnection.Connection.handlePacket (c:\\Users\\deanmat\\galeraTest\\node_modules\\mysql2\\lib\\connection.js:274:28)\r\n    at PacketParser.onPacket (c:\\Users\\deanmat\\galeraTest\\node_modules\\mysql2\\lib\\connection.js:68:65)\r\n    at PacketParser.execute (c:\\Users\\deanmat\\galeraTest\\node_modules\\mysql2\\lib\\packet_parser.js:37:14)\r\n    at Socket.<anonymous> (c:\\Users\\deanmat\\galeraTest\\node_modules\\mysql2\\lib\\connection.js:80:31)\r\n    at Socket.emit (events.js:95:17)\r\n\r\nc:\\Users\\deanmat\\galeraTest\\node_modules\\mysql2\\lib\\packets\\packet.js:136\r\n   throw \"Should not reach here: \" + byte1;\r\n                                   ^\r\nShould not reach here: undefined\r\n\r\n~~~"}}