MySQL 26.7.0
Source Code Documentation
eval0eval.cc File Reference

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

#include "eval0eval.h"
#include "data0data.h"
#include "rem0cmp.h"
#include "row0sel.h"

Functions

static que_node_t * que_node_get_like_node (que_node_t *node)
 
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. More...
 
void eval_node_free_val_buf (que_node_t *node)
 Free the buffer from global dynamic memory for a value of a que_node, if it has been allocated in the above function. More...
 
static bool eval_cmp_like (que_node_t *arg1, que_node_t *arg2)
 
bool eval_cmp (func_node_t *cmp_node)
 Evaluates a comparison node. More...
 
static void eval_logical (func_node_t *logical_node)
 Evaluates a logical operation node. More...
 
static void eval_arith (func_node_t *arith_node)
 Evaluates an arithmetic operation node. More...
 
static void eval_aggregate (func_node_t *node)
 Evaluates an aggregate operation node. More...
 
static void eval_notfound (func_node_t *func_node)
 Evaluates a notfound-function node. More...
 
static void eval_substr (func_node_t *func_node)
 Evaluates a substr-function node. More...
 
static void eval_instr (func_node_t *func_node)
 Evaluates an instr-function node. More...
 
static void eval_concat (func_node_t *func_node)
 Evaluates a predefined function node. More...
 
static void eval_to_binary (func_node_t *func_node)
 Evaluates a predefined function node. More...
 
static void eval_length (func_node_t *func_node)
 Evaluate the predefined LENGTH function. More...
 
void eval_func (func_node_t *func_node)
 Evaluates a function node. More...
 

Variables

static byte eval_dummy
 Dummy address used when we should allocate a buffer of size 0 in eval_node_alloc_val_buf. More...
 

Detailed Description

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

Created 12/29/1997 Heikki Tuuri

Function Documentation

◆ eval_aggregate()

static void eval_aggregate ( func_node_t *  node)
inlinestatic

Evaluates an aggregate operation node.

Parameters
nodein: aggregate operation node

◆ eval_arith()

static void eval_arith ( func_node_t *  arith_node)
inlinestatic

Evaluates an arithmetic operation node.

Parameters
arith_nodein: arithmetic operation node

◆ eval_cmp()

bool eval_cmp ( func_node_t *  cmp_node)

Evaluates a comparison node.

Returns
the result of the comparison in: comparison node
Parameters
cmp_nodein: comparison node

◆ eval_cmp_like()

static bool eval_cmp_like ( que_node_t *  arg1,
que_node_t *  arg2 
)
inlinestatic

◆ eval_concat()

static void eval_concat ( func_node_t *  func_node)
static

Evaluates a predefined function node.

Parameters
func_nodein: function node

◆ eval_func()

void eval_func ( func_node_t *  func_node)

Evaluates a function node.

in: function node

Parameters
func_nodein: function node

◆ eval_instr()

static void eval_instr ( func_node_t *  func_node)
static

Evaluates an instr-function node.

Parameters
func_nodein: function node

◆ eval_length()

static void eval_length ( func_node_t *  func_node)
inlinestatic

Evaluate the predefined LENGTH function.

Parameters
func_nodein: function node

◆ eval_logical()

static void eval_logical ( func_node_t *  logical_node)
inlinestatic

Evaluates a logical operation node.

Parameters
logical_nodein: logical operation 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 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_free_val_buf()

void eval_node_free_val_buf ( que_node_t *  node)

Free the buffer from global dynamic memory for a value of a que_node, if it has been allocated in the above function.

The freeing for pushed column values is done in sel_col_prefetch_buf_free.

Parameters
nodein: query graph node

◆ eval_notfound()

static void eval_notfound ( func_node_t *  func_node)
inlinestatic

Evaluates a notfound-function node.

Parameters
func_nodein: function node

◆ eval_substr()

static void eval_substr ( func_node_t *  func_node)
inlinestatic

Evaluates a substr-function node.

Parameters
func_nodein: function node

◆ eval_to_binary()

static void eval_to_binary ( func_node_t *  func_node)
inlinestatic

Evaluates a predefined function node.

If the first argument is an integer, this function looks at the second argument which is the integer length in bytes, and converts the integer to a VARCHAR. If the first argument is of some other type, this function converts it to BINARY.

Parameters
func_nodein: function node

◆ que_node_get_like_node()

static que_node_t * que_node_get_like_node ( que_node_t *  node)
inlinestatic

Variable Documentation

◆ eval_dummy

byte eval_dummy
static

Dummy address used when we should allocate a buffer of size 0 in eval_node_alloc_val_buf.