MySQL 8.4.2
Source Code Documentation
|
Class to decode or encode a stream of default value for instant table. More...
#include <dict0dd.h>
Public Member Functions | |
DD_instant_col_val_coder () | |
Constructor. More... | |
~DD_instant_col_val_coder () | |
Destructor. More... | |
const char * | encode (const byte *stream, size_t in_len, size_t *out_len) |
Encode the specified stream in format of bytes into chars. More... | |
const byte * | decode (const char *stream, size_t in_len, size_t *out_len) |
Decode the specified stream, which is encoded by encode() More... | |
Private Member Functions | |
void | cleanup () |
Clean-up last result. More... | |
Private Attributes | |
byte * | m_result |
The encoded or decoded stream. More... | |
Class to decode or encode a stream of default value for instant table.
The decode/encode are necessary because that the default values would b kept as InnoDB format stream, which is in fact byte stream. However, to store them in the DD se_private_data, it requires text(char). So basically, the encode will change the byte stream into char stream, by splitting every byte into two chars, for example, 0xFF, would be split into 0x0F and 0x0F. So the final storage space would be double. For the decode, it's the converse process, combining two chars into one byte.
|
inline |
Constructor.
|
inline |
Destructor.
|
inlineprivate |
Clean-up last result.
const byte * DD_instant_col_val_coder::decode | ( | const char * | stream, |
size_t | in_len, | ||
size_t * | out_len | ||
) |
Decode the specified stream, which is encoded by encode()
[in] | stream | stream to decode in chars |
[in] | in_len | length of the stream |
[out] | out_len | length of the decoded stream |
const char * DD_instant_col_val_coder::encode | ( | const byte * | stream, |
size_t | in_len, | ||
size_t * | out_len | ||
) |
Encode the specified stream in format of bytes into chars.
[in] | stream | stream to encode in bytes |
[in] | in_len | length of the stream |
[out] | out_len | length of the encoded stream |
|
private |
The encoded or decoded stream.