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
/*********************************************************************/
160
UNIV_INLINE
161
ibool
162
dfield_datas_are_binary_equal
(
163
/*==========================*/
164
const
dfield_t
* field1,
165
const
dfield_t
* field2);
166
/*********************************************************************/
169
UNIV_INTERN
170
ibool
171
dfield_data_is_binary_equal(
172
/*========================*/
173
const
dfield_t
* field,
174
ulint len,
175
const
byte* data);
176
/*********************************************************************/
179
UNIV_INLINE
180
ulint
181
dtuple_get_n_fields
(
182
/*================*/
183
const
dtuple_t
* tuple);
184
#ifdef UNIV_DEBUG
185
/*********************************************************************/
188
UNIV_INLINE
189
dfield_t
*
190
dtuple_get_nth_field(
191
/*=================*/
192
const
dtuple_t
* tuple,
193
ulint n);
194
#else
/* UNIV_DEBUG */
195
# define dtuple_get_nth_field(tuple, n) ((tuple)->fields + (n))
196
#endif
/* UNIV_DEBUG */
197
/*********************************************************************/
200
UNIV_INLINE
201
ulint
202
dtuple_get_info_bits
(
203
/*=================*/
204
const
dtuple_t
* tuple);
205
/*********************************************************************/
207
UNIV_INLINE
208
void
209
dtuple_set_info_bits
(
210
/*=================*/
211
dtuple_t
* tuple,
212
ulint info_bits);
213
/*********************************************************************/
216
UNIV_INLINE
217
ulint
218
dtuple_get_n_fields_cmp
(
219
/*====================*/
220
const
dtuple_t
* tuple);
221
/*********************************************************************/
223
UNIV_INLINE
224
void
225
dtuple_set_n_fields_cmp
(
226
/*====================*/
227
dtuple_t
* tuple,
228
ulint n_fields_cmp);
230
/**********************************************************/
234
UNIV_INLINE
235
dtuple_t
*
236
dtuple_create
(
237
/*==========*/
238
mem_heap_t
*
heap
,
240
ulint
n_fields
);
242
/**********************************************************/
246
UNIV_INLINE
247
const
dtuple_t
*
248
dtuple_from_fields
(
249
/*===============*/
250
dtuple_t
* tuple,
251
const
dfield_t
*
fields
,
252
ulint
n_fields
);
254
/*********************************************************************/
257
UNIV_INTERN
258
void
259
dtuple_set_n_fields(
260
/*================*/
261
dtuple_t
* tuple,
262
ulint
n_fields
);
263
/*********************************************************************/
267
UNIV_INLINE
268
dtuple_t
*
269
dtuple_copy
(
270
/*========*/
271
const
dtuple_t
* tuple,
272
mem_heap_t
*
heap
);
274
/**********************************************************/
278
UNIV_INLINE
279
ulint
280
dtuple_get_data_size
(
281
/*=================*/
282
const
dtuple_t
* tuple,
283
ulint comp);
284
/*********************************************************************/
287
UNIV_INLINE
288
ulint
289
dtuple_get_n_ext
(
290
/*=============*/
291
const
dtuple_t
* tuple);
292
/************************************************************/
296
UNIV_INTERN
297
int
298
dtuple_coll_cmp(
299
/*============*/
300
const
dtuple_t
* tuple1,
301
const
dtuple_t
* tuple2);
302
/************************************************************/
305
UNIV_INLINE
306
ulint
307
dtuple_fold
(
308
/*========*/
309
const
dtuple_t
* tuple,
310
ulint
n_fields
,
311
ulint n_bytes,
313
index_id_t tree_id)
314
__attribute__((pure));
315
/*******************************************************************/
317
UNIV_INLINE
318
void
319
dtuple_set_types_binary
(
320
/*====================*/
321
dtuple_t
* tuple,
322
ulint n);
323
/**********************************************************************/
326
UNIV_INLINE
327
ibool
328
dtuple_contains_null
(
329
/*=================*/
330
const
dtuple_t
* tuple);
331
/**********************************************************/
334
UNIV_INTERN
335
ibool
336
dfield_check_typed
(
337
/*===============*/
338
const
dfield_t
* field);
339
/**********************************************************/
342
UNIV_INTERN
343
ibool
344
dtuple_check_typed
(
345
/*===============*/
346
const
dtuple_t
* tuple);
347
/**********************************************************/
350
UNIV_INTERN
351
ibool
352
dtuple_check_typed_no_assert(
353
/*=========================*/
354
const
dtuple_t
* tuple);
355
#ifdef UNIV_DEBUG
356
/**********************************************************/
360
UNIV_INTERN
361
ibool
362
dtuple_validate(
363
/*============*/
364
const
dtuple_t
* tuple);
365
#endif
/* UNIV_DEBUG */
366
/*************************************************************/
368
UNIV_INTERN
369
void
370
dfield_print(
371
/*=========*/
372
const
dfield_t
* dfield);
373
/*************************************************************/
376
UNIV_INTERN
377
void
378
dfield_print_also_hex(
379
/*==================*/
380
const
dfield_t
* dfield);
381
/**********************************************************/
383
UNIV_INTERN
384
void
385
dtuple_print(
386
/*=========*/
387
FILE* f,
388
const
dtuple_t
* tuple);
389
/**************************************************************/
397
UNIV_INTERN
398
big_rec_t
*
399
dtuple_convert_big_rec(
400
/*===================*/
401
dict_index_t
* index,
402
dtuple_t
* entry,
403
ulint* n_ext);
405
/**************************************************************/
409
UNIV_INTERN
410
void
411
dtuple_convert_back_big_rec(
412
/*========================*/
413
dict_index_t
* index,
414
dtuple_t
* entry,
415
big_rec_t
* vector);
417
/**************************************************************/
419
UNIV_INLINE
420
void
421
dtuple_big_rec_free
(
422
/*================*/
423
big_rec_t
* vector);
426
/*######################################################################*/
427
429
struct
dfield_struct
{
430
void
*
data
;
431
unsigned
ext
:1;
432
unsigned
len
:32;
433
dtype_t
type
;
434
};
435
437
struct
dtuple_struct
{
438
ulint
info_bits
;
442
ulint
n_fields
;
443
ulint
n_fields_cmp
;
450
dfield_t
*
fields
;
451
UT_LIST_NODE_T
(
dtuple_t
) tuple_list;
454
#ifdef UNIV_DEBUG
455
ulint magic_n;
458
# define DATA_TUPLE_MAGIC_N 65478679
459
#endif
/* UNIV_DEBUG */
460
};
461
463
typedef
struct
big_rec_field_struct
big_rec_field_t
;
465
struct
big_rec_field_struct
{
466
ulint
field_no
;
467
ulint
len
;
468
const
void
*
data
;
469
};
470
473
struct
big_rec_struct
{
474
mem_heap_t
*
heap
;
476
ulint
n_fields
;
477
big_rec_field_t
*
fields
;
478
};
479
480
#ifndef UNIV_NONINL
481
#include "data0data.ic"
482
#endif
483
484
#endif
plugin
innobase
include
data0data.h
Generated on Mon Jun 10 2013 09:48:17 for drizzle by
1.8.1.2