MySQL 5.6.14 Source Code Document
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
fts0types.h
Go to the documentation of this file.
1
/*****************************************************************************
2
3
Copyright (c) 2007, 2011, Oracle and/or its affiliates. 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.,
15
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16
17
*****************************************************************************/
18
19
/******************************************************************/
26
#ifndef INNOBASE_FTS0TYPES_H
27
#define INNOBASE_FTS0TYPES_H
28
29
#include "
que0types.h
"
30
#include "
ut0byte.h
"
31
#include "
fut0fut.h
"
32
#include "
ut0rbt.h
"
33
#include "
fts0fts.h
"
34
36
struct
fts_que_t;
37
struct
fts_node_t
;
38
struct
fts_utf8_str_t;
39
41
typedef
pars_user_func_cb_t
fts_sql_callback
;
42
typedef
void (*fts_filter)(
void
*,
fts_node_t
*,
void
*, ulint len);
43
45
struct
fts_doc_stats_t
{
46
doc_id_t
doc_id
;
47
ulint
word_count
;
48
};
49
52
struct
fts_get_doc_t
{
53
fts_index_cache_t
*
54
index_cache
;
57
que_t
* get_document_graph;
58
fts_cache_t
*
cache
;
59
};
60
63
struct
fts_index_cache_t
{
64
dict_index_t
*
index
;
66
ib_rbt_t
*
words
;
69
ib_vector_t
*
doc_stats
;
76
que_t
**
ins_graph
;
78
que_t
**
sel_graph
;
79
CHARSET_INFO
*
charset
;
80
};
81
85
struct
fts_update_t
{
86
doc_id_t
doc_id
;
88
ib_vector_t
*
fts_indexes
;
94
};
95
97
struct
fts_stopword_t
{
98
ulint
status
;
99
ib_alloc_t
*
heap
;
100
ib_rbt_t
*
cached_stopword
;
101
CHARSET_INFO
*
charset
;
102
};
103
106
struct
fts_sync_t
{
107
trx_t
*
trx
;
109
dict_table_t
*
table
;
110
ulint
max_cache_size
;
111
ibool
cache_full
;
113
ulint
lower_index
;
116
ulint
upper_index
;
118
ibool
interrupted
;
119
doc_id_t
min_doc_id
;
122
doc_id_t
max_doc_id
;
125
ib_time_t
start_time
;
126
};
127
131
struct
fts_cache_t
{
132
rw_lock_t
lock
;
136
rw_lock_t
init_lock
;
140
ib_mutex_t
optimize_lock
;
142
ib_mutex_t
deleted_lock
;
144
ib_mutex_t
doc_id_lock
;
146
ib_vector_t
*
deleted_doc_ids
;
149
ib_vector_t
*
indexes
;
154
ib_vector_t
*
get_docs
;
158
ulint
total_size
;
161
fts_sync_t
*
sync
;
163
ib_alloc_t
*
sync_heap
;
169
ib_alloc_t
*
self_heap
;
175
doc_id_t
next_doc_id
;
177
doc_id_t
synced_doc_id
;
179
doc_id_t
first_doc_id
;
182
ulint
deleted
;
186
ulint
added
;
190
fts_stopword_t
stopword_info
;
191
mem_heap_t
*
cache_heap
;
192
};
193
195
struct
fts_node_t
{
196
doc_id_t
first_doc_id
;
198
doc_id_t
last_doc_id
;
200
byte*
ilist
;
208
ulint
doc_count
;
210
ulint
ilist_size
;
212
ulint
ilist_size_alloc
;
215
};
216
218
struct
fts_tokenizer_word_t
{
219
fts_string_t
text
;
221
ib_vector_t
*
nodes
;
223
};
224
226
struct
fts_word_t
{
227
fts_string_t
text
;
228
ib_vector_t
*
nodes
;
230
ib_alloc_t
*
heap_alloc
;
231
};
232
234
struct
fts_fetch_t
{
235
void
*
read_arg
;
237
fts_sql_callback
238
read_record
;
240
};
241
243
struct
fts_index_selector_t
{
244
ulint
value
;
247
const
char
*
suffix
;
248
};
249
251
struct
fts_doc_t
{
252
fts_string_t
text
;
254
ibool
found
;
257
ib_rbt_t
*
tokens
;
262
ib_alloc_t
*
self_heap
;
267
CHARSET_INFO
*
charset
;
268
};
269
271
struct
fts_token_t
{
272
fts_string_t
text
;
274
ib_vector_t
*
positions
;
277
};
278
280
extern
const
fts_index_selector_t
fts_index_selector
[];
281
282
/******************************************************************/
284
UNIV_INLINE
285
int
286
fts_utf8_string_cmp
(
287
/*================*/
292
const
void
* p1,
293
const
void
* p2);
295
/******************************************************************/
298
UNIV_INLINE
299
int
300
fts_utf8_string_cmp_prefix
(
301
/*=======================*/
306
const
void
* p1,
307
const
void
* p2);
309
/******************************************************************/
311
UNIV_INLINE
312
int
313
fts_trx_row_doc_id_cmp
(
314
/*===================*/
319
const
void
* p1,
320
const
void
* p2);
322
/******************************************************************/
324
UNIV_INLINE
325
int
326
fts_ranking_doc_id_cmp
(
327
/*===================*/
332
const
void
* p1,
333
const
void
* p2);
335
/******************************************************************/
337
UNIV_INLINE
338
int
339
fts_update_doc_id_cmp
(
340
/*==================*/
345
const
void
* p1,
346
const
void
* p2);
348
/******************************************************************/
350
UNIV_INLINE
351
ulint
352
fts_decode_vlc
(
353
/*===========*/
355
byte** ptr);
358
/******************************************************************/
360
UNIV_INLINE
361
void
362
fts_utf8_string_dup
(
363
/*================*/
368
fts_string_t
* dst,
369
const
fts_string_t
* src,
370
mem_heap_t
*
heap
);
372
/******************************************************************/
374
UNIV_INLINE
375
ulint
376
fts_get_encoded_len
(
377
/*================*/
380
ulint val);
382
/******************************************************************/
384
UNIV_INLINE
385
ulint
386
fts_encode_int
(
387
/*===========*/
390
ulint val,
391
byte*
buf
);
394
/******************************************************************/
409
UNIV_INLINE
410
ulint
411
fts_utf8_decode
(
412
/*============*/
417
const
byte** ptr);
423
/******************************************************************/
425
UNIV_INLINE
426
void
427
fts_utf8_tolower
(
428
/*=============*/
429
fts_string_t
* str);
431
/******************************************************************/
433
UNIV_INLINE
434
const
char
*
435
fts_get_suffix
(
436
/*===========*/
437
ulint selected);
439
/********************************************************************
440
Get the number of index selectors. */
441
UNIV_INLINE
442
ulint
443
fts_get_n_selectors(
void
);
444
/*=====================*/
445
446
/******************************************************************/
449
UNIV_INLINE
450
ulint
451
fts_select_index
(
452
/*=============*/
453
const
CHARSET_INFO
* cs,
454
const
byte* str,
455
ulint len);
457
/********************************************************************
458
Select the next FTS auxiliary index for the given character.
459
@return the next index to use for character */
460
UNIV_INLINE
461
ulint
462
fts_select_next_index
(
463
/*==================*/
464
const
CHARSET_INFO
* cs,
465
const
byte* str,
466
ulint len);
468
#ifndef UNIV_NONINL
469
#include "fts0types.ic"
470
#include "fts0vlc.ic"
471
#endif
472
473
#endif
/* INNOBASE_FTS0TYPES_H */
storage
innobase
include
fts0types.h
Generated on Sat Nov 9 2013 01:26:35 for MySQL 5.6.14 Source Code Document by
1.8.1.2