MySQL 8.3.0
Source Code Documentation
DD_instant_col_val_coder Class Reference

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 bytedecode (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

bytem_result
 The encoded or decoded stream. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DD_instant_col_val_coder()

DD_instant_col_val_coder::DD_instant_col_val_coder ( )
inline

Constructor.

◆ ~DD_instant_col_val_coder()

DD_instant_col_val_coder::~DD_instant_col_val_coder ( )
inline

Destructor.

Member Function Documentation

◆ cleanup()

void DD_instant_col_val_coder::cleanup ( void  )
inlineprivate

Clean-up last result.

◆ decode()

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()

Parameters
[in]streamstream to decode in chars
[in]in_lenlength of the stream
[out]out_lenlength of the decoded stream
Returns
the decoded stream, which would be destroyed if the class itself is destroyed

◆ encode()

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.

Parameters
[in]streamstream to encode in bytes
[in]in_lenlength of the stream
[out]out_lenlength of the encoded stream
Returns
the encoded stream, which would be destroyed if the class itself is destroyed

Member Data Documentation

◆ m_result

byte* DD_instant_col_val_coder::m_result
private

The encoded or decoded stream.


The documentation for this class was generated from the following files: