Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typo in packet.js #12

Closed
dmitryvolk opened this issue Jul 10, 2013 · 4 comments
Closed

typo in packet.js #12

dmitryvolk opened this issue Jul 10, 2013 · 4 comments

Comments

@dmitryvolk
Copy link

Typo in lib/packets/packet.js:355
Packet.prototype.writeLengthCodedNumber = function(n) {
// TODO: null
if (n < 0xfb)
return this.writeInt8(n);
if (n < 0xffff) {
this.writeInt8(0xfc);
return this.writeInt16(n);
}
-------> if (this < 0xffffff) { /* should be n<0xfffffffff */
this.writeInt8(0xfd);
return this.writeInt24(n);
}
console.log(n);
console.trace();
throw "No bignumbers yet";
};

@sidorares
Copy link
Owner

Do you want to create pull request?

@dmitryvolk
Copy link
Author

I just reviewed some parts of the code and seen the typo

@sidorares
Copy link
Owner

Well, thanks for that :)

@sidorares
Copy link
Owner

0xffffff is correct here, this < 0xffffff obviously incorrect
This code writes 3 byte-length int prefixed with 0xfd, see http://dev.mysql.com/doc/internals/en/overview.html#length-encoded-integer

sidorares added a commit that referenced this issue Jul 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants