Drizzled Public API Documentation

data0data.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (C) 1994, 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 data0data_h
28 #define data0data_h
29 
30 #include "univ.i"
31 
32 #include "data0types.h"
33 #include "data0type.h"
34 #include "mem0mem.h"
35 #include "dict0types.h"
36 
39 typedef struct big_rec_struct big_rec_t;
40 
41 #ifdef UNIV_DEBUG
42 /*********************************************************************/
45 UNIV_INLINE
46 dtype_t*
47 dfield_get_type(
48 /*============*/
49  const dfield_t* field);
50 /*********************************************************************/
53 UNIV_INLINE
54 void*
55 dfield_get_data(
56 /*============*/
57  const dfield_t* field);
58 #else /* UNIV_DEBUG */
59 # define dfield_get_type(field) (&(field)->type)
60 # define dfield_get_data(field) ((field)->data)
61 #endif /* UNIV_DEBUG */
62 /*********************************************************************/
64 UNIV_INLINE
65 void
67 /*============*/
68  dfield_t* field,
69  dtype_t* type);
70 /*********************************************************************/
73 UNIV_INLINE
74 ulint
76 /*===========*/
77  const dfield_t* field);
78 /*********************************************************************/
80 UNIV_INLINE
81 void
83 /*===========*/
84  dfield_t* field,
85  ulint len);
86 /*********************************************************************/
89 UNIV_INLINE
90 ulint
92 /*===========*/
93  const dfield_t* field);
94 /*********************************************************************/
97 UNIV_INLINE
98 ulint
100 /*==========*/
101  const dfield_t* field);
102 /*********************************************************************/
104 UNIV_INLINE
105 void
107 /*===========*/
108  dfield_t* field);
109 /*********************************************************************/
111 UNIV_INLINE
112 void
114 /*============*/
115  dfield_t* field,
116  const void* data,
117  ulint len);
118 /*********************************************************************/
120 UNIV_INLINE
121 void
123 /*============*/
124  dfield_t* field);
125 /**********************************************************************/
127 UNIV_INLINE
128 void
130 /*================*/
131  byte* data,
132  ulint len);
133 /*********************************************************************/
135 UNIV_INLINE
136 void
138 /*=============*/
139  dfield_t* field1,
140  const dfield_t* field2);
141 /*********************************************************************/
143 UNIV_INLINE
144 void
146 /*========*/
147  dfield_t* field1,
148  const dfield_t* field2);
149 /*********************************************************************/
151 UNIV_INLINE
152 void
153 dfield_dup(
154 /*=======*/
155  dfield_t* field,
156  mem_heap_t* heap);
157 /*********************************************************************/
162 UNIV_INLINE
163 ibool
165 /*==========================*/
166  const dfield_t* field1,
167  const dfield_t* field2,
168  ulint len)
170  __attribute__((nonnull, warn_unused_result));
171 /*********************************************************************/
174 UNIV_INTERN
175 ibool
177 /*========================*/
178  const dfield_t* field,
179  ulint len,
180  const byte* data);
181 /*********************************************************************/
184 UNIV_INLINE
185 ulint
187 /*================*/
188  const dtuple_t* tuple);
189 #ifdef UNIV_DEBUG
190 /*********************************************************************/
193 UNIV_INLINE
194 dfield_t*
195 dtuple_get_nth_field(
196 /*=================*/
197  const dtuple_t* tuple,
198  ulint n);
199 #else /* UNIV_DEBUG */
200 # define dtuple_get_nth_field(tuple, n) ((tuple)->fields + (n))
201 #endif /* UNIV_DEBUG */
202 /*********************************************************************/
205 UNIV_INLINE
206 ulint
208 /*=================*/
209  const dtuple_t* tuple);
210 /*********************************************************************/
212 UNIV_INLINE
213 void
215 /*=================*/
216  dtuple_t* tuple,
217  ulint info_bits);
218 /*********************************************************************/
221 UNIV_INLINE
222 ulint
224 /*====================*/
225  const dtuple_t* tuple);
226 /*********************************************************************/
228 UNIV_INLINE
229 void
231 /*====================*/
232  dtuple_t* tuple,
233  ulint n_fields_cmp);
235 /**********************************************************/
239 UNIV_INLINE
240 dtuple_t*
242 /*==========*/
243  mem_heap_t* heap,
245  ulint n_fields);
247 /**********************************************************/
251 UNIV_INLINE
252 const dtuple_t*
254 /*===============*/
255  dtuple_t* tuple,
256  const dfield_t* fields,
257  ulint n_fields);
259 /*********************************************************************/
262 UNIV_INTERN
263 void
265 /*================*/
266  dtuple_t* tuple,
267  ulint n_fields);
268 /*********************************************************************/
272 UNIV_INLINE
273 dtuple_t*
275 /*========*/
276  const dtuple_t* tuple,
277  mem_heap_t* heap);
279 /**********************************************************/
283 UNIV_INLINE
284 ulint
286 /*=================*/
287  const dtuple_t* tuple,
288  ulint comp);
289 /*********************************************************************/
292 UNIV_INLINE
293 ulint
295 /*=============*/
296  const dtuple_t* tuple);
297 /************************************************************/
301 UNIV_INTERN
302 int
304 /*============*/
305  const dtuple_t* tuple1,
306  const dtuple_t* tuple2);
307 /************************************************************/
310 UNIV_INLINE
311 ulint
313 /*========*/
314  const dtuple_t* tuple,
315  ulint n_fields,
316  ulint n_bytes,
318  index_id_t tree_id)
319  __attribute__((pure));
320 /*******************************************************************/
322 UNIV_INLINE
323 void
325 /*====================*/
326  dtuple_t* tuple,
327  ulint n);
328 /**********************************************************************/
331 UNIV_INLINE
332 ibool
334 /*=================*/
335  const dtuple_t* tuple);
336 /**********************************************************/
339 UNIV_INTERN
340 ibool
342 /*===============*/
343  const dfield_t* field);
344 /**********************************************************/
347 UNIV_INTERN
348 ibool
350 /*===============*/
351  const dtuple_t* tuple);
352 /**********************************************************/
355 UNIV_INTERN
356 ibool
358 /*=========================*/
359  const dtuple_t* tuple);
360 #ifdef UNIV_DEBUG
361 /**********************************************************/
365 UNIV_INTERN
366 ibool
367 dtuple_validate(
368 /*============*/
369  const dtuple_t* tuple);
370 #endif /* UNIV_DEBUG */
371 /*************************************************************/
373 UNIV_INTERN
374 void
376 /*=========*/
377  const dfield_t* dfield);
378 /*************************************************************/
381 UNIV_INTERN
382 void
384 /*==================*/
385  const dfield_t* dfield);
386 /**********************************************************/
388 UNIV_INTERN
389 void
391 /*=========*/
392  FILE* f,
393  const dtuple_t* tuple);
394 /**************************************************************/
402 UNIV_INTERN
403 big_rec_t*
405 /*===================*/
406  dict_index_t* index,
407  dtuple_t* entry,
408  ulint* n_ext);
410 /**************************************************************/
414 UNIV_INTERN
415 void
417 /*========================*/
418  dict_index_t* index,
419  dtuple_t* entry,
420  big_rec_t* vector);
422 /**************************************************************/
424 UNIV_INLINE
425 void
427 /*================*/
428  big_rec_t* vector);
431 /*######################################################################*/
432 
435  void* data;
436  unsigned ext:1;
437  unsigned len:32;
439 };
440 
443  ulint info_bits;
447  ulint n_fields;
448  ulint n_fields_cmp;
456  UT_LIST_NODE_T(dtuple_t) tuple_list;
459 #ifdef UNIV_DEBUG
460  ulint magic_n;
463 # define DATA_TUPLE_MAGIC_N 65478679
464 #endif /* UNIV_DEBUG */
465 };
466 
471  ulint field_no;
472  ulint len;
473  const void* data;
474 };
475 
481  ulint n_fields;
483 };
484 
485 #ifndef UNIV_NONINL
486 #include "data0data.ic"
487 #endif
488 
489 #endif
dtype_t type
Definition: data0data.h:438
UNIV_INTERN void dtuple_convert_back_big_rec(dict_index_t *index, dtuple_t *entry, big_rec_t *vector)
Definition: data0data.cc:768
ulint n_fields
Definition: data0data.h:447
UNIV_INLINE ibool dtuple_contains_null(const dtuple_t *tuple)
mem_heap_t * heap
Definition: data0data.h:479
UNIV_INLINE void dfield_set_len(dfield_t *field, ulint len)
UNIV_INLINE dtuple_t * dtuple_create(mem_heap_t *heap, ulint n_fields)
UNIV_INLINE ulint dfield_is_ext(const dfield_t *field)
UNIV_INLINE ulint dtuple_get_n_ext(const dtuple_t *tuple)
UNIV_INTERN int dtuple_coll_cmp(const dtuple_t *tuple1, const dtuple_t *tuple2)
Definition: data0data.cc:91
ulint info_bits
Definition: data0data.h:443
big_rec_field_t * fields
Definition: data0data.h:482
ulint n_fields
Definition: data0data.h:481
UNIV_INLINE void dfield_copy(dfield_t *field1, const dfield_t *field2)
UNIV_INTERN ibool dfield_data_is_binary_equal(const dfield_t *field, ulint len, const byte *data)
Definition: data0data.cc:61
UNIV_INTERN void dtuple_print(FILE *f, const dtuple_t *tuple)
Definition: data0data.cc:532
UNIV_INLINE void dfield_copy_data(dfield_t *field1, const dfield_t *field2)
UNIV_INLINE ulint dtuple_get_n_fields(const dtuple_t *tuple)
UT_LIST_NODE_T(dtuple_t) tuple_list
const void * data
Definition: data0data.h:473
UNIV_INTERN big_rec_t * dtuple_convert_big_rec(dict_index_t *index, dtuple_t *entry, ulint *n_ext)
Definition: data0data.cc:566
UNIV_INLINE void dfield_set_data(dfield_t *field, const void *data, ulint len)
UNIV_INLINE ulint dfield_get_len(const dfield_t *field)
UNIV_INTERN void dtuple_set_n_fields(dtuple_t *tuple, ulint n_fields)
Definition: data0data.cc:132
UNIV_INTERN void dfield_print(const dfield_t *dfield)
Definition: data0data.cc:305
UNIV_INLINE ulint dtuple_get_n_fields_cmp(const dtuple_t *tuple)
UNIV_INTERN ibool dtuple_check_typed(const dtuple_t *tuple)
UNIV_INLINE dtuple_t * dtuple_copy(const dtuple_t *tuple, mem_heap_t *heap)
UNIV_INLINE void dfield_set_type(dfield_t *field, dtype_t *type)
UNIV_INLINE void dtuple_set_info_bits(dtuple_t *tuple, ulint info_bits)
UNIV_INLINE ulint dtuple_get_info_bits(const dtuple_t *tuple)
dfield_t * fields
Definition: data0data.h:455
UNIV_INLINE ibool dfield_datas_are_binary_equal(const dfield_t *field1, const dfield_t *field2, ulint len) __attribute__((nonnull
UNIV_INLINE ulint dfield_is_null(const dfield_t *field)
UNIV_INLINE void dtuple_big_rec_free(big_rec_t *vector)
unsigned ext
Definition: data0data.h:436
UNIV_INLINE void dtuple_set_n_fields_cmp(dtuple_t *tuple, ulint n_fields_cmp)
void * data
Definition: data0data.h:435
UNIV_INLINE ulint dtuple_get_data_size(const dtuple_t *tuple, ulint comp)
UNIV_INTERN ibool dtuple_check_typed_no_assert(const dtuple_t *tuple)
Definition: data0data.cc:170
UNIV_INLINE void dfield_set_null(dfield_t *field)
UNIV_INLINE void dfield_dup(dfield_t *field, mem_heap_t *heap)
UNIV_INLINE void data_write_sql_null(byte *data, ulint len)
UNIV_INLINE ulint dtuple_fold(const dtuple_t *tuple, ulint n_fields, ulint n_bytes, index_id_t tree_id) __attribute__((pure))
unsigned len
Definition: data0data.h:437
ulint n_fields_cmp
Definition: data0data.h:448
UNIV_INLINE void dtuple_set_types_binary(dtuple_t *tuple, ulint n)
UNIV_INTERN void dfield_print_also_hex(const dfield_t *dfield)
Definition: data0data.cc:346
UNIV_INTERN ibool dfield_check_typed(const dfield_t *field)
UNIV_INLINE void dfield_set_ext(dfield_t *field)
UNIV_INLINE const dtuple_t * dtuple_from_fields(dtuple_t *tuple, const dfield_t *fields, ulint n_fields)