InnoDB Plugin  1.0
row0merge.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 2005, 2014, 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 row0merge_h
27 #define row0merge_h
28 
29 #include "univ.i"
30 #include "data0data.h"
31 #include "dict0types.h"
32 #include "trx0types.h"
33 #include "que0types.h"
34 #include "mtr0mtr.h"
35 #include "rem0types.h"
36 #include "rem0rec.h"
37 #include "read0types.h"
38 #include "btr0types.h"
39 #include "row0mysql.h"
40 #include "lock0types.h"
41 #include "srv0srv.h"
42 
43 // Forward declaration
45 
53 typedef byte row_merge_block_t;
54 
62 
67 typedef byte mrec_t;
68 
70 struct mtuple_t {
72 };
73 
78  ulint total_size;
79  ulint n_tuples;
80  ulint max_tuples;
84 };
85 
87 struct merge_file_t {
88  int fd;
89  ulint offset;
90  ib_uint64_t n_rec;
91 };
92 
94 struct index_field_t {
95  ulint col_no;
96  ulint prefix_len;
98 };
99 
101 struct index_def_t {
102  const char* name;
103  ulint ind_type;
105  ulint key_number;
107  ulint n_fields;
109 };
110 
114  struct TABLE* table;
115  const ulint* col_map;
119  ulint n_dup;
120 };
121 
122 /*************************************************************/
124 UNIV_INTERN
125 void
127 /*=================*/
128  row_merge_dup_t* dup,
129  const dfield_t* entry)
130  __attribute__((nonnull));
131 /*********************************************************************/
134 UNIV_INTERN
135 dberr_t
137 /*=================*/
138  trx_t* trx,
139  dict_table_t* table,
140  enum lock_mode mode)
141  __attribute__((nonnull, warn_unused_result));
142 /*********************************************************************/
146 UNIV_INTERN
147 void
149 /*========================*/
150  trx_t* trx,
151  table_id_t table_id)
152  __attribute__((nonnull));
153 /*********************************************************************/
157 UNIV_INTERN
158 void
160 /*===================*/
161  trx_t* trx,
162  dict_table_t* table,
163  ibool locked)
165  __attribute__((nonnull));
166 /*********************************************************************/
168 UNIV_INTERN
169 void
171 /*=============================*/
172 
173 /*********************************************************************/
177 UNIV_INTERN
178 int
180 /*===========================*/
181  __attribute__((warn_unused_result));
182 /*********************************************************************/
185 UNIV_INTERN
186 void
188 /*=======================*/
189  int fd);
191 /*********************************************************************/
196 UNIV_INTERN
197 char*
199 /*==================*/
200  dict_table_t* table,
201  const char* new_name);
202 /*********************************************************************/
207 UNIV_INTERN
208 dberr_t
210 /*=========================*/
211  dict_table_t* old_table,
213  dict_table_t* new_table,
215  const char* tmp_name,
216  trx_t* trx)
217  __attribute__((nonnull, warn_unused_result));
218 
219 /*********************************************************************/
224 UNIV_INTERN
225 dberr_t
227 /*==========================*/
228  trx_t* trx,
229  table_id_t table_id,
230  index_id_t index_id)
231  __attribute__((nonnull));
232 /*********************************************************************/
237 UNIV_INTERN
238 dberr_t
240 /*===========================*/
241  trx_t* trx,
242  table_id_t table_id,
243  index_id_t index_id)
244  __attribute__((nonnull));
245 /*********************************************************************/
248 UNIV_INTERN
251 /*===================*/
252  trx_t* trx,
253  dict_table_t* table,
254  const index_def_t* index_def);
256 /*********************************************************************/
259 UNIV_INTERN
260 ibool
262 /*======================*/
263  const trx_t* trx,
264  const dict_index_t* index);
265 /*********************************************************************/
271 UNIV_INTERN
272 dberr_t
274 /*=================*/
275  trx_t* trx,
276  dict_table_t* table)
277  __attribute__((nonnull));
278 /*********************************************************************/
283 UNIV_INTERN
284 dberr_t
286 /*====================*/
287  trx_t* trx,
288  dict_table_t* old_table,
290  dict_table_t* new_table,
293  bool online,
295  dict_index_t** indexes,
296  const ulint* key_numbers,
297  ulint n_indexes,
298  struct TABLE* table,
301  const dtuple_t* add_cols,
303  const ulint* col_map,
306  ulint add_autoinc,
309  ib_sequence_t& sequence)
310  __attribute__((nonnull(1,2,3,5,6,8), warn_unused_result));
311 /********************************************************************/
313 UNIV_INTERN
314 void
316 /*================*/
317  const row_merge_buf_t* buf,
318  const merge_file_t* of,
320  __attribute__((nonnull));
321 /********************************************************************/
323 UNIV_INTERN
324 void
326 /*===============*/
327  row_merge_buf_t* buf,
328  row_merge_dup_t* dup)
330  __attribute__((nonnull(1)));
331 /********************************************************************/
334 UNIV_INTERN
335 ibool
337 /*============*/
338  int fd,
339  ulint offset,
341  const void* buf);
342 /********************************************************************/
345 UNIV_INTERN
348 /*================*/
349  row_merge_buf_t* buf)
350  __attribute__((warn_unused_result, nonnull));
351 /*********************************************************************/
354 UNIV_INTERN
355 int
357 /*==================*/
358  merge_file_t* merge_file)
359  __attribute__((nonnull));
360 /*********************************************************************/
363 UNIV_INTERN
364 dberr_t
366 /*===========*/
367  trx_t* trx,
368  const row_merge_dup_t* dup,
370  merge_file_t* file,
373  int* tmpfd)
374  __attribute__((nonnull));
375 /*********************************************************************/
378 UNIV_INTERN
381 /*=================*/
382  dict_index_t* index)
383  __attribute__((warn_unused_result, nonnull, malloc));
384 /*********************************************************************/
386 UNIV_INTERN
387 void
389 /*===============*/
390  row_merge_buf_t* buf)
391  __attribute__((nonnull));
392 /*********************************************************************/
394 UNIV_INTERN
395 void
397 /*===================*/
398  merge_file_t* merge_file)
399  __attribute__((nonnull));
400 /********************************************************************/
403 UNIV_INTERN
404 ibool
406 /*===========*/
407  int fd,
408  ulint offset,
411  row_merge_block_t* buf);
412 /********************************************************************/
415 UNIV_INTERN
416 const byte*
418 /*===============*/
419  row_merge_block_t* block,
420  mrec_buf_t* buf,
421  const byte* b,
422  const dict_index_t* index,
423  int fd,
424  ulint* foffs,
425  const mrec_t** mrec,
428  ulint* offsets)
429  __attribute__((nonnull, warn_unused_result));
430 #endif /* row0merge.h */