Drizzled Public API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
66
dfield_set_type
(
67
/*============*/
68
dfield_t
* field,
69
dtype_t
* type);
70
/*********************************************************************/
73
UNIV_INLINE
74
ulint
75
dfield_get_len
(
76
/*===========*/
77
const
dfield_t
* field);
78
/*********************************************************************/
80
UNIV_INLINE
81
void
82
dfield_set_len
(
83
/*===========*/
84
dfield_t
* field,
85
ulint len);
86
/*********************************************************************/
89
UNIV_INLINE
90
ulint
91
dfield_is_null
(
92
/*===========*/
93
const
dfield_t
* field);
94
/*********************************************************************/
97
UNIV_INLINE
98
ulint
99
dfield_is_ext
(
100
/*==========*/
101
const
dfield_t
* field);
102
/*********************************************************************/
104
UNIV_INLINE
105
void
106
dfield_set_ext
(
107
/*===========*/
108
dfield_t
* field);
109
/*********************************************************************/
111
UNIV_INLINE
112
void
113
dfield_set_data
(
114
/*============*/
115
dfield_t
* field,
116
const
void
* data,
117
ulint len);
118
/*********************************************************************/
120
UNIV_INLINE
121
void
122
dfield_set_null
(
123
/*============*/
124
dfield_t
* field);
125
/**********************************************************************/
127
UNIV_INLINE
128
void
129
data_write_sql_null
(
130
/*================*/
131
byte* data,
132
ulint len);
133
/*********************************************************************/
135
UNIV_INLINE
136
void
137
dfield_copy_data
(
138
/*=============*/
139
dfield_t
* field1,
140
const
dfield_t
* field2);
141
/*********************************************************************/
143
UNIV_INLINE
144
void
145
dfield_copy
(
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
164
dfield_datas_are_binary_equal
(
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
176
dfield_data_is_binary_equal(
177
/*========================*/
178
const
dfield_t
* field,
179
ulint len,
180
const
byte* data);
181
/*********************************************************************/
184
UNIV_INLINE
185
ulint
186
dtuple_get_n_fields
(
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
207
dtuple_get_info_bits
(
208
/*=================*/
209
const
dtuple_t
* tuple);
210
/*********************************************************************/
212
UNIV_INLINE
213
void
214
dtuple_set_info_bits
(
215
/*=================*/
216
dtuple_t
* tuple,
217
ulint info_bits);
218
/*********************************************************************/
221
UNIV_INLINE
222
ulint
223
dtuple_get_n_fields_cmp
(
224
/*====================*/
225
const
dtuple_t
* tuple);
226
/*********************************************************************/
228
UNIV_INLINE
229
void
230
dtuple_set_n_fields_cmp
(
231
/*====================*/
232
dtuple_t
* tuple,
233
ulint n_fields_cmp);
235
/**********************************************************/
239
UNIV_INLINE
240
dtuple_t
*
241
dtuple_create
(
242
/*==========*/
243
mem_heap_t
*
heap
,
245
ulint
n_fields
);
247
/**********************************************************/
251
UNIV_INLINE
252
const
dtuple_t
*
253
dtuple_from_fields
(
254
/*===============*/
255
dtuple_t
* tuple,
256
const
dfield_t
*
fields
,
257
ulint
n_fields
);
259
/*********************************************************************/
262
UNIV_INTERN
263
void
264
dtuple_set_n_fields(
265
/*================*/
266
dtuple_t
* tuple,
267
ulint
n_fields
);
268
/*********************************************************************/
272
UNIV_INLINE
273
dtuple_t
*
274
dtuple_copy
(
275
/*========*/
276
const
dtuple_t
* tuple,
277
mem_heap_t
*
heap
);
279
/**********************************************************/
283
UNIV_INLINE
284
ulint
285
dtuple_get_data_size
(
286
/*=================*/
287
const
dtuple_t
* tuple,
288
ulint comp);
289
/*********************************************************************/
292
UNIV_INLINE
293
ulint
294
dtuple_get_n_ext
(
295
/*=============*/
296
const
dtuple_t
* tuple);
297
/************************************************************/
301
UNIV_INTERN
302
int
303
dtuple_coll_cmp(
304
/*============*/
305
const
dtuple_t
* tuple1,
306
const
dtuple_t
* tuple2);
307
/************************************************************/
310
UNIV_INLINE
311
ulint
312
dtuple_fold
(
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
324
dtuple_set_types_binary
(
325
/*====================*/
326
dtuple_t
* tuple,
327
ulint n);
328
/**********************************************************************/
331
UNIV_INLINE
332
ibool
333
dtuple_contains_null
(
334
/*=================*/
335
const
dtuple_t
* tuple);
336
/**********************************************************/
339
UNIV_INTERN
340
ibool
341
dfield_check_typed
(
342
/*===============*/
343
const
dfield_t
* field);
344
/**********************************************************/
347
UNIV_INTERN
348
ibool
349
dtuple_check_typed
(
350
/*===============*/
351
const
dtuple_t
* tuple);
352
/**********************************************************/
355
UNIV_INTERN
356
ibool
357
dtuple_check_typed_no_assert(
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
375
dfield_print(
376
/*=========*/
377
const
dfield_t
* dfield);
378
/*************************************************************/
381
UNIV_INTERN
382
void
383
dfield_print_also_hex(
384
/*==================*/
385
const
dfield_t
* dfield);
386
/**********************************************************/
388
UNIV_INTERN
389
void
390
dtuple_print(
391
/*=========*/
392
FILE* f,
393
const
dtuple_t
* tuple);
394
/**************************************************************/
402
UNIV_INTERN
403
big_rec_t
*
404
dtuple_convert_big_rec(
405
/*===================*/
406
dict_index_t
* index,
407
dtuple_t
* entry,
408
ulint* n_ext);
410
/**************************************************************/
414
UNIV_INTERN
415
void
416
dtuple_convert_back_big_rec(
417
/*========================*/
418
dict_index_t
* index,
419
dtuple_t
* entry,
420
big_rec_t
* vector);
422
/**************************************************************/
424
UNIV_INLINE
425
void
426
dtuple_big_rec_free
(
427
/*================*/
428
big_rec_t
* vector);
431
/*######################################################################*/
432
434
struct
dfield_struct
{
435
void
*
data
;
436
unsigned
ext
:1;
437
unsigned
len
:32;
438
dtype_t
type
;
439
};
440
442
struct
dtuple_struct
{
443
ulint
info_bits
;
447
ulint
n_fields
;
448
ulint
n_fields_cmp
;
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
468
typedef
struct
big_rec_field_struct
big_rec_field_t
;
470
struct
big_rec_field_struct
{
471
ulint
field_no
;
472
ulint
len
;
473
const
void
*
data
;
474
};
475
478
struct
big_rec_struct
{
479
mem_heap_t
*
heap
;
481
ulint
n_fields
;
482
big_rec_field_t
*
fields
;
483
};
484
485
#ifndef UNIV_NONINL
486
#include "data0data.ic"
487
#endif
488
489
#endif
plugin
innobase
include
data0data.h
Generated on Tue Oct 29 2013 17:05:46 for drizzle by
1.8.4