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