Drizzled Public API Documentation

row0mysql.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (C) 2000, 2010, 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 /**************************************************/
27 #pragma once
28 #ifndef row0mysql_h
29 #define row0mysql_h
30 
31 #include "univ.i"
32 #include "data0data.h"
33 #include "que0types.h"
34 #include "dict0types.h"
35 #include "trx0types.h"
36 #include "row0types.h"
37 #include "btr0pcur.h"
38 #include "trx0types.h"
39 
40 extern ibool row_rollback_on_timeout;
41 
42 typedef struct row_prebuilt_struct row_prebuilt_t;
43 
44 /*******************************************************************/
46 UNIV_INTERN
47 void
49 /*==============================*/
50  row_prebuilt_t* prebuilt);
52 /*******************************************************************/
57 UNIV_INTERN
58 byte*
60 /*=========================*/
61  byte* dest,
62  ulint len,
63  ulint lenlen);
64 /*******************************************************************/
69 UNIV_INTERN
70 const byte*
72 /*========================*/
73  ulint* len,
74  const byte* field,
75  ulint lenlen);
77 /*******************************************************************/
79 UNIV_INTERN
80 void
82 /*=====================*/
83  byte* dest,
84  ulint col_len,
88  const void* data,
90  ulint len);
94 /*******************************************************************/
97 UNIV_INTERN
98 const byte*
100 /*====================*/
101  ulint* len,
102  const byte* ref,
104  ulint col_len);
106 /**************************************************************/
108 UNIV_INTERN
109 void
111 /*==============*/
112  ulint mbminlen,
114  byte* pad,
115  ulint len);
117 /**************************************************************/
122 UNIV_INTERN
123 byte*
125 /*===================================*/
126  dfield_t* dfield,
129  byte* buf,
132  ibool row_format_col,
139  const byte* mysql_data,
144  ulint col_len,
150  ulint comp);
151 /****************************************************************/
155 UNIV_INTERN
156 ibool
158 /*====================*/
159  ulint* new_err,
162  trx_t* trx,
163  que_thr_t* thr,
164  trx_savept_t* savept);
165 /********************************************************************/
168 UNIV_INTERN
171 /*================*/
172  dict_table_t* table);
173 /********************************************************************/
175 UNIV_INTERN
176 void
178 /*==============*/
179  row_prebuilt_t* prebuilt,
180  ibool dict_locked);
181 /*********************************************************************/
184 UNIV_INTERN
185 void
187 /*====================*/
188  row_prebuilt_t* prebuilt,
190  trx_t* trx);
191 /*********************************************************************/
195 UNIV_INTERN
196 void
198 /*===============================*/
199  trx_t* trx);
200 /*********************************************************************/
207 UNIV_INTERN
208 int
210 /*=============================*/
211  row_prebuilt_t* prebuilt);
213 /*********************************************************************/
216 UNIV_INTERN
217 int
219 /*=====================*/
220  row_prebuilt_t* prebuilt,
226  ulint mode);
229 /*********************************************************************/
232 UNIV_INTERN
233 int
235 /*=================*/
236  byte* mysql_rec,
237  row_prebuilt_t* prebuilt);
239 /*********************************************************************/
241 UNIV_INTERN
242 void
244 /*===================*/
245  row_prebuilt_t* prebuilt);
247 /*********************************************************************/
252 UNIV_INTERN
253 upd_t*
255 /*===========================*/
256  row_prebuilt_t* prebuilt);
258 /*********************************************************************/
262 UNIV_INTERN
263 ibool
265 /*==============================*/
266  const dict_table_t* table);
267 /*********************************************************************/
270 UNIV_INTERN
271 int
273 /*=================*/
274  byte* mysql_rec,
276  row_prebuilt_t* prebuilt);
278 /*********************************************************************/
288 UNIV_INTERN
289 int
291 /*=================*/
292  row_prebuilt_t* prebuilt,
294  ibool has_latches_on_recs);
299 /*********************************************************************/
303 UNIV_INTERN
304 upd_node_t*
306 /*=============================*/
308  mem_heap_t* heap);
309 /**********************************************************************/
312 UNIV_INTERN
313 ulint
315 /*=========================*/
316  que_thr_t* thr,
317  upd_node_t* node,
319  dict_table_t* table);
320 /*********************************************************************/
323 UNIV_INTERN
324 void
326 /*================================*/
327  trx_t* trx,
328  const char* file,
329  ulint line);
330 #define row_mysql_lock_data_dictionary(trx) \
331  row_mysql_lock_data_dictionary_func(trx, __FILE__, __LINE__)
332 /*********************************************************************/
334 UNIV_INTERN
335 void
337 /*=============================*/
338  trx_t* trx);
339 /*********************************************************************/
342 UNIV_INTERN
343 void
345 /*==================================*/
346  trx_t* trx,
347  const char* file,
348  ulint line);
349 #define row_mysql_freeze_data_dictionary(trx) \
350  row_mysql_freeze_data_dictionary_func(trx, __FILE__, __LINE__)
351 /*********************************************************************/
353 UNIV_INTERN
354 void
356 /*===============================*/
357  trx_t* trx);
358 /*********************************************************************/
365 UNIV_INTERN
366 int
368 /*=======================*/
371  trx_t* trx);
372 /*********************************************************************/
377 UNIV_INTERN
378 int
380 /*=======================*/
383  trx_t* trx,
384  const ulint* field_lengths);
390 /*********************************************************************/
398 UNIV_INTERN
399 int
401 /*==============================*/
402  trx_t* trx,
403  const char* sql_string,
408  size_t sql_length,
409  const char* name,
412  ibool reject_fks);
416 /*********************************************************************/
421 UNIV_INTERN
422 ulint
424 /*=========================================*/
425 /*********************************************************************/
429 UNIV_INTERN
430 ulint
432 /*======================================*/
433 /*********************************************************************/
436 UNIV_INTERN
437 int
439 /*=========================*/
441  trx_t* trx);
442 /*********************************************************************/
450 UNIV_INTERN
451 int
453 /*=====================*/
454  const char* name,
455  trx_t* trx,
456  ibool drop_db);
457 /*********************************************************************/
459 UNIV_INTERN
460 void
462 /*============================*/
463 
464 /*********************************************************************/
469 UNIV_INTERN
470 int
472 /*=============================*/
473  const char* name,
474  trx_t* trx);
475 /*****************************************************************/
479 UNIV_INTERN
480 int
482 /*============================*/
483  const char* name,
484  trx_t* trx);
485 /*********************************************************************/
488 UNIV_INTERN
489 int
491 /*========================*/
492  const char* name,
493  trx_t* trx);
494 /*********************************************************************/
497 UNIV_INTERN
498 ulint
500 /*=======================*/
501  const char* old_name,
502  const char* new_name,
503  trx_t* trx,
504  ibool commit);
505 /*********************************************************************/
510 UNIV_INTERN
511 ulint
513 /*======================*/
514  row_prebuilt_t* prebuilt,
516  const dict_index_t* index,
517  ulint* n_rows);
520 /*********************************************************************/
523 UNIV_INTERN
524 ibool
526 /*=======================*/
527  const char* table_name);
530 /* A struct describing a place for an individual column in the MySQL
531 row format which is presented to the table handler in ha_innobase.
532 This template struct is used to speed up row transformations between
533 Innobase and MySQL. */
534 
537  ulint col_no;
538  ulint rec_field_no;
554  ulint type;
556  ulint mysql_type;
566  ulint charset;
568  ulint mbminlen;
570  ulint mbmaxlen;
572  ulint is_unsigned;
575 };
576 
577 #define MYSQL_FETCH_CACHE_SIZE 8
578 /* After fetching this many rows, we start caching them in fetch_cache */
579 #define MYSQL_FETCH_CACHE_THRESHOLD 4
580 
581 #define ROW_PREBUILT_ALLOCATED 78540783
582 #define ROW_PREBUILT_FREED 26423527
583 
588  ulint magic_n;
596  unsigned sql_stat_start:1;
600  unsigned mysql_has_locked:1;
611  unsigned index_usable:1;
613  unsigned read_just_key:1;
619  unsigned template_type:2;
623  unsigned n_template:10;
625  unsigned null_bitmap_len:10;
652  const byte* default_rec;
676  byte row_id[DATA_ROW_ID_LEN];
735  byte* fetch_cache[MYSQL_FETCH_CACHE_SIZE];
757  /*----------------------*/
758  ib_uint64_t autoinc_last_value;
760  ib_uint64_t autoinc_increment;
764  ib_uint64_t autoinc_offset; /* The offset passed to
765  get_auto_increment() by MySQL. Required
766  to calculate the next value */
772  /*----------------------*/
773  ulint magic_n2;
775 };
776 
777 #define ROW_PREBUILT_FETCH_MAGIC_N 465765687
778 
779 #define ROW_MYSQL_WHOLE_ROW 0
780 #define ROW_MYSQL_REC_FIELDS 1
781 #define ROW_MYSQL_NO_TEMPLATE 2
782 #define ROW_MYSQL_DUMMY_TEMPLATE 3 /* dummy template used in
783  row_scan_and_check_index */
784 
785 /* Values for hint_need_to_fetch_extra_cols */
786 #define ROW_RETRIEVE_PRIMARY_KEY 1
787 #define ROW_RETRIEVE_ALL_COLS 2
788 
789 /* Values for row_read_type */
790 #define ROW_READ_WITH_LOCKS 0
791 #define ROW_READ_TRY_SEMI_CONSISTENT 1
792 #define ROW_READ_DID_SEMI_CONSISTENT 2
793 
794 #ifndef UNIV_NONINL
795 #include "row0mysql.ic"
796 #endif
797 
798 #endif