1
/******************************************************
6
Created 12/19/1997 Heikki Tuuri
7
*******************************************************/
11
/*************************************************************************
12
Gets the plan node for the nth table in a join. */
15
sel_node_get_nth_plan(
16
/*==================*/
18
sel_node_t* node, /* in: select node */
19
ulint i) /* in: get ith plan node */
21
ut_ad(i < node->n_tables);
23
return(node->plans + i);
26
/*************************************************************************
27
Resets the cursor defined by sel_node to the SEL_NODE_OPEN state, which means
28
that it will start fetching from the start of the result set again, regardless
29
of where it was before, and it will set intention locks on the tables. */
32
sel_node_reset_cursor(
33
/*==================*/
34
sel_node_t* node) /* in: select node */
36
node->state = SEL_NODE_OPEN;
39
/**************************************************************************
40
Performs an execution step of an open or close cursor statement node. */
45
/* out: query thread to run next or NULL */
46
que_thr_t* thr) /* in: query thread */
55
ut_ad(que_node_get_type(node) == QUE_NODE_OPEN);
57
sel_node = node->cursor_def;
61
if (node->op_type == ROW_SEL_OPEN_CURSOR) {
63
/* if (sel_node->state == SEL_NODE_CLOSED) { */
65
sel_node_reset_cursor(sel_node);
70
if (sel_node->state != SEL_NODE_CLOSED) {
72
sel_node->state = SEL_NODE_CLOSED;
78
if (UNIV_EXPECT(err, DB_SUCCESS) != DB_SUCCESS) {
79
/* SQL error detected */
80
fprintf(stderr, "SQL error %lu\n", (ulong) err);
85
thr->run_node = que_node_get_parent(node);