MySQL 8.0.39
Source Code Documentation
eval0eval.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 1997, 2024, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is designed to work with certain software (including
10but not limited to OpenSSL) that is licensed under separate terms,
11as designated in a particular file or component or in included license
12documentation. The authors of MySQL hereby grant you an additional
13permission to link the program and your derivative works with the
14separately licensed software that they have either included with
15the program or referenced in the documentation.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
20for more details.
21
22You should have received a copy of the GNU General Public License along with
23this program; if not, write to the Free Software Foundation, Inc.,
2451 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26*****************************************************************************/
27
28/** @file include/eval0eval.h
29 SQL evaluator: evaluates simple data structures, like expressions, in
30 a query graph
31
32 Created 12/29/1997 Heikki Tuuri
33 *******************************************************/
34
35#ifndef eval0eval_h
36#define eval0eval_h
37
38#include "pars0pars.h"
39#include "pars0sym.h"
40#include "que0types.h"
41#include "univ.i"
42
43/** Free the buffer from global dynamic memory for a value of a que_node,
44 if it has been allocated in the above function. The freeing for pushed
45 column values is done in sel_col_prefetch_buf_free. */
46void eval_node_free_val_buf(que_node_t *node); /*!< in: query graph node */
47/** Evaluates a symbol table symbol. */
48static inline void eval_sym(sym_node_t *sym_node); /*!< in: symbol table node */
49/** Evaluates an expression. */
50static inline void eval_exp(que_node_t *exp_node); /*!< in: expression */
51
52/** Sets an integer value as the value of an expression node.
53@param[in] node expression node
54@param[in] val value to set */
55static inline void eval_node_set_int_val(que_node_t *node, lint val);
56
57/** Gets an integer value from an expression node.
58 @return integer value */
60 que_node_t *node); /*!< in: expression node */
61
62/** Copies a binary string value as the value of a query graph node. Allocates
63a new buffer if necessary.
64@param[in] node query graph node
65@param[in] str binary string
66@param[in] len string length or UNIV_SQL_NULL */
68 const byte *str, ulint len);
69
70/** Copies a query node value to another node.
71@param[in] node1 node to copy to
72@param[in] node2 node to copy from */
73static inline void eval_node_copy_val(que_node_t *node1, que_node_t *node2);
74
75/** Gets a boolean value from a query node.
76 @return boolean value */
77static inline bool eval_node_get_bool_val(
78 que_node_t *node); /*!< in: query graph node */
79/** Evaluates a comparison node.
80 @return the result of the comparison */
81bool eval_cmp(func_node_t *cmp_node); /*!< in: comparison node */
82
83#include "eval0eval.ic"
84
85#endif
bool eval_cmp(func_node_t *cmp_node)
Evaluates a comparison node.
Definition: eval0eval.cc:155
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.
static void eval_node_set_int_val(que_node_t *node, lint val)
Sets an integer value as the value of an expression node.
static void eval_exp(que_node_t *exp_node)
Evaluates an expression.
static void eval_node_copy_val(que_node_t *node1, que_node_t *node2)
Copies a query node value to another node.
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...
Definition: eval0eval.cc:99
static lint eval_node_get_int_val(que_node_t *node)
Gets an integer value from an expression node.
static bool eval_node_get_bool_val(que_node_t *node)
Gets a boolean value from a query node.
static void eval_sym(sym_node_t *sym_node)
Evaluates a symbol table symbol.
SQL evaluator: evaluates simple data structures, like expressions, in a query graph.
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
SQL parser.
SQL parser symbol table.
Query graph global types.
void que_node_t
Definition: que0types.h:41
A predefined function or operator node in a parsing tree; this construct is also used for some non-fu...
Definition: pars0pars.h:497
Symbol table node.
Definition: pars0sym.h:113
Version control for database, common definitions, and include files.
unsigned long int ulint
Definition: univ.i:406
long int lint
Definition: univ.i:407