InnoDB Plugin  1.0
row0ins.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 1996, 2012, 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 row0ins_h
27 #define row0ins_h
28 
29 #include "univ.i"
30 #include "data0data.h"
31 #include "que0types.h"
32 #include "dict0types.h"
33 #include "trx0types.h"
34 #include "row0types.h"
35 
36 /***************************************************************/
42 UNIV_INTERN
43 dberr_t
45 /*=============================*/
46  ibool check_ref,
49  dict_foreign_t* foreign,
54  dtuple_t* entry,
55  que_thr_t* thr)
56  __attribute__((nonnull, warn_unused_result));
57 /*********************************************************************/
60 UNIV_INTERN
63 /*============*/
64  ulint ins_type,
66  mem_heap_t* heap);
67 /*********************************************************************/
71 UNIV_INTERN
72 void
74 /*=================*/
75  ins_node_t* node,
76  dtuple_t* row);
77 /***************************************************************/
88 UNIV_INTERN
89 dberr_t
91 /*==========================*/
92  ulint flags,
93  ulint mode,
97  ulint n_uniq,
98  dtuple_t* entry,
99  ulint n_ext,
100  que_thr_t* thr)
101  __attribute__((nonnull, warn_unused_result));
102 /***************************************************************/
110 UNIV_INTERN
111 dberr_t
113 /*========================*/
114  ulint flags,
115  ulint mode,
119  mem_heap_t* offsets_heap,
121  mem_heap_t* heap,
122  dtuple_t* entry,
123  trx_id_t trx_id,
125  que_thr_t* thr)
126  __attribute__((nonnull, warn_unused_result));
127 /***************************************************************/
131 UNIV_INTERN
132 dberr_t
134 /*=============================*/
135  const dtuple_t* entry,
136  const big_rec_t* big_rec,
137  ulint* offsets,
138  mem_heap_t** heap,
140  const char* file,
141 #ifndef DBUG_OFF
142  const void* thd,
143 #endif /* DBUG_OFF */
144  ulint line)
145  __attribute__((nonnull(1,2,3,4,5,6), warn_unused_result));
146 #ifdef DBUG_OFF
147 # define row_ins_index_entry_big_rec(e,big,ofs,heap,index,thd,file,line) \
148  row_ins_index_entry_big_rec_func(e,big,ofs,heap,index,file,line)
149 #else /* DBUG_OFF */
150 # define row_ins_index_entry_big_rec(e,big,ofs,heap,index,thd,file,line) \
151  row_ins_index_entry_big_rec_func(e,big,ofs,heap,index,file,thd,line)
152 #endif /* DBUG_OFF */
153 /***************************************************************/
159 UNIV_INTERN
160 dberr_t
162 /*======================*/
164  dtuple_t* entry,
165  que_thr_t* thr,
166  ulint n_ext)
167  __attribute__((nonnull, warn_unused_result));
168 /***************************************************************/
174 UNIV_INTERN
175 dberr_t
177 /*====================*/
179  dtuple_t* entry,
180  que_thr_t* thr)
181  __attribute__((nonnull, warn_unused_result));
182 /***********************************************************/
186 UNIV_INTERN
187 que_thr_t*
189 /*=========*/
190  que_thr_t* thr);
192 /* Insert node structure */
193 
194 struct ins_node_t{
196  ulint ins_type;/* INS_VALUES, INS_SEARCHED, or INS_DIRECT */
200  que_node_t* values_list;/* list of expressions to evaluate and
201  insert in an INS_VALUES insert */
202  ulint state;
208  UT_LIST_BASE_NODE_T(dtuple_t)
209  entry_list;/* list of entries, one for each index */
210  byte* row_id_buf;/* buffer for the row id sys field in row */
213  byte* trx_id_buf;/* buffer for the trx id sys field in row */
214  mem_heap_t* entry_sys_heap;
215  /* memory heap used as auxiliary storage;
216  entry_list and sys fields are stored here;
217  if this is NULL, entry list should be created
218  and buffers for sys fields in row allocated */
219  ulint magic_n;
220 };
221 
222 #define INS_NODE_MAGIC_N 15849075
223 
224 /* Insert node types */
225 #define INS_SEARCHED 0 /* INSERT INTO ... SELECT ... */
226 #define INS_VALUES 1 /* INSERT INTO ... VALUES ... */
227 #define INS_DIRECT 2 /* this is for internal use in dict0crea:
228  insert the row directly */
229 
230 /* Node execution states */
231 #define INS_NODE_SET_IX_LOCK 1 /* we should set an IX lock on table */
232 #define INS_NODE_ALLOC_ROW_ID 2 /* row id should be allocated */
233 #define INS_NODE_INSERT_ENTRIES 3 /* index entries should be built and
234  inserted */
235 
236 #ifndef UNIV_NONINL
237 #include "row0ins.ic"
238 #endif
239 
240 #endif