mysql.protocol.packet_helpers

Internal - Helper functions for the communication protocol.

Members

Functions

consume
T consume(MySQLSocket conn)
Undocumented in source. Be warned that the author may not have intended to support it.
consume
string consume(ubyte[] packet)
Undocumented in source. Be warned that the author may not have intended to support it.
consume
string consume(ubyte[] packet, size_t N)
Undocumented in source.
consume
ubyte[] consume(ubyte[] packet, size_t N)

Returns N number of bytes from the packet and advances the array

consume
T consume(ubyte[] packet, int n)
Undocumented in source. Be warned that the author may not have intended to support it.
consume
TimeOfDay consume(ubyte[] packet)
Undocumented in source.
consume
Date consume(ubyte[] packet)
Undocumented in source.
consume
DateTime consume(ubyte[] packet)
Undocumented in source.
consume
T consume(ubyte[] packet)
Undocumented in source.
consume
T consume(ubyte[] packet)
Undocumented in source.
consume
string consume(ubyte[] packet)

Parse Length Coded String

consumeBinaryValueIfComplete
SQLValue consumeBinaryValueIfComplete(ubyte[] packet, bool unsigned)
Undocumented in source. Be warned that the author may not have intended to support it.
consumeIfComplete
SQLValue consumeIfComplete(ubyte[] packet, bool binary, bool unsigned)
Undocumented in source. Be warned that the author may not have intended to support it.
consumeIfComplete
SQLValue consumeIfComplete(ubyte[] packet, SQLType sqlType, bool binary, bool unsigned, ushort charSet)
Undocumented in source. Be warned that the author may not have intended to support it.
consumeIfComplete
T consumeIfComplete(ubyte[] packet)

Decodes a Length Coded Binary from a packet

consumeNonBinaryValueIfComplete
SQLValue consumeNonBinaryValueIfComplete(ubyte[] packet, bool unsigned)
Undocumented in source. Be warned that the author may not have intended to support it.
decode
T decode(ubyte[] packet, size_t n)
Undocumented in source. Be warned that the author may not have intended to support it.
decode
T decode(ubyte[] packet)
Undocumented in source.
decode
T decode(ubyte[] packet)
Undocumented in source.
decode
LCB decode(ubyte[] packet)

Decodes a Length Coded Binary from a packet

decodeLCBHeader
LCB decodeLCBHeader(ubyte[] packet)
Undocumented in source.
getNumLCBBytes
byte getNumLCBBytes(ubyte lcbHeader)

Extract number of bytes used for this LCB

myto
T myto(string value)
Undocumented in source. Be warned that the author may not have intended to support it.
pack
ubyte[] pack(TimeOfDay tod)

Function to pack a TimeOfDay into a binary encoding for transmission to the server.

pack
ubyte[] pack(Date dt)

Function to pack a Date into a binary encoding for transmission to the server.

pack
ubyte[] pack(DateTime dt)

Function to pack a DateTime into a binary encoding for transmission to the server.

packInto
void packInto(T value, ubyte[] array)

Converts a value into a sequence of bytes and fills the supplied array.

packLCS
ubyte[] packLCS(void[] a)
Undocumented in source. Be warned that the author may not have intended to support it.
packLength
ubyte[] packLength(size_t l, size_t offset)
Undocumented in source.
setPacketHeader
void setPacketHeader(ubyte[] packet, ubyte packetNumber)

Set packet length and number. It's important that the length of packet has already been set to the final state as its length is used.

setPacketHeader
void setPacketHeader(ubyte[] packet, ubyte packetNumber, uint dataLength)
Undocumented in source.
skip
T[] skip(T[] array, size_t n)

Skips over n items, advances the array, and return the newly advanced array to allow method chaining.

toDate
Date toDate(ubyte[] a)

Function to extract a Date from a binary encoded row.

toDate
Date toDate(string s)

Function to extract a Date from a text encoded column value.

toDateTime
DateTime toDateTime(ubyte[] a)

Function to extract a DateTime from a binary encoded row.

toDateTime
DateTime toDateTime(string s)

Function to extract a DateTime from a text encoded column value.

toDateTime
DateTime toDateTime(ulong x)

Function to extract a DateTime from a ulong.

toTimeDiff
TimeDiff toTimeDiff(ubyte[] a)

Function to extract a time difference from a binary encoded row.

toTimeDiff
TimeDiff toTimeDiff(string s)

Function to extract a time difference from a text encoded column value.

toTimeOfDay
TimeOfDay toTimeOfDay(ubyte[] a)

Function to extract a TimeOfDay from a binary encoded row.

toTimeOfDay
TimeOfDay toTimeOfDay(string s)

Function to extract a TimeOfDay from a text encoded column value.

Properties

hasEnoughBytes
bool hasEnoughBytes [@property getter]
Undocumented in source.

Meta