#include "myisamdef.h"#include "ft_global.h"Include dependency graph for fulltext.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Defines | |
| #define | HA_FT_WTYPE HA_KEYTYPE_FLOAT |
| #define | HA_FT_WLEN 4 |
| #define | FT_SEGS 2 |
| #define | ft_sintXkorr(A) mi_sint4korr(A) |
| #define | ft_intXstore(T, A) mi_int4store(T,A) |
Functions | |
| int | _mi_ft_cmp (MI_INFO *, uint, const byte *, const byte *) |
| int | _mi_ft_add (MI_INFO *, uint, byte *, const byte *, my_off_t) |
| int | _mi_ft_del (MI_INFO *, uint, byte *, const byte *, my_off_t) |
| uint | _mi_ft_convert_to_ft2 (MI_INFO *, uint, uchar *) |
Variables | |
| const HA_KEYSEG | ft_keysegs [FT_SEGS] |
Definition at line 29 of file fulltext.h.
Referenced by _mi_ft_convert_to_ft2(), d_search(), sort_ft_buf_flush(), and w_search().
| #define FT_SEGS 2 |
Definition at line 28 of file fulltext.h.
Referenced by _ft2_search(), chk_index(), d_search(), main(), sort_one_index(), w_search(), and walk_and_match().
| #define HA_FT_WLEN 4 |
Definition at line 25 of file fulltext.h.
Referenced by _ft2_search(), _ft_make_key(), _mi_ft_convert_to_ft2(), d_search(), ftb_query_add_word(), mi_open(), sort_ft_buf_flush(), sort_ft_key_write(), w_search(), and walk_and_match().
| #define HA_FT_WTYPE HA_KEYTYPE_FLOAT |
Definition at line 24 of file fulltext.h.
Definition at line 245 of file ft_update.c.
References _mi_ft_parserecord(), _mi_ft_store(), DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, error, free_root(), st_myisam_info::ft_memroot, MY_MARK_BLOCKS_FREE, and MYF.
Referenced by writekeys().
00247 { 00248 int error= -1; 00249 FT_WORD *wlist; 00250 DBUG_ENTER("_mi_ft_add"); 00251 DBUG_PRINT("enter",("keynr: %d",keynr)); 00252 00253 if ((wlist=_mi_ft_parserecord(info, keynr, record, &info->ft_memroot))) 00254 error=_mi_ft_store(info,keynr,keybuf,wlist,pos); 00255 00256 free_root(&info->ft_memroot, MYF(MY_MARK_BLOCKS_FREE)); 00257 DBUG_PRINT("exit",("Return: %d",error)); 00258 DBUG_RETURN(error); 00259 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 172 of file ft_update.c.
References _mi_ft_segiterator(), _mi_ft_segiterator_init(), st_HA_KEYSEG::charset, DBUG_ENTER, DBUG_RETURN, GEE_THEY_ARE_ABSOLUTELY_IDENTICAL, st_mi_isam_share::keyinfo, _st_ft_seg_iterator::len, mi_compare_text(), _st_ft_seg_iterator::pos, st_myisam_info::s, st_mi_keydef::seg, and THOSE_TWO_DAMN_KEYS_ARE_REALLY_DIFFERENT.
00173 { 00174 FT_SEG_ITERATOR ftsi1, ftsi2; 00175 CHARSET_INFO *cs=info->s->keyinfo[keynr].seg->charset; 00176 DBUG_ENTER("_mi_ft_cmp"); 00177 _mi_ft_segiterator_init(info, keynr, rec1, &ftsi1); 00178 _mi_ft_segiterator_init(info, keynr, rec2, &ftsi2); 00179 00180 while (_mi_ft_segiterator(&ftsi1) && _mi_ft_segiterator(&ftsi2)) 00181 { 00182 if ((ftsi1.pos != ftsi2.pos) && 00183 (!ftsi1.pos || !ftsi2.pos || 00184 mi_compare_text(cs, (uchar*) ftsi1.pos,ftsi1.len, 00185 (uchar*) ftsi2.pos,ftsi2.len,0,0))) 00186 DBUG_RETURN(THOSE_TWO_DAMN_KEYS_ARE_REALLY_DIFFERENT); 00187 } 00188 DBUG_RETURN(GEE_THEY_ARE_ABSOLUTELY_IDENTICAL); 00189 }
Here is the call graph for this function:

Definition at line 305 of file ft_update.c.
References _mi_ck_delete(), _mi_ck_real_write_btree(), _mi_dpointer(), _mi_new(), _mi_write_keypage(), st_mi_keydef::block_length, st_myisam_info::buff, st_myisam_info::buff_used, DBUG_ENTER, DBUG_RETURN, DFLT_INIT_HITS, dynamic_array_ptr, st_dynamic_array::elements, st_myisam_info::ft1_to_ft2, st_mi_isam_share::ft2_keyinfo, ft_intXstore, get_key_full_length_rdonly, HA_FT_WLEN, HA_OFFSET_ERROR, key_length, keyinfo, st_mi_keydef::keylength, memcpy, mi_putint, st_myisam_info::page_changed, st_myisam_info::s, SEARCH_SAME, and set_if_smaller.
Referenced by _mi_ck_write_btree().
00306 { 00307 my_off_t root; 00308 DYNAMIC_ARRAY *da=info->ft1_to_ft2; 00309 MI_KEYDEF *keyinfo=&info->s->ft2_keyinfo; 00310 uchar *key_ptr= (uchar*) dynamic_array_ptr(da, 0), *end; 00311 uint length, key_length; 00312 DBUG_ENTER("_mi_ft_convert_to_ft2"); 00313 00314 /* we'll generate one pageful at once, and insert the rest one-by-one */ 00315 /* calculating the length of this page ...*/ 00316 length=(keyinfo->block_length-2) / keyinfo->keylength; 00317 set_if_smaller(length, da->elements); 00318 length=length * keyinfo->keylength; 00319 00320 get_key_full_length_rdonly(key_length, key); 00321 while (_mi_ck_delete(info, keynr, key, key_length) == 0) 00322 { 00323 /* 00324 nothing to do here. 00325 _mi_ck_delete() will populate info->ft1_to_ft2 with deleted keys 00326 */ 00327 } 00328 00329 /* creating pageful of keys */ 00330 mi_putint(info->buff,length+2,0); 00331 memcpy(info->buff+2, key_ptr, length); 00332 info->buff_used=info->page_changed=1; /* info->buff is used */ 00333 if ((root= _mi_new(info,keyinfo,DFLT_INIT_HITS)) == HA_OFFSET_ERROR || 00334 _mi_write_keypage(info,keyinfo,root,DFLT_INIT_HITS,info->buff)) 00335 DBUG_RETURN(-1); 00336 00337 /* inserting the rest of key values */ 00338 end= (uchar*) dynamic_array_ptr(da, da->elements); 00339 for (key_ptr+=length; key_ptr < end; key_ptr+=keyinfo->keylength) 00340 if(_mi_ck_real_write_btree(info, keyinfo, key_ptr, 0, &root, SEARCH_SAME)) 00341 DBUG_RETURN(-1); 00342 00343 /* now, writing the word key entry */ 00344 ft_intXstore(key+key_length, - (int) da->elements); 00345 _mi_dpointer(info, key+key_length+HA_FT_WLEN, root); 00346 00347 DBUG_RETURN(_mi_ck_real_write_btree(info, 00348 info->s->keyinfo+keynr, 00349 key, 0, 00350 &info->s->state.key_root[keynr], 00351 SEARCH_SAME)); 00352 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 264 of file ft_update.c.
References _mi_ft_erase(), _mi_ft_parserecord(), DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, error, free_root(), st_myisam_info::ft_memroot, MY_MARK_BLOCKS_FREE, and MYF.
00266 { 00267 int error= -1; 00268 FT_WORD *wlist; 00269 DBUG_ENTER("_mi_ft_del"); 00270 DBUG_PRINT("enter",("keynr: %d",keynr)); 00271 00272 if ((wlist=_mi_ft_parserecord(info, keynr, record, &info->ft_memroot))) 00273 error=_mi_ft_erase(info,keynr,keybuf,wlist,pos); 00274 00275 free_root(&info->ft_memroot, MYF(MY_MARK_BLOCKS_FREE)); 00276 DBUG_PRINT("exit",("Return: %d",error)); 00277 DBUG_RETURN(error); 00278 }
Here is the call graph for this function:

| const HA_KEYSEG ft_keysegs[FT_SEGS] |
1.4.7

