felixge/node-mysql — pull request #302 by croquiscom (2012-10-14 00:04:56+00:00)
Title: Refactoring code of parsing geometry

(Continuation of #301 request)

I think about a way to parse a geometry value more naturally, but it does not seem so good and useful for other part.

```javascript
// pseudo code

Parser.prototype.readUInt32 = function () {
var value = this._byteOrder ? this._buffer.readUInt32LE(_offset) : this._buffer.readUInt32BE(_offset);
_offset += 4;
return value;
}

Parser.prototype.parseGeometry = function() {
var length = this.parseLengthCodedNumber();
var end = this._offset + length;
var result = null;

this._offset += 4; // skip four bytes
this._byteOrder = this.readUInt8();
var wkbType = this.readUInt32();
var x = this.readUInt32();
var y = this.readUInt32();
result = {x:x, y:y};

this._offset = end;
return result;
}
```

It seems that parsing WKBGeometry type is different work from parsing MySQL packet.

So, I just move the code from RowDataPacket.js to Parser.js as only a function.

How about this patch?