1
by brian
clean slate |
1 |
/******************************************************
|
2 |
SQL evaluator: evaluates simple data structures, like expressions, in
|
|
3 |
a query graph
|
|
4 |
||
5 |
(c) 1997 Innobase Oy
|
|
6 |
||
7 |
Created 12/29/1997 Heikki Tuuri
|
|
8 |
*******************************************************/
|
|
9 |
||
10 |
#ifndef eval0eval_h
|
|
11 |
#define eval0eval_h
|
|
12 |
||
13 |
#include "univ.i" |
|
14 |
#include "que0types.h" |
|
15 |
#include "pars0sym.h" |
|
16 |
#include "pars0pars.h" |
|
17 |
||
18 |
/*********************************************************************
|
|
19 |
Free the buffer from global dynamic memory for a value of a que_node,
|
|
20 |
if it has been allocated in the above function. The freeing for pushed
|
|
21 |
column values is done in sel_col_prefetch_buf_free. */
|
|
22 |
||
23 |
void
|
|
24 |
eval_node_free_val_buf( |
|
25 |
/*===================*/
|
|
26 |
que_node_t* node); /* in: query graph node */ |
|
27 |
/*********************************************************************
|
|
28 |
Evaluates a symbol table symbol. */
|
|
29 |
UNIV_INLINE
|
|
30 |
void
|
|
31 |
eval_sym( |
|
32 |
/*=====*/
|
|
33 |
sym_node_t* sym_node); /* in: symbol table node */ |
|
34 |
/*********************************************************************
|
|
35 |
Evaluates an expression. */
|
|
36 |
UNIV_INLINE
|
|
37 |
void
|
|
38 |
eval_exp( |
|
39 |
/*=====*/
|
|
40 |
que_node_t* exp_node); /* in: expression */ |
|
41 |
/*********************************************************************
|
|
42 |
Sets an integer value as the value of an expression node. */
|
|
43 |
UNIV_INLINE
|
|
44 |
void
|
|
45 |
eval_node_set_int_val( |
|
46 |
/*==================*/
|
|
47 |
que_node_t* node, /* in: expression node */ |
|
48 |
lint val); /* in: value to set */ |
|
49 |
/*********************************************************************
|
|
50 |
Gets an integer value from an expression node. */
|
|
51 |
UNIV_INLINE
|
|
52 |
lint
|
|
53 |
eval_node_get_int_val( |
|
54 |
/*==================*/
|
|
55 |
/* out: integer value */
|
|
56 |
que_node_t* node); /* in: expression node */ |
|
57 |
/*********************************************************************
|
|
58 |
Copies a binary string value as the value of a query graph node. Allocates a
|
|
59 |
new buffer if necessary. */
|
|
60 |
UNIV_INLINE
|
|
61 |
void
|
|
62 |
eval_node_copy_and_alloc_val( |
|
63 |
/*=========================*/
|
|
64 |
que_node_t* node, /* in: query graph node */ |
|
65 |
byte* str, /* in: binary string */ |
|
66 |
ulint len); /* in: string length or UNIV_SQL_NULL */ |
|
67 |
/*********************************************************************
|
|
68 |
Copies a query node value to another node. */
|
|
69 |
UNIV_INLINE
|
|
70 |
void
|
|
71 |
eval_node_copy_val( |
|
72 |
/*===============*/
|
|
73 |
que_node_t* node1, /* in: node to copy to */ |
|
74 |
que_node_t* node2); /* in: node to copy from */ |
|
75 |
/*********************************************************************
|
|
76 |
Gets a iboolean value from a query node. */
|
|
77 |
UNIV_INLINE
|
|
78 |
ibool
|
|
79 |
eval_node_get_ibool_val( |
|
80 |
/*====================*/
|
|
81 |
/* out: iboolean value */
|
|
82 |
que_node_t* node); /* in: query graph node */ |
|
83 |
/*********************************************************************
|
|
84 |
Evaluates a comparison node. */
|
|
85 |
||
86 |
ibool
|
|
87 |
eval_cmp( |
|
88 |
/*=====*/
|
|
89 |
/* out: the result of the comparison */
|
|
90 |
func_node_t* cmp_node); /* in: comparison node */ |
|
91 |
||
92 |
||
93 |
#ifndef UNIV_NONINL
|
|
94 |
#include "eval0eval.ic" |
|
95 |
#endif
|
|
96 |
||
97 |
#endif
|