MySQL 8.0.40
Source Code Documentation
ExecutionContext::SystemVariables Class Reference

system-variables as returned by the server. More...

#include <sql_exec_context.h>

Public Types

using key_type = std::string
 
using value_type = Value
 
using iterator = std::map< key_type, value_type >::iterator
 
using const_iterator = std::map< key_type, value_type >::const_iterator
 

Public Member Functions

void set (key_type k, value_type v)
 set k to v. More...
 
std::optional< value_typefind (const key_type &k) const
 find 'k' in sytem-vars. More...
 
value_type get (const key_type &k) const
 get 'k' from system-vars. More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
bool empty () const
 check if their is a no system-var. More...
 

Private Attributes

std::map< key_type, value_typevars_
 

Detailed Description

system-variables as returned by the server.

can be queried from the server with:

  • SELECT @SESSION.{k}
  • SELECT @LOCAL.{k}

can be set on the server with:

  • SET k = v;
  • SET @SESSION.k = v;
  • SET @LOCAL.k = v;
  • SET SESSION k = v;
  • SET LOCAL k = v;

changes to system-vars on the server are returned via the sesssion-tracker for system-variables.

Member Typedef Documentation

◆ const_iterator

◆ iterator

◆ key_type

◆ value_type

Member Function Documentation

◆ begin() [1/2]

iterator ExecutionContext::SystemVariables::begin ( )
inline

◆ begin() [2/2]

const_iterator ExecutionContext::SystemVariables::begin ( ) const
inline

◆ empty()

bool ExecutionContext::SystemVariables::empty ( ) const
inline

check if their is a no system-var.

◆ end() [1/2]

iterator ExecutionContext::SystemVariables::end ( )
inline

◆ end() [2/2]

const_iterator ExecutionContext::SystemVariables::end ( ) const
inline

◆ find()

std::optional< value_type > ExecutionContext::SystemVariables::find ( const key_type k) const
inline

find 'k' in sytem-vars.

Parameters
kkey

if 'k' does not exist in system-vars, a NULL-like value is returned. otherwise return the value for the system-var referenced by 'k'

Returns
std::nullopt if key is not found, the found value otherwise.

◆ get()

value_type ExecutionContext::SystemVariables::get ( const key_type k) const
inline

get 'k' from system-vars.

Parameters
kkey

if 'k' does not exist in system-vars, a NULL-like value is returned. otherwise return the value for the system-var referenced by 'k' which may be NULL-like or a string.

Returns
std::nullopt if key is not found or value is NULL-like, the found value otherwise

◆ set()

void ExecutionContext::SystemVariables::set ( key_type  k,
value_type  v 
)
inline

set k to v.

if k doesn't exist in the system-vars yet, it gets inserted.

Member Data Documentation

◆ vars_

std::map<key_type, value_type> ExecutionContext::SystemVariables::vars_
private

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