MySQL 9.5.0
Source Code Documentation
sql_digest_state Struct Reference

State data storage for digest_start, digest_add_token. More...

#include <sql_digest_stream.h>

Public Member Functions

void reset (unsigned char *token_array, uint length)
 
bool is_empty ()
 

Public Attributes

int m_last_peekable_index
 Index, in the digest token array, of the last peekable position. More...
 
sql_digest_storage m_digest_storage
 

Detailed Description

State data storage for digest_start, digest_add_token.

This structure extends the sql_digest_storage structure with temporary state used only during parsing.

Member Function Documentation

◆ is_empty()

bool sql_digest_state::is_empty ( void  )
inline

◆ reset()

void sql_digest_state::reset ( unsigned char *  token_array,
uint  length 
)
inline

Member Data Documentation

◆ m_digest_storage

sql_digest_storage sql_digest_state::m_digest_storage

◆ m_last_peekable_index

int sql_digest_state::m_last_peekable_index

Index, in the digest token array, of the last peekable position.

Reduce rules used in the digest computation can not apply to tokens seen before an identifier, because an identifier uses a variable length storage. Likewise, peek code can not backtrack before a by numeric column token, because of the extra value stored. Fortunately, once an id or a by numeric column token is stored, no additional rule will reduce this further, so there is never a need to backtrack in the digest stream on variable length records.

See also
digest_add_token

The documentation for this struct was generated from the following file: