drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
data0data.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (C) 1994, 2009, Innobase Oy. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/********************************************************************/
25
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
40
41#ifdef UNIV_DEBUG
42/*********************************************************************/
45UNIV_INLINE
46dtype_t*
47dfield_get_type(
48/*============*/
49 const dfield_t* field);
50/*********************************************************************/
53UNIV_INLINE
54void*
55dfield_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/*********************************************************************/
64UNIV_INLINE
65void
67/*============*/
68 dfield_t* field,
69 dtype_t* type);
70/*********************************************************************/
73UNIV_INLINE
74ulint
76/*===========*/
77 const dfield_t* field);
78/*********************************************************************/
80UNIV_INLINE
81void
83/*===========*/
84 dfield_t* field,
85 ulint len);
86/*********************************************************************/
89UNIV_INLINE
90ulint
92/*===========*/
93 const dfield_t* field);
94/*********************************************************************/
97UNIV_INLINE
98ulint
100/*==========*/
101 const dfield_t* field);
102/*********************************************************************/
104UNIV_INLINE
105void
107/*===========*/
108 dfield_t* field);
109/*********************************************************************/
111UNIV_INLINE
112void
114/*============*/
115 dfield_t* field,
116 const void* data,
117 ulint len);
118/*********************************************************************/
120UNIV_INLINE
121void
123/*============*/
124 dfield_t* field);
125/**********************************************************************/
127UNIV_INLINE
128void
130/*================*/
131 byte* data,
132 ulint len);
133/*********************************************************************/
135UNIV_INLINE
136void
138/*=============*/
139 dfield_t* field1,
140 const dfield_t* field2);
141/*********************************************************************/
143UNIV_INLINE
144void
146/*========*/
147 dfield_t* field1,
148 const dfield_t* field2);
149/*********************************************************************/
151UNIV_INLINE
152void
154/*=======*/
155 dfield_t* field,
156 mem_heap_t* heap);
157/*********************************************************************/
162UNIV_INLINE
163ibool
165/*==========================*/
166 const dfield_t* field1,
167 const dfield_t* field2,
168 ulint len)
170 __attribute__((nonnull, warn_unused_result));
171/*********************************************************************/
174UNIV_INTERN
175ibool
177/*========================*/
178 const dfield_t* field,
179 ulint len,
180 const byte* data);
181/*********************************************************************/
184UNIV_INLINE
185ulint
187/*================*/
188 const dtuple_t* tuple);
189#ifdef UNIV_DEBUG
190/*********************************************************************/
193UNIV_INLINE
194dfield_t*
195dtuple_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/*********************************************************************/
205UNIV_INLINE
206ulint
208/*=================*/
209 const dtuple_t* tuple);
210/*********************************************************************/
212UNIV_INLINE
213void
215/*=================*/
216 dtuple_t* tuple,
217 ulint info_bits);
218/*********************************************************************/
221UNIV_INLINE
222ulint
224/*====================*/
225 const dtuple_t* tuple);
226/*********************************************************************/
228UNIV_INLINE
229void
231/*====================*/
232 dtuple_t* tuple,
233 ulint n_fields_cmp);
235/**********************************************************/
239UNIV_INLINE
240dtuple_t*
242/*==========*/
243 mem_heap_t* heap,
245 ulint n_fields);
246
247/**********************************************************/
251UNIV_INLINE
252const dtuple_t*
254/*===============*/
255 dtuple_t* tuple,
256 const dfield_t* fields,
257 ulint n_fields);
258
259/*********************************************************************/
262UNIV_INTERN
263void
265/*================*/
266 dtuple_t* tuple,
267 ulint n_fields);
268/*********************************************************************/
272UNIV_INLINE
273dtuple_t*
275/*========*/
276 const dtuple_t* tuple,
277 mem_heap_t* heap);
279/**********************************************************/
283UNIV_INLINE
284ulint
286/*=================*/
287 const dtuple_t* tuple,
288 ulint comp);
289/*********************************************************************/
292UNIV_INLINE
293ulint
295/*=============*/
296 const dtuple_t* tuple);
297/************************************************************/
301UNIV_INTERN
302int
304/*============*/
305 const dtuple_t* tuple1,
306 const dtuple_t* tuple2);
307/************************************************************/
310UNIV_INLINE
311ulint
313/*========*/
314 const dtuple_t* tuple,
315 ulint n_fields,
316 ulint n_bytes,
318 index_id_t tree_id)
319 __attribute__((pure));
320/*******************************************************************/
322UNIV_INLINE
323void
325/*====================*/
326 dtuple_t* tuple,
327 ulint n);
328/**********************************************************************/
331UNIV_INLINE
332ibool
334/*=================*/
335 const dtuple_t* tuple);
336/**********************************************************/
339UNIV_INTERN
340ibool
342/*===============*/
343 const dfield_t* field);
344/**********************************************************/
347UNIV_INTERN
348ibool
350/*===============*/
351 const dtuple_t* tuple);
352/**********************************************************/
355UNIV_INTERN
356ibool
358/*=========================*/
359 const dtuple_t* tuple);
360#ifdef UNIV_DEBUG
361/**********************************************************/
365UNIV_INTERN
366ibool
367dtuple_validate(
368/*============*/
369 const dtuple_t* tuple);
370#endif /* UNIV_DEBUG */
371/*************************************************************/
373UNIV_INTERN
374void
376/*=========*/
377 const dfield_t* dfield);
378/*************************************************************/
381UNIV_INTERN
382void
384/*==================*/
385 const dfield_t* dfield);
386/**********************************************************/
388UNIV_INTERN
389void
391/*=========*/
392 FILE* f,
393 const dtuple_t* tuple);
394/**************************************************************/
402UNIV_INTERN
405/*===================*/
406 dict_index_t* index,
407 dtuple_t* entry,
408 ulint* n_ext);
410/**************************************************************/
414UNIV_INTERN
415void
417/*========================*/
418 dict_index_t* index,
419 dtuple_t* entry,
420 big_rec_t* vector);
422/**************************************************************/
424UNIV_INLINE
425void
427/*================*/
428 big_rec_t* vector);
430
431/*######################################################################*/
432
435 void* data;
436 unsigned ext:1;
437 unsigned len:32;
438 dtype_t type;
439};
440
443 ulint info_bits;
447 ulint n_fields;
455 dfield_t* fields;
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
484
485#ifndef UNIV_NONINL
486#include "data0data.ic"
487#endif
488
489#endif
UNIV_INLINE void dfield_set_data(dfield_t *field, const void *data, ulint len)
UNIV_INTERN ibool dtuple_check_typed(const dtuple_t *tuple)
UNIV_INLINE ibool dfield_datas_are_binary_equal(const dfield_t *field1, const dfield_t *field2, ulint len) __attribute__((nonnull
UNIV_INLINE dtuple_t * dtuple_create(mem_heap_t *heap, ulint n_fields)
struct big_rec_field_struct big_rec_field_t
Definition data0data.h:468
UNIV_INLINE void dfield_dup(dfield_t *field, mem_heap_t *heap)
UNIV_INLINE ulint dtuple_fold(const dtuple_t *tuple, ulint n_fields, ulint n_bytes, index_id_t tree_id) __attribute__((pure))
UNIV_INLINE void dfield_set_len(dfield_t *field, ulint len)
UNIV_INLINE ulint dfield_is_null(const dfield_t *field)
UNIV_INLINE ulint dtuple_get_n_fields(const dtuple_t *tuple)
UNIV_INLINE void dtuple_set_types_binary(dtuple_t *tuple, ulint n)
UNIV_INTERN int dtuple_coll_cmp(const dtuple_t *tuple1, const dtuple_t *tuple2)
Definition data0data.cc:91
UNIV_INLINE ulint dtuple_get_info_bits(const dtuple_t *tuple)
UNIV_INLINE void dfield_set_ext(dfield_t *field)
UNIV_INTERN ibool dtuple_check_typed_no_assert(const dtuple_t *tuple)
Definition data0data.cc:170
UNIV_INTERN void dtuple_set_n_fields(dtuple_t *tuple, ulint n_fields)
Definition data0data.cc:132
UNIV_INLINE ibool dtuple_contains_null(const dtuple_t *tuple)
UNIV_INLINE void data_write_sql_null(byte *data, ulint len)
UNIV_INTERN void dfield_print_also_hex(const dfield_t *dfield)
Definition data0data.cc:346
UNIV_INLINE void dfield_copy(dfield_t *field1, const dfield_t *field2)
UNIV_INLINE void dfield_copy_data(dfield_t *field1, const dfield_t *field2)
UNIV_INLINE void dfield_set_null(dfield_t *field)
UNIV_INLINE void dtuple_set_n_fields_cmp(dtuple_t *tuple, ulint n_fields_cmp)
UNIV_INTERN ibool dfield_check_typed(const dfield_t *field)
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 void dtuple_convert_back_big_rec(dict_index_t *index, dtuple_t *entry, big_rec_t *vector)
Definition data0data.cc:768
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_type(dfield_t *field, dtype_t *type)
UNIV_INLINE ulint dfield_get_len(const dfield_t *field)
UNIV_INLINE void dtuple_big_rec_free(big_rec_t *vector)
UNIV_INLINE ulint dtuple_get_data_size(const dtuple_t *tuple, ulint comp)
UNIV_INLINE void dtuple_set_info_bits(dtuple_t *tuple, ulint info_bits)
UNIV_INTERN void dtuple_print(FILE *f, const dtuple_t *tuple)
Definition data0data.cc:532
struct big_rec_struct big_rec_t
Definition data0data.h:39
UNIV_INTERN ibool dfield_data_is_binary_equal(const dfield_t *field, ulint len, const byte *data)
Definition data0data.cc:61
UNIV_INLINE dtuple_t * dtuple_copy(const dtuple_t *tuple, mem_heap_t *heap)
UNIV_INLINE ulint dtuple_get_n_ext(const dtuple_t *tuple)
UNIV_INLINE ulint dfield_is_ext(const dfield_t *field)
UNIV_INLINE const dtuple_t * dtuple_from_fields(dtuple_t *tuple, const dfield_t *fields, ulint n_fields)
const void * data
Definition data0data.h:473
big_rec_field_t * fields
Definition data0data.h:482
mem_heap_t * heap
Definition data0data.h:479
unsigned len
Definition data0data.h:437
unsigned ext
Definition data0data.h:436
dtype_t type
Definition data0data.h:438
UT_LIST_NODE_T(dtuple_t) tuple_list
ulint info_bits
Definition data0data.h:443
dfield_t * fields
Definition data0data.h:455
ulint n_fields_cmp
Definition data0data.h:448