~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
/***************************************************************************
27
27
Adds a query graph to the session's list of graphs. */
28
 
 
 
28
UNIV_INTERN
29
29
void
30
30
que_graph_publish(
31
31
/*==============*/
33
33
        sess_t* sess);  /* in: session */
34
34
/***************************************************************************
35
35
Creates a query graph fork node. */
36
 
 
 
36
UNIV_INTERN
37
37
que_fork_t*
38
38
que_fork_create(
39
39
/*============*/
68
68
        que_node_t*     parent);/* in: parent */
69
69
/***************************************************************************
70
70
Creates a query graph thread node. */
71
 
 
 
71
UNIV_INTERN
72
72
que_thr_t*
73
73
que_thr_create(
74
74
/*===========*/
79
79
Checks if the query graph is in a state where it should be freed, and
80
80
frees it in that case. If the session is in a state where it should be
81
81
closed, also this is done. */
82
 
 
 
82
UNIV_INTERN
83
83
ibool
84
84
que_graph_try_free(
85
85
/*===============*/
88
88
/**************************************************************************
89
89
Frees a query graph, but not the heap where it was created. Does not free
90
90
explicit cursor declarations, they are freed in que_graph_free. */
91
 
 
 
91
UNIV_INTERN
92
92
void
93
93
que_graph_free_recursive(
94
94
/*=====================*/
95
95
        que_node_t*     node);  /* in: query graph node */
96
96
/**************************************************************************
97
97
Frees a query graph. */
98
 
 
 
98
UNIV_INTERN
99
99
void
100
100
que_graph_free(
101
101
/*===========*/
108
108
Stops a query thread if graph or trx is in a state requiring it. The
109
109
conditions are tested in the order (1) graph, (2) trx. The kernel mutex has
110
110
to be reserved. */
111
 
 
 
111
UNIV_INTERN
112
112
ibool
113
113
que_thr_stop(
114
114
/*=========*/
117
117
/**************************************************************************
118
118
Moves a thread from another state to the QUE_THR_RUNNING state. Increments
119
119
the n_active_thrs counters of the query graph and transaction. */
120
 
 
 
120
UNIV_INTERN
121
121
void
122
122
que_thr_move_to_run_state_for_mysql(
123
123
/*================================*/
126
126
/**************************************************************************
127
127
A patch for MySQL used to 'stop' a dummy query thread used in MySQL
128
128
select, when there is no error or lock wait. */
129
 
 
 
129
UNIV_INTERN
130
130
void
131
131
que_thr_stop_for_mysql_no_error(
132
132
/*============================*/
137
137
query thread is stopped and made inactive, except in the case where
138
138
it was put to the lock wait state in lock0lock.c, but the lock has already
139
139
been granted or the transaction chosen as a victim in deadlock resolution. */
140
 
 
 
140
UNIV_INTERN
141
141
void
142
142
que_thr_stop_for_mysql(
143
143
/*===================*/
144
144
        que_thr_t*      thr);   /* in: query thread */
145
145
/**************************************************************************
146
146
Run a query thread. Handles lock waits. */
147
 
 
 
147
UNIV_INTERN
148
148
void
149
149
que_run_threads(
150
150
/*============*/
153
153
After signal handling is finished, returns control to a query graph error
154
154
handling routine. (Currently, just returns the control to the root of the
155
155
graph so that the graph can communicate an error message to the client.) */
156
 
 
 
156
UNIV_INTERN
157
157
void
158
158
que_fork_error_handle(
159
159
/*==================*/
165
165
a single worker thread to execute it. This function should be used to end
166
166
the wait state of a query thread waiting for a lock or a stored procedure
167
167
completion. */
168
 
 
 
168
UNIV_INTERN
169
169
void
170
170
que_thr_end_wait(
171
171
/*=============*/
180
180
                                        a new query thread */
181
181
/**************************************************************************
182
182
Same as que_thr_end_wait, but no parameter next_thr available. */
183
 
 
 
183
UNIV_INTERN
184
184
void
185
185
que_thr_end_wait_no_next_thr(
186
186
/*=========================*/
193
193
is not in the QUE_THR_RUNNING state and moves it to that state. If none
194
194
can be chosen, a situation which may arise in parallelized fetches, NULL
195
195
is returned. */
196
 
 
 
196
UNIV_INTERN
197
197
que_thr_t*
198
198
que_fork_start_command(
199
199
/*===================*/
265
265
/********************************************************************
266
266
Get the first containing loop node (e.g. while_node_t or for_node_t) for the
267
267
given node, or NULL if the node is not within a loop. */
268
 
 
 
268
UNIV_INTERN
269
269
que_node_t*
270
270
que_node_get_containing_loop_node(
271
271
/*==============================*/
311
311
        que_t*          graph);         /* in: graph */
312
312
/**************************************************************************
313
313
Prints info of an SQL query graph node. */
314
 
 
 
314
UNIV_INTERN
315
315
void
316
316
que_node_print_info(
317
317
/*================*/
318
318
        que_node_t*     node);  /* in: query graph node */
319
319
/*************************************************************************
320
320
Evaluate the given SQL */
321
 
 
 
321
UNIV_INTERN
322
322
ulint
323
323
que_eval_sql(
324
324
/*=========*/
433
433
#define QUE_FORK_EXECUTE                7
434
434
#define QUE_FORK_PROCEDURE              8
435
435
#define QUE_FORK_PROCEDURE_CALL         9
436
 
#define QUE_FORK_DRIZZLE_INTERFACE      10
 
436
#define QUE_FORK_MYSQL_INTERFACE        10
437
437
#define QUE_FORK_RECOVERY               11
438
438
 
439
439
/* Query fork (or graph) states */