Drizzled Public API Documentation

row0ins.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (C) 1996, 2009, Innobase Oy. 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., 51 Franklin
15 St, Fifth Floor, Boston, MA 02110-1301 USA
16 
17 *****************************************************************************/
18 
19 /**************************************************/
26 #pragma once
27 #ifndef row0ins_h
28 #define row0ins_h
29 
30 #include "univ.i"
31 #include "data0data.h"
32 #include "que0types.h"
33 #include "dict0types.h"
34 #include "trx0types.h"
35 #include "row0types.h"
36 
37 /***************************************************************/
43 UNIV_INTERN
44 ulint
46 /*=============================*/
47  ibool check_ref,
50  dict_foreign_t* foreign,
53  dict_table_t* table,
55  dtuple_t* entry,
56  que_thr_t* thr);
57 /*********************************************************************/
60 UNIV_INTERN
63 /*============*/
64  ulint ins_type,
65  dict_table_t* table,
66  mem_heap_t* heap);
67 /*********************************************************************/
71 UNIV_INTERN
72 void
74 /*=================*/
75  ins_node_t* node,
76  dtuple_t* row);
77 /***************************************************************/
83 UNIV_INTERN
84 ulint
86 /*================*/
87  dict_index_t* index,
88  dtuple_t* entry,
89  ulint n_ext,
90  ibool foreign,
92  que_thr_t* thr);
93 /***********************************************************/
97 UNIV_INTERN
98 que_thr_t*
100 /*=========*/
101  que_thr_t* thr);
102 /***********************************************************/
104 UNIV_INTERN
105 void
107 /*=======================*/
108  ins_node_t* node);
110 /* Insert node structure */
111 
114  ulint ins_type;/* INS_VALUES, INS_SEARCHED, or INS_DIRECT */
118  que_node_t* values_list;/* list of expressions to evaluate and
119  insert in an INS_VALUES insert */
120  ulint state;
127  entry_list;/* list of entries, one for each index */
128  byte* row_id_buf;/* buffer for the row id sys field in row */
131  byte* trx_id_buf;/* buffer for the trx id sys field in row */
132  mem_heap_t* entry_sys_heap;
133  /* memory heap used as auxiliary storage;
134  entry_list and sys fields are stored here;
135  if this is NULL, entry list should be created
136  and buffers for sys fields in row allocated */
137  ulint magic_n;
138 };
139 
140 #define INS_NODE_MAGIC_N 15849075
141 
142 /* Insert node types */
143 #define INS_SEARCHED 0 /* INSERT INTO ... SELECT ... */
144 #define INS_VALUES 1 /* INSERT INTO ... VALUES ... */
145 #define INS_DIRECT 2 /* this is for internal use in dict0crea:
146  insert the row directly */
147 
148 /* Node execution states */
149 #define INS_NODE_SET_IX_LOCK 1 /* we should set an IX lock on table */
150 #define INS_NODE_ALLOC_ROW_ID 2 /* row id should be allocated */
151 #define INS_NODE_INSERT_ENTRIES 3 /* index entries should be built and
152  inserted */
153 
154 #ifndef UNIV_NONINL
155 #include "row0ins.ic"
156 #endif
157 
158 #endif
UNIV_INTERN ins_node_t * ins_node_create(ulint ins_type, dict_table_t *table, mem_heap_t *heap)
Definition: row0ins.cc:69
trx_id_t trx_id
Definition: row0ins.h:129
sel_node_t * select
Definition: row0ins.h:117
UNIV_INTERN void ins_node_set_new_row(ins_node_t *node, dtuple_t *row)
Definition: row0ins.cc:186
dict_table_t * table
Definition: row0ins.h:116
dtuple_t * row
Definition: row0ins.h:115
que_common_t common
Definition: row0ins.h:113
typedef UT_LIST_BASE_NODE_T(mutex_t) ut_list_base_node_t
dict_index_t * index
Definition: row0ins.h:121
UNIV_INTERN ulint row_ins_check_foreign_constraint(ibool check_ref, dict_foreign_t *foreign, dict_table_t *table, dtuple_t *entry, que_thr_t *thr)
Definition: row0ins.cc:1187
ib_id_t trx_id_t
Definition: trx0types.h:85
dtuple_t * entry
Definition: row0ins.h:123
UNIV_INTERN void ins_node_create_entry_list(ins_node_t *node)
Definition: row0ins.cc:103
UNIV_INTERN ulint row_ins_index_entry(dict_index_t *index, dtuple_t *entry, ulint n_ext, ibool foreign, que_thr_t *thr)
Definition: row0ins.cc:2151
UNIV_INTERN que_thr_t * row_ins_step(que_thr_t *thr)
Definition: row0ins.cc:2414