~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/que0que.h

Tags: innodb-plugin-1.0.3
InnoDB Plugin 1.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1996, 2009, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
12
 
13
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., 51 Franklin
15
 
St, Fifth Floor, Boston, MA 02110-1301 USA
 
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
19
 
/**************************************************//**
20
 
@file include/que0que.h
 
19
/******************************************************
21
20
Query graph
22
21
 
23
22
Created 5/27/1996 Heikki Tuuri
30
29
#include "data0data.h"
31
30
#include "dict0types.h"
32
31
#include "trx0trx.h"
33
 
#include "trx0roll.h"
34
32
#include "srv0srv.h"
35
33
#include "usr0types.h"
36
34
#include "que0types.h"
41
39
of SQL execution in the UNIV_SQL_DEBUG version */
42
40
extern ibool    que_trace_on;
43
41
 
44
 
/***********************************************************************//**
 
42
/***************************************************************************
45
43
Adds a query graph to the session's list of graphs. */
46
44
UNIV_INTERN
47
45
void
48
46
que_graph_publish(
49
47
/*==============*/
50
 
        que_t*  graph,  /*!< in: graph */
51
 
        sess_t* sess);  /*!< in: session */
52
 
/***********************************************************************//**
53
 
Creates a query graph fork node.
54
 
@return own: fork node */
 
48
        que_t*  graph,  /* in: graph */
 
49
        sess_t* sess);  /* in: session */
 
50
/***************************************************************************
 
51
Creates a query graph fork node. */
55
52
UNIV_INTERN
56
53
que_fork_t*
57
54
que_fork_create(
58
55
/*============*/
59
 
        que_t*          graph,          /*!< in: graph, if NULL then this
 
56
                                        /* out, own: fork node */
 
57
        que_t*          graph,          /* in: graph, if NULL then this
60
58
                                        fork node is assumed to be the
61
59
                                        graph root */
62
 
        que_node_t*     parent,         /*!< in: parent node */
63
 
        ulint           fork_type,      /*!< in: fork type */
64
 
        mem_heap_t*     heap);          /*!< in: memory heap where created */
65
 
/***********************************************************************//**
 
60
        que_node_t*     parent,         /* in: parent node */
 
61
        ulint           fork_type,      /* in: fork type */
 
62
        mem_heap_t*     heap);          /* in: memory heap where created */
 
63
/***************************************************************************
66
64
Gets the first thr in a fork. */
67
65
UNIV_INLINE
68
66
que_thr_t*
69
67
que_fork_get_first_thr(
70
68
/*===================*/
71
 
        que_fork_t*     fork);  /*!< in: query fork */
72
 
/***********************************************************************//**
 
69
        que_fork_t*     fork);  /* in: query fork */
 
70
/***************************************************************************
73
71
Gets the child node of the first thr in a fork. */
74
72
UNIV_INLINE
75
73
que_node_t*
76
74
que_fork_get_child(
77
75
/*===============*/
78
 
        que_fork_t*     fork);  /*!< in: query fork */
79
 
/***********************************************************************//**
 
76
        que_fork_t*     fork);  /* in: query fork */
 
77
/***************************************************************************
80
78
Sets the parent of a graph node. */
81
79
UNIV_INLINE
82
80
void
83
81
que_node_set_parent(
84
82
/*================*/
85
 
        que_node_t*     node,   /*!< in: graph node */
86
 
        que_node_t*     parent);/*!< in: parent */
87
 
/***********************************************************************//**
88
 
Creates a query graph thread node.
89
 
@return own: query thread node */
 
83
        que_node_t*     node,   /* in: graph node */
 
84
        que_node_t*     parent);/* in: parent */
 
85
/***************************************************************************
 
86
Creates a query graph thread node. */
90
87
UNIV_INTERN
91
88
que_thr_t*
92
89
que_thr_create(
93
90
/*===========*/
94
 
        que_fork_t*     parent, /*!< in: parent node, i.e., a fork node */
95
 
        mem_heap_t*     heap);  /*!< in: memory heap where created */
96
 
/**********************************************************************//**
 
91
                                /* out, own: query thread node */
 
92
        que_fork_t*     parent, /* in: parent node, i.e., a fork node */
 
93
        mem_heap_t*     heap);  /* in: memory heap where created */
 
94
/**************************************************************************
 
95
Checks if the query graph is in a state where it should be freed, and
 
96
frees it in that case. If the session is in a state where it should be
 
97
closed, also this is done. */
 
98
UNIV_INTERN
 
99
ibool
 
100
que_graph_try_free(
 
101
/*===============*/
 
102
                        /* out: TRUE if freed */
 
103
        que_t*  graph); /* in: query graph */
 
104
/**************************************************************************
97
105
Frees a query graph, but not the heap where it was created. Does not free
98
106
explicit cursor declarations, they are freed in que_graph_free. */
99
107
UNIV_INTERN
100
108
void
101
109
que_graph_free_recursive(
102
110
/*=====================*/
103
 
        que_node_t*     node);  /*!< in: query graph node */
104
 
/**********************************************************************//**
 
111
        que_node_t*     node);  /* in: query graph node */
 
112
/**************************************************************************
105
113
Frees a query graph. */
106
114
UNIV_INTERN
107
115
void
108
116
que_graph_free(
109
117
/*===========*/
110
 
        que_t*  graph); /*!< in: query graph; we assume that the memory
 
118
        que_t*  graph); /* in: query graph; we assume that the memory
111
119
                        heap where this graph was created is private
112
120
                        to this graph: if not, then use
113
121
                        que_graph_free_recursive and free the heap
114
122
                        afterwards! */
115
 
/**********************************************************************//**
 
123
/**************************************************************************
116
124
Stops a query thread if graph or trx is in a state requiring it. The
117
125
conditions are tested in the order (1) graph, (2) trx. The kernel mutex has
118
 
to be reserved.
119
 
@return TRUE if stopped */
 
126
to be reserved. */
120
127
UNIV_INTERN
121
128
ibool
122
129
que_thr_stop(
123
130
/*=========*/
124
 
        que_thr_t*      thr);   /*!< in: query thread */
125
 
/**********************************************************************//**
 
131
                                /* out: TRUE if stopped */
 
132
        que_thr_t*      thr);   /* in: query thread */
 
133
/**************************************************************************
126
134
Moves a thread from another state to the QUE_THR_RUNNING state. Increments
127
135
the n_active_thrs counters of the query graph and transaction. */
128
136
UNIV_INTERN
129
137
void
130
138
que_thr_move_to_run_state_for_mysql(
131
139
/*================================*/
132
 
        que_thr_t*      thr,    /*!< in: an query thread */
133
 
        trx_t*          trx);   /*!< in: transaction */
134
 
/**********************************************************************//**
 
140
        que_thr_t*      thr,    /* in: an query thread */
 
141
        trx_t*          trx);   /* in: transaction */
 
142
/**************************************************************************
135
143
A patch for MySQL used to 'stop' a dummy query thread used in MySQL
136
144
select, when there is no error or lock wait. */
137
145
UNIV_INTERN
138
146
void
139
147
que_thr_stop_for_mysql_no_error(
140
148
/*============================*/
141
 
        que_thr_t*      thr,    /*!< in: query thread */
142
 
        trx_t*          trx);   /*!< in: transaction */
143
 
/**********************************************************************//**
 
149
        que_thr_t*      thr,    /* in: query thread */
 
150
        trx_t*          trx);   /* in: transaction */
 
151
/**************************************************************************
144
152
A patch for MySQL used to 'stop' a dummy query thread used in MySQL. The
145
153
query thread is stopped and made inactive, except in the case where
146
154
it was put to the lock wait state in lock0lock.c, but the lock has already
149
157
void
150
158
que_thr_stop_for_mysql(
151
159
/*===================*/
152
 
        que_thr_t*      thr);   /*!< in: query thread */
153
 
/**********************************************************************//**
 
160
        que_thr_t*      thr);   /* in: query thread */
 
161
/**************************************************************************
154
162
Run a query thread. Handles lock waits. */
155
163
UNIV_INTERN
156
164
void
157
165
que_run_threads(
158
166
/*============*/
159
 
        que_thr_t*      thr);   /*!< in: query thread */
160
 
/**********************************************************************//**
 
167
        que_thr_t*      thr);   /* in: query thread */
 
168
/**************************************************************************
161
169
After signal handling is finished, returns control to a query graph error
162
170
handling routine. (Currently, just returns the control to the root of the
163
171
graph so that the graph can communicate an error message to the client.) */
165
173
void
166
174
que_fork_error_handle(
167
175
/*==================*/
168
 
        trx_t*  trx,    /*!< in: trx */
169
 
        que_t*  fork);  /*!< in: query graph which was run before signal
 
176
        trx_t*  trx,    /* in: trx */
 
177
        que_t*  fork);  /* in: query graph which was run before signal
170
178
                        handling started, NULL not allowed */
171
 
/**********************************************************************//**
 
179
/**************************************************************************
172
180
Moves a suspended query thread to the QUE_THR_RUNNING state and releases
173
181
a single worker thread to execute it. This function should be used to end
174
182
the wait state of a query thread waiting for a lock or a stored procedure
177
185
void
178
186
que_thr_end_wait(
179
187
/*=============*/
180
 
        que_thr_t*      thr,            /*!< in: query thread in the
 
188
        que_thr_t*      thr,            /* in: query thread in the
181
189
                                        QUE_THR_LOCK_WAIT,
182
190
                                        or QUE_THR_PROCEDURE_WAIT, or
183
191
                                        QUE_THR_SIG_REPLY_WAIT state */
184
 
        que_thr_t**     next_thr);      /*!< in/out: next query thread to run;
 
192
        que_thr_t**     next_thr);      /* in/out: next query thread to run;
185
193
                                        if the value which is passed in is
186
194
                                        a pointer to a NULL pointer, then the
187
195
                                        calling function can start running
188
196
                                        a new query thread */
189
 
/**********************************************************************//**
 
197
/**************************************************************************
190
198
Same as que_thr_end_wait, but no parameter next_thr available. */
191
199
UNIV_INTERN
192
200
void
193
201
que_thr_end_wait_no_next_thr(
194
202
/*=========================*/
195
 
        que_thr_t*      thr);           /*!< in: query thread in the
 
203
        que_thr_t*      thr);           /* in: query thread in the
196
204
                                        QUE_THR_LOCK_WAIT,
197
205
                                        or QUE_THR_PROCEDURE_WAIT, or
198
206
                                        QUE_THR_SIG_REPLY_WAIT state */
199
 
/**********************************************************************//**
 
207
/**************************************************************************
200
208
Starts execution of a command in a query fork. Picks a query thread which
201
209
is not in the QUE_THR_RUNNING state and moves it to that state. If none
202
210
can be chosen, a situation which may arise in parallelized fetches, NULL
203
 
is returned.
204
 
@return a query thread of the graph moved to QUE_THR_RUNNING state, or
205
 
NULL; the query thread should be executed by que_run_threads by the
206
 
caller */
 
211
is returned. */
207
212
UNIV_INTERN
208
213
que_thr_t*
209
214
que_fork_start_command(
210
215
/*===================*/
211
 
        que_fork_t*     fork);  /*!< in: a query fork */
212
 
/***********************************************************************//**
 
216
                                /* out: a query thread of the graph moved to
 
217
                                QUE_THR_RUNNING state, or NULL; the query
 
218
                                thread should be executed by que_run_threads
 
219
                                by the caller */
 
220
        que_fork_t*     fork);  /* in: a query fork */
 
221
/***************************************************************************
213
222
Gets the trx of a query thread. */
214
223
UNIV_INLINE
215
224
trx_t*
216
225
thr_get_trx(
217
226
/*========*/
218
 
        que_thr_t*      thr);   /*!< in: query thread */
219
 
/*******************************************************************//**
220
 
Determines if this thread is rolling back an incomplete transaction
221
 
in crash recovery.
222
 
@return TRUE if thr is rolling back an incomplete transaction in crash
223
 
recovery */
224
 
UNIV_INLINE
225
 
ibool
226
 
thr_is_recv(
227
 
/*========*/
228
 
        const que_thr_t*        thr);   /*!< in: query thread */
229
 
/***********************************************************************//**
 
227
        que_thr_t*      thr);   /* in: query thread */
 
228
/***************************************************************************
230
229
Gets the type of a graph node. */
231
230
UNIV_INLINE
232
231
ulint
233
232
que_node_get_type(
234
233
/*==============*/
235
 
        que_node_t*     node);  /*!< in: graph node */
236
 
/***********************************************************************//**
 
234
        que_node_t*     node);  /* in: graph node */
 
235
/***************************************************************************
237
236
Gets pointer to the value data type field of a graph node. */
238
237
UNIV_INLINE
239
238
dtype_t*
240
239
que_node_get_data_type(
241
240
/*===================*/
242
 
        que_node_t*     node);  /*!< in: graph node */
243
 
/***********************************************************************//**
 
241
        que_node_t*     node);  /* in: graph node */
 
242
/***************************************************************************
244
243
Gets pointer to the value dfield of a graph node. */
245
244
UNIV_INLINE
246
245
dfield_t*
247
246
que_node_get_val(
248
247
/*=============*/
249
 
        que_node_t*     node);  /*!< in: graph node */
250
 
/***********************************************************************//**
251
 
Gets the value buffer size of a graph node.
252
 
@return val buffer size, not defined if val.data == NULL in node */
 
248
        que_node_t*     node);  /* in: graph node */
 
249
/***************************************************************************
 
250
Gets the value buffer size of a graph node. */
253
251
UNIV_INLINE
254
252
ulint
255
253
que_node_get_val_buf_size(
256
254
/*======================*/
257
 
        que_node_t*     node);  /*!< in: graph node */
258
 
/***********************************************************************//**
 
255
                                /* out: val buffer size, not defined if
 
256
                                val.data == NULL in node */
 
257
        que_node_t*     node);  /* in: graph node */
 
258
/***************************************************************************
259
259
Sets the value buffer size of a graph node. */
260
260
UNIV_INLINE
261
261
void
262
262
que_node_set_val_buf_size(
263
263
/*======================*/
264
 
        que_node_t*     node,   /*!< in: graph node */
265
 
        ulint           size);  /*!< in: size */
266
 
/*********************************************************************//**
 
264
        que_node_t*     node,   /* in: graph node */
 
265
        ulint           size);  /* in: size */
 
266
/*************************************************************************
267
267
Gets the next list node in a list of query graph nodes. */
268
268
UNIV_INLINE
269
269
que_node_t*
270
270
que_node_get_next(
271
271
/*==============*/
272
 
        que_node_t*     node);  /*!< in: node in a list */
273
 
/*********************************************************************//**
274
 
Gets the parent node of a query graph node.
275
 
@return parent node or NULL */
 
272
        que_node_t*     node);  /* in: node in a list */
 
273
/*************************************************************************
 
274
Gets the parent node of a query graph node. */
276
275
UNIV_INLINE
277
276
que_node_t*
278
277
que_node_get_parent(
279
278
/*================*/
280
 
        que_node_t*     node);  /*!< in: node */
281
 
/****************************************************************//**
 
279
                                /* out: parent node or NULL */
 
280
        que_node_t*     node);  /* in: node */
 
281
/********************************************************************
282
282
Get the first containing loop node (e.g. while_node_t or for_node_t) for the
283
 
given node, or NULL if the node is not within a loop.
284
 
@return containing loop node, or NULL. */
 
283
given node, or NULL if the node is not within a loop. */
285
284
UNIV_INTERN
286
285
que_node_t*
287
286
que_node_get_containing_loop_node(
288
287
/*==============================*/
289
 
        que_node_t*     node);  /*!< in: node */
290
 
/*********************************************************************//**
291
 
Catenates a query graph node to a list of them, possible empty list.
292
 
@return one-way list of nodes */
 
288
                                /* out: containing loop node, or NULL. */
 
289
        que_node_t*     node);  /* in: node */
 
290
/*************************************************************************
 
291
Catenates a query graph node to a list of them, possible empty list. */
293
292
UNIV_INLINE
294
293
que_node_t*
295
294
que_node_list_add_last(
296
295
/*===================*/
297
 
        que_node_t*     node_list,      /*!< in: node list, or NULL */
298
 
        que_node_t*     node);          /*!< in: node */
299
 
/*********************************************************************//**
300
 
Gets a query graph node list length.
301
 
@return length, for NULL list 0 */
 
296
                                        /* out: one-way list of nodes */
 
297
        que_node_t*     node_list,      /* in: node list, or NULL */
 
298
        que_node_t*     node);          /* in: node */
 
299
/*************************************************************************
 
300
Gets a query graph node list length. */
302
301
UNIV_INLINE
303
302
ulint
304
303
que_node_list_get_len(
305
304
/*==================*/
306
 
        que_node_t*     node_list);     /*!< in: node list, or NULL */
307
 
/**********************************************************************//**
 
305
                                        /* out: length, for NULL list 0 */
 
306
        que_node_t*     node_list);     /* in: node list, or NULL */
 
307
/**************************************************************************
308
308
Checks if graph, trx, or session is in a state where the query thread should
309
 
be stopped.
310
 
@return TRUE if should be stopped; NOTE that if the peek is made
311
 
without reserving the kernel mutex, then another peek with the mutex
312
 
reserved is necessary before deciding the actual stopping */
 
309
be stopped. */
313
310
UNIV_INLINE
314
311
ibool
315
312
que_thr_peek_stop(
316
313
/*==============*/
317
 
        que_thr_t*      thr);   /*!< in: query thread */
318
 
/***********************************************************************//**
319
 
Returns TRUE if the query graph is for a SELECT statement.
320
 
@return TRUE if a select */
 
314
                                /* out: TRUE if should be stopped; NOTE that
 
315
                                if the peek is made without reserving the
 
316
                                kernel mutex, then another peek with the
 
317
                                mutex reserved is necessary before deciding
 
318
                                the actual stopping */
 
319
        que_thr_t*      thr);   /* in: query thread */
 
320
/***************************************************************************
 
321
Returns TRUE if the query graph is for a SELECT statement. */
321
322
UNIV_INLINE
322
323
ibool
323
324
que_graph_is_select(
324
325
/*================*/
325
 
        que_t*          graph);         /*!< in: graph */
326
 
/**********************************************************************//**
 
326
                                        /* out: TRUE if a select */
 
327
        que_t*          graph);         /* in: graph */
 
328
/**************************************************************************
327
329
Prints info of an SQL query graph node. */
328
330
UNIV_INTERN
329
331
void
330
332
que_node_print_info(
331
333
/*================*/
332
 
        que_node_t*     node);  /*!< in: query graph node */
333
 
/*********************************************************************//**
334
 
Evaluate the given SQL
335
 
@return error code or DB_SUCCESS */
 
334
        que_node_t*     node);  /* in: query graph node */
 
335
/*************************************************************************
 
336
Evaluate the given SQL */
336
337
UNIV_INTERN
337
338
ulint
338
339
que_eval_sql(
339
340
/*=========*/
340
 
        pars_info_t*    info,   /*!< in: info struct, or NULL */
341
 
        const char*     sql,    /*!< in: SQL string */
 
341
                                /* out: error code or DB_SUCCESS */
 
342
        pars_info_t*    info,   /* in: info struct, or NULL */
 
343
        const char*     sql,    /* in: SQL string */
342
344
        ibool           reserve_dict_mutex,
343
 
                                /*!< in: if TRUE, acquire/release
 
345
                                /* in: if TRUE, acquire/release
344
346
                                dict_sys->mutex around call to pars_sql. */
345
 
        trx_t*          trx);   /*!< in: trx */
 
347
        trx_t*          trx);   /* in: trx */
346
348
 
347
349
/* Query graph query thread node: the fields are protected by the kernel
348
350
mutex with the exceptions named below */
349
351
 
350
352
struct que_thr_struct{
351
 
        que_common_t    common;         /*!< type: QUE_NODE_THR */
352
 
        ulint           magic_n;        /*!< magic number to catch memory
 
353
        que_common_t    common;         /* type: QUE_NODE_THR */
 
354
        ulint           magic_n;        /* magic number to catch memory
353
355
                                        corruption */
354
 
        que_node_t*     child;          /*!< graph child node */
355
 
        que_t*          graph;          /*!< graph where this node belongs */
356
 
        ibool           is_active;      /*!< TRUE if the thread has been set
 
356
        que_node_t*     child;          /* graph child node */
 
357
        que_t*          graph;          /* graph where this node belongs */
 
358
        ibool           is_active;      /* TRUE if the thread has been set
357
359
                                        to the run state in
358
360
                                        que_thr_move_to_run_state, but not
359
361
                                        deactivated in
360
362
                                        que_thr_dec_reference_count */
361
 
        ulint           state;          /*!< state of the query thread */
 
363
        ulint           state;          /* state of the query thread */
362
364
        UT_LIST_NODE_T(que_thr_t)
363
 
                        thrs;           /*!< list of thread nodes of the fork
 
365
                        thrs;           /* list of thread nodes of the fork
364
366
                                        node */
365
367
        UT_LIST_NODE_T(que_thr_t)
366
 
                        trx_thrs;       /*!< lists of threads in wait list of
 
368
                        trx_thrs;       /* lists of threads in wait list of
367
369
                                        the trx */
368
370
        UT_LIST_NODE_T(que_thr_t)
369
 
                        queue;          /*!< list of runnable thread nodes in
 
371
                        queue;          /* list of runnable thread nodes in
370
372
                                        the server task queue */
371
373
        /*------------------------------*/
372
374
        /* The following fields are private to the OS thread executing the
373
375
        query thread, and are not protected by the kernel mutex: */
374
376
 
375
 
        que_node_t*     run_node;       /*!< pointer to the node where the
 
377
        que_node_t*     run_node;       /* pointer to the node where the
376
378
                                        subgraph down from this node is
377
379
                                        currently executed */
378
 
        que_node_t*     prev_node;      /*!< pointer to the node from which
 
380
        que_node_t*     prev_node;      /* pointer to the node from which
379
381
                                        the control came */
380
 
        ulint           resource;       /*!< resource usage of the query thread
 
382
        ulint           resource;       /* resource usage of the query thread
381
383
                                        thus far */
382
 
        ulint           lock_state;     /*!< lock state of thread (table or
 
384
        ulint           lock_state;     /* lock state of thread (table or
383
385
                                        row) */
384
 
        ulint           fk_cascade_depth; /*!< maximum cascading call depth
385
 
                                        supported for foreign key constraint
386
 
                                        related delete/updates */
387
386
};
388
387
 
389
388
#define QUE_THR_MAGIC_N         8476583
391
390
 
392
391
/* Query graph fork node: its fields are protected by the kernel mutex */
393
392
struct que_fork_struct{
394
 
        que_common_t    common;         /*!< type: QUE_NODE_FORK */
395
 
        que_t*          graph;          /*!< query graph of this node */
396
 
        ulint           fork_type;      /*!< fork type */
397
 
        ulint           n_active_thrs;  /*!< if this is the root of a graph, the
 
393
        que_common_t    common;         /* type: QUE_NODE_FORK */
 
394
        que_t*          graph;          /* query graph of this node */
 
395
        ulint           fork_type;      /* fork type */
 
396
        ulint           n_active_thrs;  /* if this is the root of a graph, the
398
397
                                        number query threads that have been
399
398
                                        started in que_thr_move_to_run_state
400
399
                                        but for which que_thr_dec_refer_count
401
400
                                        has not yet been called */
402
 
        trx_t*          trx;            /*!< transaction: this is set only in
 
401
        trx_t*          trx;            /* transaction: this is set only in
403
402
                                        the root node */
404
 
        ulint           state;          /*!< state of the fork node */
405
 
        que_thr_t*      caller;         /*!< pointer to a possible calling query
 
403
        ulint           state;          /* state of the fork node */
 
404
        que_thr_t*      caller;         /* pointer to a possible calling query
406
405
                                        thread */
407
406
        UT_LIST_BASE_NODE_T(que_thr_t)
408
 
                        thrs;           /*!< list of query threads */
 
407
                        thrs;           /* list of query threads */
409
408
        /*------------------------------*/
410
409
        /* The fields in this section are defined only in the root node */
411
 
        sym_tab_t*      sym_tab;        /*!< symbol table of the query,
 
410
        sym_tab_t*      sym_tab;        /* symbol table of the query,
412
411
                                        generated by the parser, or NULL
413
412
                                        if the graph was created 'by hand' */
414
 
        pars_info_t*    info;           /*!< info struct, or NULL */
 
413
        pars_info_t*    info;           /* in: info struct, or NULL */
415
414
        /* The following cur_... fields are relevant only in a select graph */
416
415
 
417
 
        ulint           cur_end;        /*!< QUE_CUR_NOT_DEFINED, QUE_CUR_START,
 
416
        ulint           cur_end;        /* QUE_CUR_NOT_DEFINED, QUE_CUR_START,
418
417
                                        QUE_CUR_END */
419
 
        ulint           cur_pos;        /*!< if there are n rows in the result
 
418
        ulint           cur_pos;        /* if there are n rows in the result
420
419
                                        set, values 0 and n + 1 mean before
421
420
                                        first row, or after last row, depending
422
421
                                        on cur_end; values 1...n mean a row
423
422
                                        index */
424
 
        ibool           cur_on_row;     /*!< TRUE if cursor is on a row, i.e.,
 
423
        ibool           cur_on_row;     /* TRUE if cursor is on a row, i.e.,
425
424
                                        it is not before the first row or
426
425
                                        after the last row */
427
 
        sel_node_t*     last_sel_node;  /*!< last executed select node, or NULL
 
426
        dulint          n_inserts;      /* number of rows inserted */
 
427
        dulint          n_updates;      /* number of rows updated */
 
428
        dulint          n_deletes;      /* number of rows deleted */
 
429
        sel_node_t*     last_sel_node;  /* last executed select node, or NULL
428
430
                                        if none */
429
431
        UT_LIST_NODE_T(que_fork_t)
430
 
                        graphs;         /*!< list of query graphs of a session
 
432
                        graphs;         /* list of query graphs of a session
431
433
                                        or a stored procedure */
432
434
        /*------------------------------*/
433
 
        mem_heap_t*     heap;           /*!< memory heap where the fork was
 
435
        mem_heap_t*     heap;           /* memory heap where the fork was
434
436
                                        created */
435
437
 
436
438
};