MySQL 8.3.0
Source Code Documentation
eval0eval.ic File Reference

SQL evaluator: evaluates simple data structures, like expressions, in a query graph. More...

#include "pars0grm.h"
#include "que0que.h"
#include "rem0cmp.h"

Functions

void eval_func (func_node_t *func_node)
 Evaluates a function node. More...
 
byteeval_node_alloc_val_buf (que_node_t *node, ulint size)
 Allocate a buffer from global dynamic memory for a value of a que_node. More...
 
static byteeval_node_ensure_val_buf (que_node_t *node, ulint size)
 Allocates a new buffer if needed. More...
 
static void eval_sym (sym_node_t *sym_node)
 Evaluates a symbol table symbol. More...
 
static void eval_exp (que_node_t *exp_node)
 Evaluates an expression. More...
 
static void eval_node_set_int_val (que_node_t *node, lint val)
 Sets an integer value as the value of an expression node. More...
 
static lint eval_node_get_int_val (que_node_t *node)
 Gets an integer non-SQL null value from an expression node. More...
 
static bool eval_node_get_bool_val (que_node_t *node)
 Gets a boolean value from a query node. More...
 
static void eval_node_set_bool_val (func_node_t *func_node, bool val)
 Sets a boolean value as the value of a function node. More...
 
static void eval_node_copy_and_alloc_val (que_node_t *node, const byte *str, ulint len)
 Copies a binary string value as the value of a query graph node. More...
 
static void eval_node_copy_val (que_node_t *node1, que_node_t *node2)
 Copies a query node value to another node. More...
 

Detailed Description

SQL evaluator: evaluates simple data structures, like expressions, in a query graph.

Created 12/29/1997 Heikki Tuuri

Function Documentation

◆ eval_exp()

static void eval_exp ( que_node_t exp_node)
inlinestatic

Evaluates an expression.

Parameters
exp_nodein: expression

◆ eval_func()

void eval_func ( func_node_t func_node)

Evaluates a function node.

in: function node

Parameters
func_nodein: function node

◆ eval_node_alloc_val_buf()

byte * eval_node_alloc_val_buf ( que_node_t node,
ulint  size 
)

Allocate a buffer from global dynamic memory for a value of a que_node.

NOTE that this memory must be explicitly freed when the query graph is freed. If the node already has allocated buffer, that buffer is freed here. NOTE that this is the only function where dynamic memory should be allocated for a query node val field.

Returns
pointer to allocated buffer in: buffer size

NOTE that this memory must be explicitly freed when the query graph is freed. If the node already has an allocated buffer, that buffer is freed here. NOTE that this is the only function where dynamic memory should be allocated for a query node val field.

Returns
pointer to allocated buffer
Parameters
nodein: query graph node; sets the val field data field to point to the new buffer, and len field equal to size
sizein: buffer size

◆ eval_node_copy_and_alloc_val()

static void eval_node_copy_and_alloc_val ( que_node_t node,
const byte str,
ulint  len 
)
inlinestatic

Copies a binary string value as the value of a query graph node.

Allocates a new buffer if necessary.

Parameters
nodein: query graph node
strin: binary string
lenin: string length or UNIV_SQL_NULL

◆ eval_node_copy_val()

static void eval_node_copy_val ( que_node_t node1,
que_node_t node2 
)
inlinestatic

Copies a query node value to another node.

Parameters
node1in: node to copy to
node2in: node to copy from

◆ eval_node_ensure_val_buf()

static byte * eval_node_ensure_val_buf ( que_node_t node,
ulint  size 
)
inlinestatic

Allocates a new buffer if needed.

Returns
pointer to buffer
Parameters
nodein: query graph node; sets the val field data field to point to the new buffer, and len field equal to size
sizein: buffer size

◆ eval_node_get_bool_val()

static bool eval_node_get_bool_val ( que_node_t node)
inlinestatic

Gets a boolean value from a query node.

Returns
boolean value
Parameters
nodein: query graph node

◆ eval_node_get_int_val()

static lint eval_node_get_int_val ( que_node_t node)
inlinestatic

Gets an integer non-SQL null value from an expression node.

Returns
integer value
Parameters
nodein: expression node

◆ eval_node_set_bool_val()

static void eval_node_set_bool_val ( func_node_t func_node,
bool  val 
)
inlinestatic

Sets a boolean value as the value of a function node.

Parameters
func_nodein: function node
valin: value to set

◆ eval_node_set_int_val()

static void eval_node_set_int_val ( que_node_t node,
lint  val 
)
inlinestatic

Sets an integer value as the value of an expression node.

Parameters
nodein: expression node
valin: value to set

◆ eval_sym()

static void eval_sym ( sym_node_t sym_node)
inlinestatic

Evaluates a symbol table symbol.

Parameters
sym_nodein: symbol table node