InnoDB Plugin
1.0
Main Page
Data Structures
Files
File List
Globals
include
pars0sym.h
Go to the documentation of this file.
1
/*****************************************************************************
2
3
Copyright (c) 1997, 2009, Oracle and/or its affiliates. All Rights Reserved.
4
5
This program is free software; you can redistribute it and/or modify it under
6
the terms of the GNU General Public License as published by the Free Software
7
Foundation; version 2 of the License.
8
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13
You should have received a copy of the GNU General Public License along with
14
this program; if not, write to the Free Software Foundation, Inc.,
15
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16
17
*****************************************************************************/
18
19
/**************************************************/
26
#ifndef pars0sym_h
27
#define pars0sym_h
28
29
#include "
univ.i
"
30
#include "
que0types.h
"
31
#include "
usr0types.h
"
32
#include "
dict0types.h
"
33
#include "
pars0types.h
"
34
#include "
row0types.h
"
35
36
/******************************************************************/
39
UNIV_INTERN
40
sym_tab_t
*
41
sym_tab_create
(
42
/*===========*/
43
mem_heap_t
* heap);
44
/******************************************************************/
48
UNIV_INTERN
49
void
50
sym_tab_free_private
(
51
/*=================*/
52
sym_tab_t
* sym_tab);
53
/******************************************************************/
56
UNIV_INTERN
57
sym_node_t
*
58
sym_tab_add_int_lit
(
59
/*================*/
60
sym_tab_t
* sym_tab,
61
ulint val);
62
/******************************************************************/
65
UNIV_INTERN
66
sym_node_t
*
67
sym_tab_add_str_lit
(
68
/*================*/
69
sym_tab_t
* sym_tab,
70
const
byte* str,
72
ulint len);
73
/******************************************************************/
76
UNIV_INTERN
77
sym_node_t
*
78
sym_tab_add_bound_lit
(
79
/*==================*/
80
sym_tab_t
* sym_tab,
81
const
char
* name,
82
ulint* lit_type);
83
/**********************************************************************
84
Rebind literal to a node in the symbol table. */
85
86
sym_node_t
*
87
sym_tab_rebind_lit(
88
/*===============*/
89
/* out: symbol table node */
90
sym_node_t
* node,
/* in: node that is bound to literal*/
91
const
void
* address,
/* in: pointer to data */
92
ulint length);
/* in: length of data */
93
/******************************************************************/
96
UNIV_INTERN
97
sym_node_t
*
98
sym_tab_add_null_lit
(
99
/*=================*/
100
sym_tab_t
* sym_tab);
101
/******************************************************************/
104
UNIV_INTERN
105
sym_node_t
*
106
sym_tab_add_id
(
107
/*===========*/
108
sym_tab_t
* sym_tab,
109
byte* name,
110
ulint len);
112
/******************************************************************/
115
UNIV_INTERN
116
sym_node_t
*
117
sym_tab_add_bound_id
(
118
/*===========*/
119
sym_tab_t
* sym_tab,
120
const
char
* name);
123
#define SYM_CLUST_FIELD_NO 0
124
125
#define SYM_SEC_FIELD_NO 1
126
128
enum
sym_tab_entry
{
129
SYM_UNSET
,
130
SYM_VAR
= 91,
132
SYM_IMPLICIT_VAR
,
134
SYM_LIT
,
135
SYM_TABLE_REF_COUNTED
,
137
SYM_TABLE
,
138
SYM_COLUMN
,
139
SYM_CURSOR
,
140
SYM_PROCEDURE_NAME
,
141
SYM_INDEX
,
142
SYM_FUNCTION
143
};
144
146
struct
sym_node_t
{
147
que_common_t
common
;
149
/* NOTE: if the data field in 'common.val' is not NULL and the symbol
150
table node is not for a temporary column, the memory for the value has
151
been allocated from dynamic memory and it should be freed when the
152
symbol table is discarded */
153
154
/* 'alias' and 'indirection' are almost the same, but not quite.
155
'alias' always points to the primary instance of the variable, while
156
'indirection' does the same only if we should use the primary
157
instance's values for the node's data. This is usually the case, but
158
when initializing a cursor (e.g., "DECLARE CURSOR c IS SELECT * FROM
159
t WHERE id = x;"), we copy the values from the primary instance to
160
the cursor's instance so that they are fixed for the duration of the
161
cursor, and set 'indirection' to NULL. If we did not, the value of
162
'x' could change between fetches and things would break horribly.
163
164
TODO: It would be cleaner to make 'indirection' a boolean field and
165
always use 'alias' to refer to the primary node. */
166
167
sym_node_t
*
indirection
;
172
sym_node_t
*
alias
;
177
UT_LIST_NODE_T(
sym_node_t
)
col_var_list
;
181
ibool
copy_val
;
185
ulint
field_nos
[2];
197
ibool
resolved
;
202
enum
sym_tab_entry
token_type
;
204
const
char
*
name
;
205
ulint
name_len
;
206
dict_table_t
*
table
;
209
ulint
col_no
;
211
sel_buf_t
*
prefetch_buf
;
215
sel_node_t
*
cursor_def
;
218
ulint
param_type
;
222
sym_tab_t
*
sym_table
;
224
UT_LIST_NODE_T(
sym_node_t
)
sym_list
;
226
sym_node_t
* like_node;
/* LIKE operator node*/
227
};
228
230
struct
sym_tab_t
{
231
que_t
* query_graph;
234
const
char
* sql_string;
236
size_t
string_len;
238
int
next_char_pos;
242
pars_info_t
*
info
;
243
sym_node_list_t
sym_list
;
246
UT_LIST_BASE_NODE_T(
func_node_t
)
247
func_node_list;
250
mem_heap_t
* heap;
252
};
253
254
#ifndef UNIV_NONINL
255
#include "
pars0sym.ic
"
256
#endif
257
258
#endif
Generated on Fri Aug 21 2015 19:14:24 for InnoDB Plugin by
1.8.1.2